cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject [11/11] git commit: CB-6543 Fix cordova/run failure when no custom_rules.xml available
Date Tue, 06 May 2014 20:59:21 GMT
CB-6543 Fix cordova/run failure when no custom_rules.xml available

Github: Close #99


Project: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/commit/18c6752c
Tree: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/tree/18c6752c
Diff: http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/diff/18c6752c

Branch: refs/heads/master
Commit: 18c6752c6fff86b8db4be638338c9e95bc98e267
Parents: b9d9a75
Author: Ningxin Hu <ningxin.hu@intel.com>
Authored: Thu Apr 24 16:05:42 2014 +0800
Committer: Archana Naik <naika@lab126.com>
Committed: Tue May 6 13:58:47 2014 -0700

----------------------------------------------------------------------
 bin/templates/cordova/lib/build.js | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-amazon-fireos/blob/18c6752c/bin/templates/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/cordova/lib/build.js b/bin/templates/cordova/lib/build.js
index 7e0df2f..6336ecf 100644
--- a/bin/templates/cordova/lib/build.js
+++ b/bin/templates/cordova/lib/build.js
@@ -74,7 +74,12 @@ module.exports.run = function(build_type) {
  * the script will error out. (should we error or just return undefined?)
  */
 module.exports.get_apk = function() {
-    var binDir = path.join(ROOT, 'ant-build');
+    var binDir = '';
+    if(!hasCustomRules()) {
+        binDir = path.join(ROOT, 'bin');
+    } else {
+        binDir = path.join(ROOT, 'ant-build');
+    }
     if (fs.existsSync(binDir)) {
         var candidates = fs.readdirSync(binDir).filter(function(p) {
             // Need to choose between release and debug .apk.
@@ -87,13 +92,13 @@ module.exports.get_apk = function() {
                    a.t < b.t ? 1 : 0;
         });
         if (candidates.length === 0) {
-            console.error('ERROR : No .apk found in \'ant-build\' directory');
+            console.error('ERROR : No .apk found in ' + binDir + ' directory');
             process.exit(2);
         }
         console.log('Using apk: ' + candidates[0].p);
         return candidates[0].p;
     } else {
-        console.error('ERROR : unable to find project ant-build directory, could not locate
.apk');
+        console.error('ERROR : unable to find project ' + binDir + ' directory, could not
locate .apk');
         process.exit(2);
     }
 }


Mime
View raw message