Changeset 7415
- Timestamp:
- 02/22/07 23:03:33 (18 months ago)
- Location:
- trunk/buildscripts
- Files:
-
- 5 modified
- 1 copied
-
buildUtil.js (modified) (6 diffs)
-
makeDojoJsWeb.js (modified) (1 diff)
-
setXdDojoConfig.js (modified) (1 diff)
-
webbuild/makeWebBuildModuleList.js (modified) (1 diff)
-
webbuild/topIndex.html (copied) (copied from branches/0.4/buildscripts/webbuild/topIndex.html)
-
webbuild/webbuild.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/buildscripts/buildUtil.js
r7397 r7415 238 238 var dependencies = null; 239 239 var hostenvType = null; 240 var profileText = readFile(profileFile);240 var profileText = new String(buildUtil.readFile(profileFile)); 241 241 242 242 //Remove the call to getDependencyList.js because we want to call it manually. … … 264 264 for(var i = 0; i < depList.length; i++){ 265 265 //Make sure we have a JS string and not a Java string by using new String(). 266 dojoContents += new String( readFile(depList[i])) + "\r\n";266 dojoContents += new String(buildUtil.readFile(depList[i])) + "\r\n"; 267 267 } 268 268 … … 812 812 } 813 813 814 buildUtil.readFile = function(/*String*/path, /*String?*/encoding){ 815 encoding = encoding || "utf-8"; 816 var file = new java.io.File(path); 817 var lineSeparator = buildUtil.getLineSeparator(); 818 var input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)); 819 try { 820 var stringBuffer = new java.lang.StringBuffer(); 821 var line = ""; 822 while((line = input.readLine()) !== null){ 823 stringBuffer.append(line); 824 stringBuffer.append(lineSeparator); 825 } 826 return stringBuffer.toString(); 827 } finally { 828 input.close(); 829 } 830 } 831 814 832 buildUtil.saveUtf8File = function(/*String*/fileName, /*String*/fileContents){ 815 833 buildUtil.saveFile(fileName, fileContents, "utf-8"); … … 842 860 buildUtil.stripComments = function(/*String*/startDir, /*boolean*/suppressDojoCopyright){ 843 861 //summary: strips the JS comments from all the files in "startDir", and all subdirectories. 844 var copyright = suppressDojoCopyright ? "" : (new String( readFile("copyright.txt")) + buildUtil.getLineSeparator());862 var copyright = suppressDojoCopyright ? "" : (new String(buildUtil.readFile("copyright.txt")) + buildUtil.getLineSeparator()); 845 863 var fileList = buildUtil.getFilteredFileList(startDir, /\.js$/, true); 846 864 if(fileList){ … … 854 872 print("Stripping comments from file: " + fileList[i]); 855 873 856 //Read in the file. 857 var fileContents = readFile(fileList[i]);858 874 //Read in the file. Make sure we have a JS string. 875 var fileContents = new String(buildUtil.readFile(fileList[i])); 876 859 877 //Look for copyright. If so, maintain it. 860 878 var singleLineMatches = fileContents.match(/\/\/.*copyright.*$/gi); … … 895 913 //Ideally do this in the pretty printer rhino code. 896 914 fileContents = fileContents.replace(/ /g, "\t"); 897 915 898 916 //Write out the file with appropriate copyright. 899 917 buildUtil.saveUtf8File(fileList[i], copyrightText + fileContents); -
trunk/buildscripts/makeDojoJsWeb.js
r7285 r7415 49 49 50 50 //Add copyright, and intern strings. 51 contents = new String( readFile("copyright.txt")) + buildUtil.interningRegexpMagic("xdomain", contents, djConfig.baseRelativePath, [["dojo", "src"]], [], true);51 contents = new String(buildUtil.readFile("copyright.txt")) + buildUtil.interningRegexpMagic("xdomain", contents, djConfig.baseRelativePath, [["dojo", "src"]], [], true); 52 52 53 53 if(xdDojoUrl){ -
trunk/buildscripts/setXdDojoConfig.js
r7102 r7415 7 7 load("buildUtilXd.js"); 8 8 9 var fileContents = new String( readFile(dojoFile));9 var fileContents = new String(buildUtil.readFile(dojoFile)); 10 10 fileContents = buildUtilXd.setXdDojoConfig(fileContents, xdUrl); 11 11 buildUtil.saveFile(dojoFile, fileContents); -
trunk/buildscripts/webbuild/makeWebBuildModuleList.js
r7175 r7415 57 57 for(var i = 0; i < fileList.length; i++){ 58 58 var fileName = fileList[i]; 59 var fileContents = readFile(fileName);59 var fileContents = new String(buildUtil.readFile(fileName)); 60 60 61 61 var matches = fileContents.match(provideRegExp); -
trunk/buildscripts/webbuild/webbuild.js
r7281 r7415 11 11 } 12 12 13 readText = readFile = function(uri){13 buildUtil.readFile = readText = readFile = function(uri){ 14 14 return dojo.hostenv.getText(uri); 15 15 }