-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first draft of dojox/app build support
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
define(["build/buildControlDefault"], function(bc){ | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
cjolif
Author
Contributor
|
||
// module: | ||
// dojox/app/build/buildControlApp | ||
// summary: | ||
// This module extend default build control module to add dojox/app build support | ||
bc.transforms["depsAppConfig"] = ["dojox/app/build/depsAppConfig", "read"]; | ||
// add the job at the right place in default control | ||
bc.transformJobs.splice(bc.transformJobs.length - 2, 0, [ | ||
// json dojo app config files needs to go through depsAppConfig | ||
function(resource, bc){ | ||
// parse all JSON files (some might not be app config but | ||
// we will ignore them in the transform | ||
return /\.json$/.test(resource.src); | ||
}, | ||
["read", "depsAppConfig", "write"] | ||
]); | ||
return bc; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
define([ | ||
"build/buildControl", | ||
"dojox/json/ref" | ||
], function(bc, json){ | ||
return function(resource){ | ||
var mids = [], | ||
str = resource.text; | ||
|
||
try{ | ||
var config = json.fromJson(str); | ||
}catch(e){ | ||
} | ||
|
||
if(!config){ | ||
return; | ||
} | ||
|
||
if(config.dependencies){ | ||
mids = mids.concat(config.dependencies); | ||
} | ||
if(config.controllers){ | ||
mids = mids.concat(config.controllers); | ||
} | ||
if(config.modules){ | ||
mids = mids.concat(config.modules); | ||
} | ||
|
||
// Iterate through the layers, identify those that contain this resource.mid, | ||
// remove it from the include array and then add this resource's includes | ||
for(var mid in bc.amdResources){ | ||
if(bc.amdResources[mid].layer){ // This resource is a layer | ||
var includes = bc.amdResources[mid].layer.include, | ||
idx = includes.indexOf(resource.mid); | ||
// Bitwise operator that returns true if the layer contains this resource | ||
if(~idx){ | ||
// Remove this resources mid from the layer's include array | ||
includes.splice(idx, 1); | ||
mids.forEach(function(dep){ | ||
// Uniquely add appropriate mids to the layer's include array | ||
if(!(/^(require|exports|module)$/.test(dep))){ | ||
if(!~includes.indexOf(dep)){ | ||
includes.push(dep); | ||
} | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
|
||
}; | ||
}); |
This line is breaking the API doc parser. There is no package called "build". Only dojo, dijit, and dojox. Should this be a relative path?