You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by an...@apache.org on 2014/04/24 23:10:52 UTC

[07/45] js commit: adding android and amazon-fireos

adding android and amazon-fireos


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

Branch: refs/heads/master
Commit: 74c53effabe640c8cf8aa035dd2f81de68ae6bc9
Parents: c08165e
Author: Anis Kadri <an...@apache.org>
Authored: Tue Feb 4 16:07:00 2014 -0800
Committer: Anis Kadri <an...@apache.org>
Committed: Tue Feb 4 16:07:00 2014 -0800

----------------------------------------------------------------------
 Gruntfile.js                   |  2 ++
 tasks/lib/bundle-browserify.js |  2 ++
 tasks/lib/require-tr.js        | 11 +++++++++--
 3 files changed, 13 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/74c53eff/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index ed153bd..3da4d43 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -34,6 +34,8 @@ module.exports = function(grunt) {
             "browser": {}
         },
         "compile-browserify": {
+            "amazon-fireos": {},
+            "android": {},
             "ios": {}
         },
         clean: ['pkg'],

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/74c53eff/tasks/lib/bundle-browserify.js
----------------------------------------------------------------------
diff --git a/tasks/lib/bundle-browserify.js b/tasks/lib/bundle-browserify.js
index 3d91e42..e678bcf 100644
--- a/tasks/lib/bundle-browserify.js
+++ b/tasks/lib/bundle-browserify.js
@@ -55,6 +55,8 @@ module.exports = function bundle(platform, debug, commitId) {
     b.transform(require_tr);
 
     b.add(path.join(root, 'src', platform, 'exec.js'));
+    
+    b.add(path.join(root, 'src', platform, 'platform.js'));
 
     b.add(path.join(root, 'src', 'scripts', 'bootstrap.js'));
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/74c53eff/tasks/lib/require-tr.js
----------------------------------------------------------------------
diff --git a/tasks/lib/require-tr.js b/tasks/lib/require-tr.js
index 4459fda..ba8bd53 100644
--- a/tasks/lib/require-tr.js
+++ b/tasks/lib/require-tr.js
@@ -43,11 +43,18 @@ function _updateRequires(code) {
         //fs.appendFileSync('/tmp/foo', JSON.stringify(node.args[0]) + "###\n");
         if(node.args.length === 1 && 
            node.args[0].value !== undefined &&
-           node.args[0].value.indexOf("cordova") === 0){
+           node.args[0].value.indexOf("cordova") === 0) {
+          // cordova.js
           if(node.args[0].value === "cordova") {
             node.args[0].value = path.join(root, "src", "cordova");
+          // android and amazon-fireos
+          } else if(node.args[0].value.match(/cordova\/(android|amazon-fireos)\/(.+)/)) {
+            node.args[0].value = node.args[0].value.replace(/cordova\/(android|amazon-fireos)\/(.+)/,
+                                 path.join(root, "src", "$1", "android", "$2"));
+          // everything else
           } else if(node.args[0].value.match(/cordova\/(.+)/)) {
-            node.args[0].value = node.args[0].value.replace(/cordova\/(.+)/, path.join(root, "src", "common", "$1"));
+            node.args[0].value = node.args[0].value.replace(/cordova\/(.+)/,
+                                 path.join(root, "src", "common", "$1"));
           }
         }
       }