cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamesj...@apache.org
Subject android commit: CB-1944: Better error messages for Create script
Date Wed, 27 Mar 2013 19:58:38 GMT
Updated Branches:
  refs/heads/master 5ee7e81ff -> 36c33a588


CB-1944: Better error messages for Create script

- fixed to detect missing packages individually
- added a specific message for each missing package
- messages include how to correct and package download link


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

Branch: refs/heads/master
Commit: 36c33a58892f49067f4d3edf51b401b4a3c94259
Parents: 5ee7e81
Author: James Jong <wjamesjong@gmail.com>
Authored: Fri Feb 15 18:54:02 2013 -0500
Committer: James Jong <wjamesjong@gmail.com>
Committed: Wed Mar 27 15:46:45 2013 -0400

----------------------------------------------------------------------
 bin/create.bat |   36 ++++++++++++++++++++++++++++--------
 1 files changed, 28 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-android/blob/36c33a58/bin/create.bat
----------------------------------------------------------------------
diff --git a/bin/create.bat b/bin/create.bat
index 35fdc3b..cdbd611 100644
--- a/bin/create.bat
+++ b/bin/create.bat
@@ -16,17 +16,37 @@
 :: under the License.
 
 @ECHO OFF
-IF NOT DEFINED JAVA_HOME GOTO MISSING
+IF NOT DEFINED JAVA_HOME GOTO MISSING_JAVA_HOME
+
 FOR %%X in (java.exe javac.exe ant.bat android.bat) do (
-    SET FOUND=%%~$PATH:X
-    IF NOT DEFINED FOUND GOTO MISSING
+    IF [%%~$PATH:X]==[] (
+      ECHO Cannot locate %%X using the PATH environment variable.
+      ECHO Retry after adding directory containing %%X to the PATH variable.
+      ECHO Remember to open a new command window after updating the PATH variable.
+      IF "%%X"=="java.exe" GOTO GET_JAVA
+      IF "%%X"=="javac.exe" GOTO GET_JAVA
+      IF "%%X"=="ant.bat" GOTO GET_ANT
+      IF "%%X"=="android.bat" GOTO GET_ANDROID
+      GOTO ERROR
+    )
 )
 cscript "%~dp0\create.js" %*
 GOTO END
-:MISSING
-ECHO Missing one of the following:
-ECHO JDK: http://java.oracle.com
-ECHO Android SDK: http://developer.android.com
-ECHO Apache ant: http://ant.apache.org
+:MISSING_JAVA_HOME
+        ECHO The JAVA_HOME environment variable is not set.
+        ECHO Set JAVA_HOME to an existing JRE directory.
+        ECHO Remember to also add JAVA_HOME to the PATH variable.
+        ECHO After updating system variables, open a new command window and retry.
+        GOTO ERROR
+:GET_JAVA
+        ECHO Visit http://java.oracle.com if you need to install Java (JDK).
+        GOTO ERROR
+:GET_ANT
+        ECHO Visit http://ant.apache.org if you need to install Apache Ant.
+        GOTO ERROR
+:GET_ANDROID
+        ECHO Visit http://developer.android.com if you need to install the Android SDK.
+        GOTO ERROR
+:ERROR
 EXIT /B 1
 :END


Mime
View raw message