Changeset 7285
- Timestamp:
- 02/11/07 22:56:11 (22 months ago)
- Location:
- trunk/buildscripts
- Files:
-
- 3 modified
-
buildUtil.js (modified) (1 diff)
-
makeDojoJsWeb.js (modified) (1 diff)
-
webbuild/index.html (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/buildscripts/buildUtil.js
r7281 r7285 292 292 //Insert all the provide statements at the provide insertion marker. 293 293 var provideString = ""; 294 for(var i = 0; i < provideList.length; i++){ 295 provideString += 'dojo.provide("' + provideList[i] + '");' + lineSeparator; 294 if(provideList && provideList.length > 0){ 295 for(var i = 0; i < provideList.length; i++){ 296 provideString += 'dojo.provide("' + provideList[i] + '");' + lineSeparator; 297 } 296 298 } 297 299 dojoContents = dojoContents.replace(/__DOJO_PROVIDE_INSERTION__/, provideString); -
trunk/buildscripts/makeDojoJsWeb.js
r7275 r7285 10 10 11 11 depList = depList.split(","); 12 provideList = provideList.split(","); 12 13 //Check if there were no provideList (the caller can send string "null" 14 //to indicate that the command line parameter is empty. We need some string 15 //to make sure all the arguments are in the right spot. 16 if(provideList == "null"){ 17 provideList = "[]"; 18 }else{ 19 provideList = provideList.split(","); 20 provideList = '["' + provideList.join('","') + '"]'; 21 } 13 22 14 23 var dependencyResult; 15 eval('dependencyResult = {depList: ["' + depList.join('","') + '"], provideList: ["' + provideList.join('","') + '"]};');24 eval('dependencyResult = {depList: ["' + depList.join('","') + '"], provideList: ' + provideList + '};'); 16 25 17 //Load dojo (needed for string interning) 18 djConfig={ 19 baseRelativePath: "../" 20 }; 21 load('../dojo.js'); 22 dojo.require("dojo.string.extras"); 23 24 var contents = buildUtil.makeDojoJs(dependencyResult, version).dojoContents; 25 26 //Add copyright, and intern strings. 27 contents = new String(readFile("copyright.txt")) + buildUtil.interningRegexpMagic("xdomain", contents, djConfig.baseRelativePath, [["dojo", "src"]], [], true); 28 29 if(xdDojoUrl){ 30 contents = buildUtilXd.setXdDojoConfig(contents, xdDojoUrl); 26 //Make sure we are dealing with JS files and that the paths are not outside 27 //of the working area. Do this to discourage fetching arbitrary files from 28 //the server. 29 var deps = dependencyResult.depList; 30 var isInputOk = true; 31 for(var i = 0; i < deps.length; i++){ 32 var matches = deps[i].match(/\.\./g); 33 if((matches && matches.length > 1) || !deps[i].match(/\.js$/) || deps[i].indexOf(0) == '/'){ 34 print("Error: Invalid file set."); 35 isInputOk = false; 36 break; 37 } 31 38 } 32 39 33 print(contents); 40 if(isInputOk){ 41 //Load dojo (needed for string interning) 42 djConfig={ 43 baseRelativePath: "../" 44 }; 45 load('../dojo.js'); 46 dojo.require("dojo.string.extras"); 47 48 var contents = buildUtil.makeDojoJs(dependencyResult, version).dojoContents; 49 50 //Add copyright, and intern strings. 51 contents = new String(readFile("copyright.txt")) + buildUtil.interningRegexpMagic("xdomain", contents, djConfig.baseRelativePath, [["dojo", "src"]], [], true); 52 53 if(xdDojoUrl){ 54 contents = buildUtilXd.setXdDojoConfig(contents, xdDojoUrl); 55 } 56 57 print(contents); 58 } -
trunk/buildscripts/webbuild/index.html
r7281 r7285 159 159 } 160 160 161 superMessage = null; 162 function onTreeSelect(message){ 163 //summary: event called when a tree node is selected. 164 //Adds item to module list for build. 165 superMessage = message; 166 var treeItem = message.node; 167 var moduleName = treeItem["dojoModuleName"]; 168 if(moduleName){ 169 var existingDeps = getNormalizedDependencies(); 170 var matchRegExp = new RegExp(moduleName.replace('"' + /\./g, "\\.").replace(/\*/g, "\\*") + '"(,|$)'); 171 if(!existingDeps.match(matchRegExp)){ 172 var depTextArea = dojo.byId("dependencyList"); 173 var textValue = depTextArea.value; 174 if(textValue && textValue.charAt(depTextArea.value.length - 1) != "\n"){ 175 textValue += "\n"; 176 } 177 depTextArea.value = textValue + moduleName + "\n"; 178 } 179 } 180 } 181 161 182 dojo.addOnLoad(function(){ 162 183 startup(); … … 171 192 var treeWidget = dojo.widget.createWidget("TreeV3", {listeners: [selector.widgetId, controller.widgetId]}); 172 193 173 dojo.event.topic.subscribe(selector.eventNames. select, this, "onTreeSelect")194 dojo.event.topic.subscribe(selector.eventNames.dblselect, window, "onTreeSelect") 174 195 175 196 if(typeof treeData == "undefined"){ … … 207 228 }); 208 229 209 function startBuild(){230 function getNormalizedDependencies(){ 210 231 var deps = dojo.byId('dependencyList').value.replace(/^\s+/, "").replace(/\s+$/, ""); 211 232 … … 224 245 deps = goodParts.join(","); 225 246 } 226 227 builderFrame.startBuild(deps, version, xdDojoUrl); 247 return deps; 248 } 249 250 function startBuild(){ 251 builderFrame.startBuild(getNormalizedDependencies(), version, xdDojoUrl); 228 252 } 229 253