From 8ea135e4277473dc538a0c5cfc6c4d60862aabb5 Mon Sep 17 00:00:00 2001 From: Isao Yagi Date: Thu, 29 Nov 2012 17:09:23 -0800 Subject: [PATCH] fix build html5/hybrid bug for shared mojits url metadata for shared/app-level mojits is in a special mojit named "Shared", not via the mojit it was packaged in. --- lib/app/commands/build/shared.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/app/commands/build/shared.js b/lib/app/commands/build/shared.js index 127d660f0..35dda2993 100644 --- a/lib/app/commands/build/shared.js +++ b/lib/app/commands/build/shared.js @@ -30,7 +30,9 @@ function mapSpecUris(buildmap, conf, name, store) { specs = store.getResources('client', conf.context, opts); Object.keys(specs).forEach(function (spec) { - buildmap[conf.tunnelpf + spec.url + conf.contextqs] = spec.url; + if (spec.hasOwnProperty('url')) { // see mapDefxUris [urls] comment + buildmap[conf.tunnelpf + spec.url + conf.contextqs] = spec.url; + } }); } @@ -39,10 +41,15 @@ function mapDefxUris(buildmap, conf, store) { var mojits = store.getResources('client', conf.context, {type: 'mojit'}); mojits.forEach(function (mojit) { - var uri = mojit.url + '/definition.json'; - - buildmap[conf.tunnelpf + uri + conf.contextqs] = uri; - mapSpecUris(buildmap, conf, mojit.name, store); + var uri; + /* [urls] note not all client mojits are url-addressable; resources in + "app-level" (aka shared) mojits get uris via a special RS mojit named + "Shared", not via the mojit they came in */ + if (mojit.hasOwnProperty('url')) { + uri = mojit.url + '/definition.json'; + buildmap[conf.tunnelpf + uri + conf.contextqs] = uri; + mapSpecUris(buildmap, conf, mojit.name, store); + } }); }