Changeset 7304
- Timestamp:
- 02/13/07 17:36:18 (22 months ago)
- Location:
- trunk/buildscripts
- Files:
-
- 3 modified
-
build.xml (modified) (1 diff)
-
buildUtil.js (modified) (3 diffs)
-
webbuild/webbuild.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/buildscripts/build.xml
r7205 r7304 481 481 <!-- end gen-strip-docs task --> 482 482 483 <!-- strip-resource-comments --> 484 <target name="strip-resource-comments"> 485 <java jar="./lib/custom_rhino.jar" failonerror="true" fork="true" 486 logerror="true"> 487 <arg value="stripComments.js" /> 488 <arg value="${release_dir}"/> 489 </java> 490 </target> 491 <!-- end strip-resource-comments --> 492 483 493 <!-- src task --> 484 494 <target name="src" -
trunk/buildscripts/buildUtil.js
r7285 r7304 860 860 //Don't process dojo.js since it has already been processed. 861 861 //Don't process dojo.js.uncompressed.js because it is huge. 862 if(!fileList[i].match(/dojo\.js$/) && !fileList[i].match(/dojo\.js\.uncompressed\.js$/)){ 862 //Don't process anything that might be in a buildscripts folder (only a concern for webbuild.sh) 863 if(!fileList[i].match(/dojo\.js$/) 864 && !fileList[i].match(/dojo\.js\.uncompressed\.js$/) 865 && !fileList[i].match(/buildscripts/)){ 863 866 print("Stripping comments from file: " + fileList[i]); 864 867 … … 870 873 871 874 //Get rid of cr, lf, since it messes up matching. 872 fileContents = fileContents.replace(/\r/g, "__DOJOCARRIAGERETURN__").replace(/\n/g, "__DOJONEWLINE__");873 var multiLineMatches = fileContents.match(/\/\*.*?copyright.*?\*\//gi);875 copyrightFileContents = fileContents.replace(/\r/g, "__DOJOCARRIAGERETURN__").replace(/\n/g, "__DOJONEWLINE__"); 876 var multiLineMatches = copyrightFileContents.match(/\/\*.*?copyright.*?\*\//gi); 874 877 875 878 //Finalize copyright notice. … … 887 890 888 891 //Remove whitespace. 889 var commandResults = buildUtil.runCommand("java -jar lib/custom_rhinoPrettyPrint.jar -strict -opt -1 -p " + fileList[i]); 892 var context = Packages.org.mozilla.javascript.Context.enter(); 893 try{ 894 // Use the interpreter for interactive input (copied this from Main rhino class). 895 context.setOptimizationLevel(-1); 896 897 var script = context.compileString(fileContents, fileList[i], 1, null); 898 fileContents = new String(context.decompileScript(script, 0)); 899 }catch(e){ 900 print("Could not strip comments for file: " + fileList[i]); 901 }finally{ 902 Packages.org.mozilla.javascript.Context.exit(); 903 } 890 904 891 if(commandResults.error){ 892 print("ERROR. Skipping file. Error is: " + commandResults.error); 893 }else{ 894 fileContents = commandResults.result; 895 896 //Replace the spaces with tabs. 897 //Ideally do this in the pretty printer rhino code. 898 fileContents = fileContents.replace(/ /g, "\t"); 899 900 //Write out the file with appropriate copyright. 901 buildUtil.saveUtf8File(fileList[i], copyrightText + buildUtil.getLineSeparator() + fileContents); 902 } 903 } 904 } 905 } 906 } 907 908 buildUtil.runCommand = function(/*String*/commandLineCommand){ 909 //summary: runs a command on the command line. 910 var process = java.lang.Runtime.getRuntime().exec(commandLineCommand); 911 var resultReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getInputStream())); 912 var resultLine = null; 913 var result = ""; 914 var lineSeparator = buildUtil.getLineSeparator(); 915 916 var error = ""; 917 var errorReader = new java.io.BufferedReader(new java.io.InputStreamReader(process.getErrorStream())); 918 //Only read one line of error, since waiting for all of it seems to hang. 919 //TODO: Fix that. There should be a way to get the complete error message. 920 if((resultLine = errorReader.readLine()) != null){ 921 error += new String(resultLine) + lineSeparator; 922 } 923 924 if(error){ 925 error = error.replace(/^\s*/, "").replace(/\s*$/, ""); 926 }else{ 927 while((resultLine = resultReader.readLine()) != null){ 928 result += new String(resultLine) + lineSeparator; 929 } 930 } 931 932 return {result: result, error: error}; //String 933 } 905 //Replace the spaces with tabs. 906 //Ideally do this in the pretty printer rhino code. 907 fileContents = fileContents.replace(/ /g, "\t"); 908 909 //Write out the file with appropriate copyright. 910 buildUtil.saveUtf8File(fileList[i], copyrightText + buildUtil.getLineSeparator() + fileContents); 911 } 912 } 913 } 914 } 915 -
trunk/buildscripts/webbuild/webbuild.sh
r7287 r7304 18 18 #Do xdajax build. 19 19 #Mark the dojo.js has an xdomain build, complete with xdomain path for Dojo. 20 ant -Dprofile=ajax -DreleaseName=$version -DdojoLoader=xdomain -Dversion=$version$versionSuffix -DxdDojoUrl=$xdDojoUrl clean release intern-strings xd-dojo-config 20 ant -Dprofile=ajax -DreleaseName=$version -DdojoLoader=xdomain -Dversion=$version$versionSuffix -DxdDojoUrl=$xdDojoUrl clean release intern-strings xd-dojo-config strip-resource-comments 21 21 22 #src folders/buildscripts for the webbuild stuff. 23 mkdir ../release 24 25 cd ../release 22 cd ../release/$version 26 23 mkdir web 27 24 cd web 28 cp -r ../../ src .29 cp -r ../../ buildscripts .30 cp -r ../../ dojo.js .31 cp -r ../../ iframe_history.html .32 cp -r ../../ flash6_gateway.swf .33 cp -r ../../ DojoFileStorageProvider.jar .34 cp -r ../../ storage_dialog.swf .35 cp -r ../../ Storage_version6.swf .36 cp -r ../../ Storage_version8.swf .25 cp -r ../../../src . 26 cp -r ../../../buildscripts . 27 cp -r ../../../dojo.js . 28 cp -r ../../../iframe_history.html . 29 cp -r ../../../flash6_gateway.swf . 30 cp -r ../../../DojoFileStorageProvider.jar . 31 cp -r ../../../storage_dialog.swf . 32 cp -r ../../../Storage_version6.swf . 33 cp -r ../../../Storage_version8.swf . 37 34 38 35 #Stamp the web build with the xd Dojo URL and version. … … 43 40 #Generate the list of modules for the web build process. 44 41 java -jar ../lib/custom_rhino.jar makeWebBuildModuleList.js ../../src treeData.js 45 cd ../../.. 42 43 #Got to buildscripts dir and run stripComments for web build. 44 cd .. 45 java -jar lib/custom_rhino.jar stripComments.js ../src 46 46 47 47 #Now in release folder. Bundle it all up. 48 mv web/ $version/ 48 cd ../../.. 49 49 zip -r dojo-$version.zip $version/* 50 50 mv dojo-$version.zip ../.. 51 51 52 #Return to start directory .52 #Return to start directory 53 53 cd ../../..