cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [04/45] js commit: adding browserify bundle
Date Thu, 24 Apr 2014 21:10:49 GMT
adding browserify bundle


Project: http://git-wip-us.apache.org/repos/asf/cordova-js/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-js/commit/42621ce8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/42621ce8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/42621ce8

Branch: refs/heads/master
Commit: 42621ce868692caa13308120fd9e0ecf92d5c211
Parents: 565c6be
Author: Anis Kadri <anis@apache.org>
Authored: Mon Feb 3 22:21:28 2014 -0800
Committer: Anis Kadri <anis@apache.org>
Committed: Mon Feb 3 22:21:28 2014 -0800

----------------------------------------------------------------------
 tasks/lib/bundle-browserify.js | 62 +++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/42621ce8/tasks/lib/bundle-browserify.js
----------------------------------------------------------------------
diff --git a/tasks/lib/bundle-browserify.js b/tasks/lib/bundle-browserify.js
new file mode 100644
index 0000000..3d91e42
--- /dev/null
+++ b/tasks/lib/bundle-browserify.js
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF
+ * or more contributor license agreements.  See th
+ * distributed with this work for additional infor
+ * regarding copyright ownership.  The ASF license
+ * to you under the Apache License, Version 2.0 (t
+ * "License"); you may not use this file except in
+ * with the License.  You may obtain a copy of the
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to 
+ * software distributed under the License is distr
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS
+ * KIND, either express or implied.  See the Licen
+ * specific language governing permissions and lim
+ * under the License.
+ */
+var fs           = require('fs');
+var path         = require('path');
+var browserify   = require('browserify');
+var require_tr   = require('./require-tr');
+var licensePath  = path.join(__dirname, '..', 'templates', 'LICENSE-for-js-file.txt');
+var root         = path.join(__dirname, '..', '..')
+
+
+module.exports = function bundle(platform, debug, commitId) {
+    // FIXME: need to find a way to void ignore missing
+    var b = browserify();
+    // XXX plugin_list is not present at this stage 
+    b.ignore(path.join(root, 'src', 'common', 'plugin_list'));
+
+   // if (platform === 'test') {
+   //     // FIXME why does 'test' resolve a bunch of android stuff?! 
+   //     var testFilesPath = path.join('src', 'android', 'android');
+   //     copyProps(modules, collectFiles(testFilesPath, 'android/'));
+   // }
+
+   // var output = [];
+	
+   // output.push("// Platform: " + platform);
+   // output.push("// "  + commitId);
+
+   // // write header
+   // output.push('/*', fs.readFileSync(licensePath, 'utf8'), '*/');
+   // output.push(';(function() {');
+   // output.push("var CORDOVA_JS_BUILD_LABEL = '"  + commitId + "';");
+
+   // // write initial scripts
+   // if (!scripts['require']) {
+   //     throw new Error("didn't find a script for 'require'")
+   // }
+    
+   // writeScript(output, scripts['require'], debug)
+    b.transform(require_tr);
+
+    b.add(path.join(root, 'src', platform, 'exec.js'));
+
+    b.add(path.join(root, 'src', 'scripts', 'bootstrap.js'));
+
+    return b;
+}


Mime
View raw message