// // The Dojo Build System // // This is application is implemented as an AMD package intended to be loaded and executed by dojo. It is known to work correctly // with node.js (fast!) and rhino (slow!). The program may be started from a command prompt as follows: // // node.js: // >node path/to/dojotoolkit/dojo/dojo.js load=build // // rhino: // >java -jar path/to/js.jar path/to/dojotoolkit/dojo/dojo.js baseUrl=path/to/dojotoolkit/dojo load=build // // * notice that, owing to the defective design of rhino, it is impossible for a script to know the location from // which it was executed; therefore, the baseUrl must be provided. // // util/buildscripts/bng: // TODOC // // The application proceeds as follows: // // 1. Process the command line and then process the build control script(s)/profile as specified by the command line. // 2. Discover all resources as instructed by the build control script // 3. Move the resources through an ordered set of gates. Zero to many synchronous and/or asynchronous transforms may be applied to various // resources as specified by the build control script. Different resources can be subject to different transforms. Resources are allowed // to move through gates without stopping until a "synchronized" gate is encountered. All transforms must complete for the previous gate before // any transform is allowed on the synchronized gate. // 4. After the last gate has been completed, print a done message and terminate. // // See also: // // project home: http://bdframework.org/bdBuild/index // fossil: http://bdframework.org/bdBuild/repo // github: https://github.com/altoviso/bdBuild // docs: http://bdframework.org/bdBuild/docs define(["require", "dojo/has"], function(require, has){ // host-dependent environment initialization if(has("host-node")){ define("commandLineArgs", function(){ //arg[0] is node; argv[1] is dojo.js; therefore, start with argv[2] return process.argv.slice(2); }); // helps during dev or heavily async node... var util = require.nodeRequire("util"); debug = function(it, depth, inspect){ util.debug(inspect ? util.inspect(it, false, depth) : it); }; has.add("is-windows", process.platform == "win32"); }else if(has("host-rhino")){ define("commandLineArgs", [], function(){ var result = []; require.rawConfig.commandLineArgs.forEach(function(item){ var parts = item.split("="); if(parts[0]!="baseUrl"){ result.push(item); } }); return result; }); // TODO: make this real has.add("is-windows", /indows/.test(environment["os.name"])); }else{ console.log("unknown environment; terminating."); return 0; } this.require.scopeify = function(moduleList){ for(var p, mid, module, text = "", contextRequire = this, args = moduleList.split(","), i = 0; i" + dest); return; } // find the transformJob and start it... for(var i = 0; i