[CB-4463] Updated bin/check_reqs to looks for android-18 target.Also fixed an issue in unix version of script that would invoke the android command if an error occurred.

(cherry picked from commit c2c5f71018)
This commit is contained in:
Fil Maj 2013-07-30 17:14:46 -07:00 committed by Andrew Grieve
parent dc494c85f2
commit 4b501a5b63
2 changed files with 9 additions and 9 deletions

View File

@ -19,16 +19,16 @@
ROOT="$( cd "$( dirname "$0" )/.." && pwd )" ROOT="$( cd "$( dirname "$0" )/.." && pwd )"
cmd=`android list target` cmd=`android list target`
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path." echo "The command \"android\" failed. Make sure you have the latest Android SDK installed, and the \"android\" command (inside the tools/ folder) added to your path."
exit 2 exit 2
elif [[ ! $cmd =~ "android-17" ]]; then elif [[ ! $cmd =~ "android-18" ]]; then
echo "Please install Android target 17 (the Android 4.2 SDK). Make sure you have the latest Android tools installed as well. Run `android` from your command-line to install/update any missing SDKs or tools." echo "Please install Android target 18 (the Android 4.3 SDK). Make sure you have the latest Android tools installed as well. Run \"android\" from your command-line to install/update any missing SDKs or tools."
exit 2 exit 2
else else
cmd="android update project -p $ROOT -t android-17 1> /dev/null 2>&1" cmd="android update project -p $ROOT -t android-18 1> /dev/null 2>&1"
eval $cmd eval $cmd
if [[ $? != 0 ]]; then if [[ $? != 0 ]]; then
echo "Error updating the Cordova library to work with your Android environment." echo "Error updating the Cordova library to work with your Android environment."
exit 2 exit 2
fi fi
fi fi

View File

@ -63,13 +63,13 @@ function check_requirements() {
Log('The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: ' + result.output, true); Log('The command `android` failed. Make sure you have the latest Android SDK installed, and the `android` command (inside the tools/ folder) added to your path. Output: ' + result.output, true);
WScript.Quit(2); WScript.Quit(2);
} }
else if(!result.output.match(/android[-]17/)) { else if(!result.output.match(/android[-]18/)) {
Log('Please install Android target 17 (the Android 4.2 SDK). Make sure you have the latest Android tools installed as well. Run `android` from your command-line to install/update any missing SDKs or tools.', true); Log('Please install Android target 18 (the Android 4.3 SDK). Make sure you have the latest Android tools installed as well. Run `android` from your command-line to install/update any missing SDKs or tools.', true);
Log('Output : ' + result.output); Log('Output : ' + result.output);
WScript.Quit(2); WScript.Quit(2);
} }
else { else {
var cmd = '%comspec% /c android update project -p ' + ROOT + '\\framework -t android-17'; var cmd = '%comspec% /c android update project -p ' + ROOT + '\\framework -t android-18';
result = exec_out(cmd); result = exec_out(cmd);
if(result.error) { if(result.error) {
Log('Error updating the Cordova library to work with your Android environment. Command run: "' + cmd + '", output: ' + result.output, true); Log('Error updating the Cordova library to work with your Android environment. Command run: "' + cmd + '", output: ' + result.output, true);
@ -78,4 +78,4 @@ function check_requirements() {
} }
} }
check_requirements(); check_requirements();