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/10/06 16:34:28 UTC

[1/3] android commit: CB-7714 Teach check_reqs about brew's install location for android SDK

Repository: cordova-android
Updated Branches:
  refs/heads/4.0.x 862c223e1 -> 9577735ff
  refs/heads/master 30681eb77 -> 2dcd50c11


CB-7714 Teach check_reqs about brew's install location for android 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/2dcd50c1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/2dcd50c1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/2dcd50c1

Branch: refs/heads/4.0.x
Commit: 2dcd50c11b0da370587994bad8496ec1757a26cf
Parents: 30681eb
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Oct 6 10:33:31 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Oct 6 10:33:31 2014 -0400

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2dcd50c1/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index e527571..0b87bab 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -31,7 +31,7 @@ var isWindows = process.platform == 'win32';
 
 function forgivingWhichSync(cmd) {
     try {
-        return which.sync(cmd);
+        return fs.realpathSync(which.sync(cmd));
     } catch (e) {
         return '';
     }
@@ -102,7 +102,7 @@ module.exports.check_java = function() {
                 } else {
                     // See if we can derive it from javac's location.
                     // fs.realpathSync is require on Ubuntu, which symplinks from /usr/bin -> JDK
-                    var maybeJavaHome = path.dirname(path.dirname(fs.realpathSync(javacPath)));
+                    var maybeJavaHome = path.dirname(path.dirname(javacPath));
                     if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) {
                         process.env['JAVA_HOME'] = maybeJavaHome;
                     } else {
@@ -179,9 +179,15 @@ module.exports.check_android = function() {
         }
         if (androidCmdPath && !hasAndroidHome) {
             var parentDir = path.dirname(androidCmdPath);
+            var grandParentDir = path.dirname(parentDir);
             if (path.basename(parentDir) == 'tools') {
                 process.env['ANDROID_HOME'] = path.dirname(parentDir);
                 hasAndroidHome = true;
+            } else if (fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) {
+                process.env['ANDROID_HOME'] = grandParentDir;
+                hasAndroidHome = true;
+            } else {
+                throw new Error('ANDROID_HOME is not set and no "tools" directory found at ' + parentDir);
             }
         }
         if (hasAndroidHome && !adbInPath) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[3/3] android commit: Merge branch 'master' into 4.0.x (check_reqs for brew)

Posted by ag...@apache.org.
Merge branch 'master' into 4.0.x (check_reqs for brew)


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

Branch: refs/heads/4.0.x
Commit: 9577735ff7fc504651dbcad40ecc036bd856ab35
Parents: 862c223 2dcd50c
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Oct 6 10:34:19 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Oct 6 10:34:19 2014 -0400

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[2/3] android commit: CB-7714 Teach check_reqs about brew's install location for android SDK

Posted by ag...@apache.org.
CB-7714 Teach check_reqs about brew's install location for android 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/2dcd50c1
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/2dcd50c1
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/2dcd50c1

Branch: refs/heads/master
Commit: 2dcd50c11b0da370587994bad8496ec1757a26cf
Parents: 30681eb
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Oct 6 10:33:31 2014 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Oct 6 10:33:31 2014 -0400

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/2dcd50c1/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index e527571..0b87bab 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -31,7 +31,7 @@ var isWindows = process.platform == 'win32';
 
 function forgivingWhichSync(cmd) {
     try {
-        return which.sync(cmd);
+        return fs.realpathSync(which.sync(cmd));
     } catch (e) {
         return '';
     }
@@ -102,7 +102,7 @@ module.exports.check_java = function() {
                 } else {
                     // See if we can derive it from javac's location.
                     // fs.realpathSync is require on Ubuntu, which symplinks from /usr/bin -> JDK
-                    var maybeJavaHome = path.dirname(path.dirname(fs.realpathSync(javacPath)));
+                    var maybeJavaHome = path.dirname(path.dirname(javacPath));
                     if (fs.existsSync(path.join(maybeJavaHome, 'lib', 'tools.jar'))) {
                         process.env['JAVA_HOME'] = maybeJavaHome;
                     } else {
@@ -179,9 +179,15 @@ module.exports.check_android = function() {
         }
         if (androidCmdPath && !hasAndroidHome) {
             var parentDir = path.dirname(androidCmdPath);
+            var grandParentDir = path.dirname(parentDir);
             if (path.basename(parentDir) == 'tools') {
                 process.env['ANDROID_HOME'] = path.dirname(parentDir);
                 hasAndroidHome = true;
+            } else if (fs.existsSync(path.join(grandParentDir, 'tools', 'android'))) {
+                process.env['ANDROID_HOME'] = grandParentDir;
+                hasAndroidHome = true;
+            } else {
+                throw new Error('ANDROID_HOME is not set and no "tools" directory found at ' + parentDir);
             }
         }
         if (hasAndroidHome && !adbInPath) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org