cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/2] cordova-lib git commit: CB-8158 adding symbolList to cordova.js
Date Thu, 18 Dec 2014 05:14:15 GMT
Repository: cordova-lib
Updated Branches:
  refs/heads/master 4ab367a1b -> 0f10ec4a0


CB-8158 adding symbolList to cordova.js


Project: http://git-wip-us.apache.org/repos/asf/cordova-lib/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-lib/commit/3c6b473b
Tree: http://git-wip-us.apache.org/repos/asf/cordova-lib/tree/3c6b473b
Diff: http://git-wip-us.apache.org/repos/asf/cordova-lib/diff/3c6b473b

Branch: refs/heads/master
Commit: 3c6b473b38567c837f67a8242638a96a48fe93d0
Parents: 0893c59
Author: Anis Kadri <anis@apache.org>
Authored: Wed Dec 17 21:13:41 2014 -0800
Committer: Anis Kadri <anis@apache.org>
Committed: Wed Dec 17 21:13:41 2014 -0800

----------------------------------------------------------------------
 cordova-lib/package.json                      |  3 ++-
 cordova-lib/src/plugman/prepare-browserify.js | 23 +++++++++++++++++-----
 2 files changed, 20 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/3c6b473b/cordova-lib/package.json
----------------------------------------------------------------------
diff --git a/cordova-lib/package.json b/cordova-lib/package.json
index 7e157d9..06dc83f 100644
--- a/cordova-lib/package.json
+++ b/cordova-lib/package.json
@@ -38,7 +38,8 @@
     "cordova-js": "3.7.2",
     "d8": "0.4.4",
     "unorm": "1.3.3",
-    "valid-identifier": "0.0.1"
+    "valid-identifier": "0.0.1",
+    "through2": "0.6.3"
   },
   "devDependencies": {
     "jshint": "2.5.8",

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/3c6b473b/cordova-lib/src/plugman/prepare-browserify.js
----------------------------------------------------------------------
diff --git a/cordova-lib/src/plugman/prepare-browserify.js b/cordova-lib/src/plugman/prepare-browserify.js
index 6c3ac82..1d855ce 100644
--- a/cordova-lib/src/plugman/prepare-browserify.js
+++ b/cordova-lib/src/plugman/prepare-browserify.js
@@ -24,6 +24,7 @@
 
 var platform_modules   = require('./platforms'),
     path               = require('path'),
+    through            = require('through2'),
     config_changes     = require('./util/config-changes'),
     xml_helpers        = require('../util/xml-helpers'),
     wp8                = require('./platforms/wp8'),
@@ -61,12 +62,25 @@ function uninstallQueuedPlugins(platform_json, wwwDir) {
     }
 }
 
-function generateFinalBundle(platform, libraryRelease, outReleaseFile, commitId, platformVersion,
symbolList) {
+function generateFinalBundle(platform, libraryRelease, outReleaseFile, commitId, platformVersion)
{
 
     var outReleaseFileStream = fs.createWriteStream(outReleaseFile);
     var time = new Date().valueOf();
+    var symbolList = null;
+
+    var addSymbolList = through.obj(function(row, enc, next) {
+        if(symbolList === null) {
+            symbolList = requireTr.getModules();
+            this.push(util.format("var symbolList = %s;\n%s\n", JSON.stringify(symbolList),
row));
+        } else {
+            this.push(row);
+        }
+        next();
+    });
 
-    writeLicenseHeader(outReleaseFileStream, platform, commitId, platformVersion, symbolList);
+    libraryRelease.pipeline.get('wrap').push(addSymbolList);
+    
+    writeLicenseHeader(outReleaseFileStream, platform, commitId, platformVersion);
 
     var releaseBundle = libraryRelease.bundle();
 
@@ -77,6 +91,7 @@ function generateFinalBundle(platform, libraryRelease, outReleaseFile, commitId,
         plugman.emit('verbose', 'generated cordova.' + platform + '.js @ ' + commitId + '
in ' + newtime + 'ms');
         // TODO clean up all the *.browserify files
     });
+    
 
     outReleaseFileStream.on('error', function(err) {
         var newtime = new Date().valueOf() - time;
@@ -108,8 +123,8 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir,
www_
     config_changes.process(plugins_dir, project_dir, platform);
 
     if(!is_top_level) return;
+    requireTr.init(platform);
 
-    requireTr.platform = platform;
     var platformVersion;
     computeCommitId(function(commitId) { 
         //run version script for each platform to get platformVersion
@@ -178,7 +193,6 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir,
www_
 
                         var fsPath = path.join.apply(path, pathParts);
                         var scriptPath = path.join(pluginDir, fsPath);
-
                         requireTr.addModule({symbol: moduleName, path: scriptPath});
 
                         module.getchildren().forEach(function(child) {
@@ -203,7 +217,6 @@ module.exports = function handlePrepare(project_dir, platform, plugins_dir,
www_
                 });
 
                 var outReleaseFile = path.join(wwwDir, 'cordova.js');
-
                 generateFinalBundle(platform, libraryRelease, outReleaseFile, commitId, platformVersion,
requireTr.getModules());
             } 
         });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message