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:11:15 UTC
[30/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/4a9fe178
Tree: http://git-wip-us.apache.org/repos/asf/cordova-js/tree/4a9fe178
Diff: http://git-wip-us.apache.org/repos/asf/cordova-js/diff/4a9fe178
Branch: refs/heads/master
Commit: 4a9fe178d23a49cd801172c106ce6cdbe35fceb6
Parents: 0d10f5f
Author: Anis Kadri <an...@apache.org>
Authored: Tue Feb 4 16:07:00 2014 -0800
Committer: Anis Kadri <an...@apache.org>
Committed: Thu Mar 27 15:20:21 2014 +0100
----------------------------------------------------------------------
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/4a9fe178/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index d49a097..ffd4064 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/4a9fe178/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/4a9fe178/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"));
}
}
}