cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [1/3] android commit: CB-7536 check_reqs: windows tweaks + sdk manager error message
Date Tue, 16 Sep 2014 17:02:40 GMT
Repository: cordova-android
Updated Branches:
  refs/heads/master d9900a725 -> 25be42d38


CB-7536 check_reqs: windows tweaks + sdk manager error message

1. Don't escape \s since those are used by windows for directory seperators
2. Don't warn about missing directories on windows when we're just
testing for their existence
3. Don't give command to install sdk from command-line, since they also
require Build-tools and Platform-tools (which are not installed by
default with IDE-less 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/090822eb
Tree: http://git-wip-us.apache.org/repos/asf/cordova-android/tree/090822eb
Diff: http://git-wip-us.apache.org/repos/asf/cordova-android/diff/090822eb

Branch: refs/heads/master
Commit: 090822eb4196e81063b7b3ffd04705fe706384ef
Parents: d9900a7
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Tue Sep 16 10:28:34 2014 -0400
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Tue Sep 16 11:13:15 2014 -0400

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/090822eb/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 358c73f..a7410e9 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -110,10 +110,13 @@ module.exports.check_java = function() {
                 }
             } else if (isWindows) {
                 // Try to auto-detect java in the default install paths.
+                var oldSilent = shelljs.config.silent;
+                shelljs.config.silent = true;
                 var firstJdkDir =
                     shelljs.ls(process.env['ProgramFiles'] + '\\java\\jdk*')[0] ||
                     shelljs.ls('C:\\Program Files\\java\\jdk*')[0] ||
                     shelljs.ls('C:\\Program Files (x86)\\java\\jdk*')[0];
+                shelljs.config.silent = oldSilent;
                 if (firstJdkDir) {
                     // shelljs always uses / in paths.
                     firstJdkDir = firstJdkDir.replace(/\//g, path.sep);
@@ -195,7 +198,7 @@ module.exports.check_android = function() {
 };
 
 module.exports.getAbsoluteAndroidCmd = function() {
-    return forgivingWhichSync('android').replace(/([ \\])/g, '\\$1');
+    return forgivingWhichSync('android').replace(/(\s)/g, '\\$1');
 };
 
 module.exports.check_android_target = function(valid_target) {
@@ -209,9 +212,12 @@ module.exports.check_android_target = function(valid_target) {
     .then(function(output) {
         if (output.split('\n').indexOf(valid_target) == -1) {
             var androidCmd = module.exports.getAbsoluteAndroidCmd();
-            throw new Error('Please install Android target: "' + valid_target + '".\n' +
+            throw new Error('Please install Android target: "' + valid_target + '".\n\n'
+
                 'Hint: Open the SDK manager by running: ' + androidCmd + '\n' +
-                'Or install directly via: ' + androidCmd + ' update sdk --no-ui --all --filter
"' + valid_target + '"');
+                'You will require:\n' +
+                '1. "SDK Platform" for ' + valid_target + '\n' +
+                '2. "Android SDK Platform-tools (latest)\n' +
+                '3. "Android SDK Build-tools" (latest)');
         }
     });
 };


Mime
View raw message