Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

fix build html5/hybrid bug for shared mojits #813

Merged
merged 1 commit into from
Nov 30, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions lib/app/commands/build/shared.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
});
}

Expand All @@ -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';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general I prefer "builders" so we avoid the assumption about whether there's a / needed or not. But +1 :).

buildmap[conf.tunnelpf + uri + conf.contextqs] = uri;
mapSpecUris(buildmap, conf, mojit.name, store);
}
});
}

Expand Down