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/09/11 22:01:24 UTC

[1/2] android commit: CB-7511 Auto-detect android sdk when using stand-alone sdk installer

Repository: cordova-android
Updated Branches:
  refs/heads/4.0.x d99386ef1 -> 3cd567dc9


CB-7511 Auto-detect android sdk when using stand-alone sdk installer


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/2f7ffa36
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/2f7ffa36
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/2f7ffa36

Branch: refs/heads/4.0.x
Commit: 2f7ffa3636b6898d3f419c8b8a2aeb7b39860248
Parents: 9ae3d2c
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Sep 11 15:36:35 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Sep 11 15:37:22 2014 -0400

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2f7ffa36/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 00137ff..edfa273 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -143,17 +143,29 @@ module.exports.check_android = function() {
         var adbInPath = !!forgivingWhichSync('adb');
         var hasAndroidHome = !!process.env['ANDROID_HOME'] && fs.existsSync(process.env['ANDROID_HOME']);
         function maybeSetAndroidHome(value) {
-            if (fs.existsSync(value)) {
+            if (!hasAndroidHome && fs.existsSync(value)) {
                 hasAndroidHome = true;
                 process.env['ANDROID_HOME'] = value;
             }
         }
         if (!hasAndroidHome && !androidCmdPath) {
             if (isWindows) {
+                // Android Studio installer.
                 maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'android-studio', 'sdk'));
                 maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'android-studio', 'sdk'));
+                // Stand-alone installer.
+                maybeSetAndroidHome(path.join(process.env['LOCALAPPDATA'], 'Android', 'android-sdk'));
+                maybeSetAndroidHome(path.join(process.env['ProgramFiles'], 'Android', 'android-sdk'));
             } else if (process.platform == 'darwin') {
                 maybeSetAndroidHome('/Applications/Android Studio.app/sdk');
+                // Stand-alone zip file that user might think to put under /Applications
+                maybeSetAndroidHome('/Applications/android-sdk-macosx');
+                maybeSetAndroidHome('/Applications/android-sdk');
+            }
+            if (process.env['HOME']) {
+                // or their HOME directory.
+                maybeSetAndroidHome(path.join(process.env['HOME'], 'android-sdk-macosx'));
+                maybeSetAndroidHome(path.join(process.env['HOME'], 'android-sdk'));
             }
         }
         if (hasAndroidHome && !androidCmdPath) {


[2/2] android commit: Merge branch 'master' into 4.0.x (better auto-detect sdk)

Posted by ag...@apache.org.
Merge branch 'master' into 4.0.x (better auto-detect sdk)


Project: http://git-wip-us.apache.org/repos/asf/cordova-android/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-android/commit/3cd567dc
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/3cd567dc
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/3cd567dc

Branch: refs/heads/4.0.x
Commit: 3cd567dc95d55aaf2f54b5b8be99206ef821b47e
Parents: d99386e 2f7ffa3
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Sep 11 16:01:01 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Sep 11 16:01:01 2014 -0400

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)
----------------------------------------------------------------------