You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/04/29 04:51:35 UTC

android commit: CB-6543 Fix cordova/run failure when no custom_rules.xml available

Repository: cordova-android
Updated Branches:
  refs/heads/master 11fc6be32 -> e6adbb0e4


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-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/e6adbb0e
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/e6adbb0e
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/e6adbb0e

Branch: refs/heads/master
Commit: e6adbb0e42c19be3f8c627359079c256b33931c8
Parents: 11fc6be
Author: Ningxin Hu <ni...@intel.com>
Authored: Thu Apr 24 16:05:42 2014 +0800
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Apr 28 22:50:22 2014 -0400

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


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/e6adbb0e/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);
     }
 }