You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bo...@apache.org on 2016/10/03 21:41:22 UTC

[1/3] android commit: CB-11640: Fixing check_reqs.js so it actually works

Repository: cordova-android
Updated Branches:
  refs/heads/master 30325e4f3 -> 9544783b5


CB-11640: Fixing check_reqs.js so it actually works

This closes #338


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

Branch: refs/heads/master
Commit: 9544783b5eb9317addb00ba0c75de7a87e665364
Parents: eaf9b31
Author: Joe Bowser <bo...@apache.org>
Authored: Tue Sep 27 14:38:07 2016 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Mon Oct 3 14:41:14 2016 -0700

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/9544783b/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 8f1f646..ac6fa4c 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -152,7 +152,6 @@ module.exports.check_java = function() {
             // javac writes version info to stderr instead of stdout
             return tryCommand('javac -version', msg, true)
                 .then(function (output) {
-                    console.log(output);
                     //Let's check for at least Java 8, and keep it future proof so we can support Java 10
                     var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
                     return match && match[1];
@@ -227,6 +226,7 @@ module.exports.check_android = function() {
             throw new CordovaError('\'ANDROID_HOME\' environment variable is set to non-existent path: ' + process.env['ANDROID_HOME'] +
                 '\nTry update it manually to point to valid SDK directory.');
         }
+        return hasAndroidHome;
     });
 };
 
@@ -269,13 +269,23 @@ module.exports.check_android_target = function(originalError) {
 
 // Returns a promise.
 module.exports.run = function() {
-    return Q.all([this.check_java(), this.check_android()])
-    .then(function() {
-        console.log('ANDROID_HOME=' + process.env['ANDROID_HOME']);
-        console.log('JAVA_HOME=' + process.env['JAVA_HOME']);
-    });
+     return Q.all([this.check_java(), this.check_android()])
+     .then(function(values) {
+         console.log('ANDROID_HOME=' + process.env['ANDROID_HOME']);
+         console.log('JAVA_HOME=' + process.env['JAVA_HOME']);
+
+         if (!values[0]) {
+            throw new CordovaError('Requirements check failed for JDK 1.8 or greater');
+         }
+
+
+         if (!values[1]) {
+            throw new CordovaError('Requirements check failed for Android SDK');
+         }
+     });
 };
 
+
 /**
  * Object thar represents one of requirements for current platform.
  * @param {String} id         The unique identifier for this requirements.


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


[3/3] android commit: CB-11640: Changing requirements check to ask for Java 8

Posted by bo...@apache.org.
CB-11640: Changing requirements check to ask for Java 8


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

Branch: refs/heads/master
Commit: 47abde2f8d98df6a8c4ae547398c74ca8bd56e0a
Parents: 30325e4
Author: Joe Bowser <bo...@apache.org>
Authored: Mon Sep 19 13:35:16 2016 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Mon Oct 3 14:41:14 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/47abde2f/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index f27f325..7790b22 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -152,7 +152,9 @@ module.exports.check_java = function() {
             // javac writes version info to stderr instead of stdout
             return tryCommand('javac -version', msg, true)
                 .then(function (output) {
-                    var match = /javac ((?:\d+\.)+(?:\d+))/i.exec(output);
+                    console.log(output);
+                    //Let's check for at least Java 8, and keep it future proof so we can support Java 10
+                    var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.))(?:\d+)/i.exec(output);
                     return match && match[1];
                 });
         });


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


[2/3] android commit: Tweaking the regex

Posted by bo...@apache.org.
Tweaking the regex


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

Branch: refs/heads/master
Commit: eaf9b319ca208a4a2d7620bd93611f5361a526d6
Parents: 47abde2
Author: Joe Bowser <bo...@apache.org>
Authored: Wed Sep 21 14:16:33 2016 -0700
Committer: Joe Bowser <bo...@apache.org>
Committed: Mon Oct 3 14:41:14 2016 -0700

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/eaf9b319/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 7790b22..8f1f646 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -154,7 +154,7 @@ module.exports.check_java = function() {
                 .then(function (output) {
                     console.log(output);
                     //Let's check for at least Java 8, and keep it future proof so we can support Java 10
-                    var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.))(?:\d+)/i.exec(output);
+                    var match = /javac ((?:1\.)(?:[8-9]\.)(?:\d+))|((?:1\.)(?:[1-9]\d+\.)(?:\d+))/i.exec(output);
                     return match && match[1];
                 });
         });


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