Opened 12 years ago

Closed 12 years ago

#4146 closed defect (fixed)

[patch][cla]Allow custom copyrights in builds.

Reported by: James Burke Owned by: James Burke
Priority: high Milestone: 0.9
Component: BuildSystem Version: 0.9
Keywords: Cc:
Blocked By: Blocking:

Description

This is a patch that was received in email from Sun (CCLA on file). Things have changed a bit in 0.9, but make sure that custom copyrights can be placed in the layer files.

Index: buildscripts/makeDojoJs.js
===================================================================
RCS file: /m/src/ns/server/kendo/third-party/dojo/buildscripts/makeDojoJs.js,v
retrieving revision 1.1.1.2
diff -u -F^f -r1.1.1.2 makeDojoJs.js
--- buildscripts/makeDojoJs.js  6 Jun 2007 18:21:51 -0000       1.1.1.2
+++ buildscripts/makeDojoJs.js  14 Jun 2007 07:00:30 -0000
@@ -24,6 +24,14 @@
 //Save the other layers, if there are any.
 for(var i = 1; i < result.length; i++){
       var layerName = releaseDir + "/" + result[i].layerName;
+       var layerCopyright = copyright;
+       if (result[i].layerCopyright) {
+               var fileName = releaseDir+"/"+result[i].layerCopyright;
+               var file = new java.io.File(fileName);
+               if(file.exists()){
+                       layerCopyright = new String(buildUtil.readFile(fileName));
+               }
+       }
       var layerContents = result[i].contents;
       var uncompressedLayerName = layerName + ".uncompressed.js";

@@ -33,7 +41,7 @@ for(var i = 1; i < result.length; i++){
       //Save a compressed layer file. It is clunky to do it here and have dojo.js
       //compression done elsewhere. This will be fixed in 0.9 re-org.
       print("Compressing file: " + layerName);
-       var compressedContents = buildUtil.optimizeJs(uncompressedLayerName, layerContents, copyright, true);
+       var compressedContents = buildUtil.optimizeJs(uncompressedLayerName, layerContents, layerCopyright, true);
       compressedContents = compressedContents.replace(/
/g, "");
       buildUtil.saveFile(layerName, compressedContents);

@@ -55,7 +63,7 @@ for(var i = 1; i < result.length; i++){

               //Compress it.
               var xdContents = buildUtil.readFile(xdUncompressedFileName);
-               xdContents = buildUtil.optimizeJs(xdUncompressedFileName, xdContents, copyright, true);
+               xdContents = buildUtil.optimizeJs(xdUncompressedFileName, xdContents, layerCopyright, true);
               buildUtil.saveFile(layerName.replace(/.js$/, ".xd.js"), xdContents);
       }
 }

Change History (1)

comment:1 Changed 12 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [10208]) Fixes #4146: allow a custom copyright per layer file.

Note: See TracTickets for help on using tickets.