Changeset 7075
- Timestamp:
- 01/24/07 14:45:11 (19 months ago)
- Location:
- branches/0.4/buildscripts
- Files:
-
- 3 modified
- 2 copied
-
buildUtil.js (modified) (8 diffs)
-
buildUtilXd.js (modified) (1 diff)
-
makeDojoJs.js (modified) (1 diff)
-
webbuild (copied) (copied from trunk/buildscripts/webbuild)
-
webbuild.html (copied) (copied from trunk/buildscripts/webbuild.html)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/buildscripts/buildUtil.js
r7054 r7075 1 1 var buildUtil = {}; 2 buildUtil.getDependencyList = function(dependencies, hostenvType) { 3 djConfig = { 4 baseRelativePath: "../" 5 // isDebug: true 6 }; 7 2 3 buildUtil.getLineSeparator = function(){ 4 //summary: Gives the line separator for the platform. 5 //For web builds override this function. 6 return java.lang.System.getProperty("line.separator"); 7 } 8 9 buildUtil.getDojoLoader = function(/*Object?*/dependencies){ 10 //summary: gets the type of Dojo loader for the build. For example default or 11 //xdomain loading. Override for web builds. 12 return (dependencies && dependencies["loader"] ? dependencies["loader"] : java.lang.System.getProperty("DOJO_LOADER")); 13 } 14 15 buildUtil.getDependencyList = function(/*Object*/dependencies, /*String or Array*/hostenvType, /*boolean?*/isWebBuild){ 16 if(!isWebBuild){ 17 djConfig = { 18 baseRelativePath: "../" 19 // isDebug: true 20 }; 21 } 22 8 23 if(!dependencies){ 9 24 dependencies = [ … … 17 32 ]; 18 33 } 19 20 var dojoLoader = java.lang.System.getProperty("DOJO_LOADER");34 35 var dojoLoader = buildUtil.getDojoLoader(dependencies); 21 36 if(!dojoLoader || dojoLoader=="null" || dojoLoader==""){ 22 37 dojoLoader = "default"; 23 38 } 24 dj_global = {}; 25 26 load("../src/bootstrap1.js"); 27 load("../src/loader.js"); 28 load("../src/hostenv_rhino.js"); 29 load("../src/bootstrap2.js"); 30 31 // FIXME: is this really what we want to say? 32 dojo.render.html.capable = true; 33 39 40 if(!isWebBuild){ 41 dj_global = {}; 42 43 load("../src/bootstrap1.js"); 44 load("../src/loader.js"); 45 load("../src/hostenv_rhino.js"); 46 load("../src/bootstrap2.js"); 47 48 // FIXME: is this really what we want to say? 49 dojo.render.html.capable = true; 50 } 51 34 52 dojo.hostenv.loadedUris.push("dojoGuardStart.js"); 35 53 dojo.hostenv.loadedUris.push("../src/bootstrap1.js"); … … 93 111 load = function(uri){ 94 112 try{ 95 var text = removeComments( readText(uri));113 var text = removeComments((isWebBuild ? dojo.hostenv.getText(uri) : readText(uri))); 96 114 var requires = dojo.hostenv.getRequiresAndProvides(text); 97 115 eval(requires.join(";")); … … 100 118 var delayRequires = dojo.hostenv.getDelayRequiresAndProvides(text); 101 119 eval(delayRequires.join(";")); 102 }catch(e){ 103 java.lang.System.err.println("error loading uri: " + uri + ", exception: " + e); 104 quit(-1); 120 }catch(e){ 121 if(isWebBuild){ 122 dojo.debug("error loading uri: " + uri + ", exception: " + e); 123 }else{ 124 java.lang.System.err.println("error loading uri: " + uri + ", exception: " + e); 125 quit(-1); 126 } 105 127 } 106 128 return true; 129 } 130 131 if(isWebBuild){ 132 dojo.hostenv.oldLoadUri = dojo.hostenv.loadUri; 133 dojo.hostenv.loadUri = load; 107 134 } 108 135 … … 194 221 } 195 222 196 load = old_load; // restore the original load function 197 dj_eval = old_eval; // restore the original dj_eval function 198 199 dj_global['dojo'] = undefined; 200 dj_global['djConfig'] = undefined; 201 delete dj_global; 202 223 if(isWebBuild){ 224 dojo.hostenv.loadUri = dojo.hostenv.oldLoadUri; 225 }else{ 226 load = old_load; // restore the original load function 227 dj_eval = old_eval; // restore the original dj_eval function 228 229 dj_global['dojo'] = undefined; 230 dj_global['djConfig'] = undefined; 231 delete dj_global; 232 } 233 203 234 return { 204 235 depList: depList, … … 224 255 } 225 256 226 buildUtil.makeDojoJs = function(/*String*/profileFile, /*String*/version){ 227 //summary: Makes the uncompressed contents for dojo.js. 228 229 //Get the profileFile text. 230 var lineSeparator = java.lang.System.getProperty("line.separator"); 231 232 //Remove the call to getDependencyList.js because we want to call it manually. 233 var depLists = buildUtil.loadDependencyList(profileFile); 234 var depList = depLists.depList; 257 buildUtil.makeDojoJs = function(/*Object*/dependencyResult, /*String*/version){ 258 //summary: Makes the uncompressed contents for dojo.js using the object 259 //returned from buildUtil.getDependencyList() 260 261 var lineSeparator = buildUtil.getLineSeparator(); 262 var depList = dependencyResult.depList; 235 263 236 264 //Concat the files together, and mark where we should insert all the … … 250 278 //Sort the provide list alphabetically to make it easy to read. Order of provide statements 251 279 //do not matter. 252 var provideList = dep Lists.provideList.sort();280 var provideList = dependencyResult.provideList.sort(); 253 281 var depRegExpString = ""; 254 282 for(var i = 0; i < provideList.length; i++){ … … 437 465 438 466 //Get the generated, flattened bundle. 439 var module = dojo. evalObjPath(moduleName);467 var module = dojo.getObject(moduleName); 440 468 var bundleLocale = localeName ? localeName.replace(/-/g, "_") : "ROOT"; 441 469 var flattenedBundle = module.nls[bundleName][bundleLocale]; -
branches/0.4/buildscripts/buildUtilXd.js
r6725 r7075 1 //The functions in this file assume that buildUtil.js have been loaded. 1 2 var buildUtilXd = {}; 3 4 buildUtilXd.setXdDojoConfig = function(/*String*/fileContents, /*String*/url){ 5 //summary: sets sets up xdomain loading for a particular URL. 6 //parameters: 7 // fileContents: be a built dojo.js (can be uncompressed or compressed). 8 // url: value should include the /src path for the xdomain dojo. 9 // Example: "http://some.domain.com/dojo-xdversion/src" (no ending slash) 10 //This function will inject some contents before the dojo.hostenv.resetXd() definition, 11 //so the contents of fileName should have been a dojo.js that includes the contents 12 //of loader_xd.js (specify -DdojoLoader=xdomain in the build command). 13 14 return fileContents.replace(/dojo\.hostenv\.resetXd\s*\=/, "djConfig.useXDomain = true;\ndojo.registerModulePath(\"dojo\", \"" 15 + url 16 + "\");\ndojo.hostenv.resetXd="); 17 } 2 18 3 19 //START makeXdContents function -
branches/0.4/buildscripts/makeDojoJs.js
r7054 r7075 9 9 var lineSeparator = java.lang.System.getProperty("line.separator"); 10 10 11 var result = buildUtil.makeDojoJs( profileFile, version);11 var result = buildUtil.makeDojoJs(buildUtil.loadDependencyList(profileFile), version); 12 12 13 13 //Save the dojo.js contents.