Changeset 7912

Show
Ignore:
Timestamp:
04/02/07 17:47:11 (22 months ago)
Author:
jburke
Message:

(merge from 0.4 branch) Refs #2386. Create xd files for layered files.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/buildscripts/makeDojoJs.js

    r7908 r7912  
    22//This is the entry point for this script file. 
    33load("buildUtil.js"); 
     4load("buildUtilXd.js"); 
    45 
    56var profileFile = arguments[0]; 
     
    89var version = arguments[3]; 
    910var lineSeparator = java.lang.System.getProperty("line.separator"); 
     11 
     12var dependencyResult = buildUtil.loadDependencyList(profileFile); 
     13var isXDomain = (buildUtil.getDojoLoader(dependencyResult.dependencies) == "xdomain"); 
     14var prefixes = dependencyResult.dependencies.prefixes || []; 
    1015 
    1116var result = buildUtil.makeDojoJs(buildUtil.loadDependencyList(profileFile), version); 
     
    1722for(var i = 1; i < result.length; i++){ 
    1823        var layerName = releaseDir + "/" + result[i].layerName; 
     24        var layerContents = result[i].contents; 
    1925        var uncompressedLayerName = layerName + ".uncompressed.js"; 
    2026 
    21         buildUtil.saveFile(uncompressedLayerName, result[i].contents); 
     27        buildUtil.saveFile(uncompressedLayerName, layerContents); 
    2228         
     29        //If doing xd build, save an uncompressed xd file. 
     30        if(isXDomain){ 
     31                var xdUncompressedFileName = uncompressedLayerName.replace(/\.js$/, ".xd.js"); 
     32                var xdContents = buildUtilXd.makeXdContents(layerContents, "../", prefixes); 
     33                buildUtil.saveFile(xdUncompressedFileName, xdContents); 
     34        } 
     35 
    2336        //Compress the layer files. It is clunky to do it here and have dojo.js 
    2437        //compression done elsewhere. This will be fixed in 0.9 re-org. 
     
    3346        //Save the optimized file. 
    3447        buildUtil.saveFile(layerName, fileContents); 
     48 
     49        //If xdomain, optimize the xd.js file too.  
     50        if(isXDomain){ 
     51                xdContents = new String(buildUtil.readFile(xdUncompressedFileName)); 
     52                xdContents = buildUtil.optimizeJs(xdUncompressedFileName, xdContents, copyright, true); 
     53                buildUtil.saveFile(layerName.replace(/\.js$/, ".xd.js"), xdContents); 
     54        } 
    3555} 
    3656