Changeset 7396
- Timestamp:
- 02/21/07 17:12:31 (21 months ago)
- Files:
-
- 1 modified
-
branches/0.4/buildscripts/buildUtil.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.4/buildscripts/buildUtil.js
r7338 r7396 262 262 //provide statements. 263 263 var dojoContents = ""; 264 var insertedProvideMarker = false;265 264 for(var i = 0; i < depList.length; i++){ 266 265 //Make sure we have a JS string and not a Java string by using new String(). 267 266 dojoContents += new String(readFile(depList[i])) + "\r\n"; 268 if(!insertedProvideMarker && depList[i].indexOf("hostenv_") != -1){ 269 dojoContents += "__DOJO_PROVIDE_INSERTION__"; 270 insertedProvideMarker = true; 271 } 272 } 273 274 //Move all the dojo.provide calls to the top, and remove any matching dojo.require calls. 275 //Sort the provide list alphabetically to make it easy to read. Order of provide statements 276 //do not matter. 267 } 268 269 //Construct a string of all the dojo.provide statements. 270 //This string will be used to construct the regexp that will be 271 //used to remove matching dojo.require statements. 272 //Sort the provide list alphabetically to make it easy to read. 273 //Order of provide statements do not matter. 277 274 var provideList = dependencyResult.provideList.sort(); 278 275 var depRegExpString = ""; … … 286 283 //If we have a string for a regexp, do the dojo.require() removal now. 287 284 if(depRegExpString){ 288 var depRegExp = new RegExp("dojo\\.( provide|require)\\((" + depRegExpString + ")\\)(;?)", "g");285 var depRegExp = new RegExp("dojo\\.(require)\\((" + depRegExpString + ")\\)(;?)", "g"); 289 286 dojoContents = dojoContents.replace(depRegExp, ""); 290 287 } 291 292 //Insert all the provide statements at the provide insertion marker.293 var provideString = "";294 if(provideList && provideList.length > 0){295 for(var i = 0; i < provideList.length; i++){296 provideString += 'dojo.provide("' + provideList[i] + '");' + lineSeparator;297 }298 }299 dojoContents = dojoContents.replace(/__DOJO_PROVIDE_INSERTION__/, provideString);300 288 301 289 //Set version number.