mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 20:33:07 +08:00
Add check for build targets in create script
I installed the android sdk via homebrew, which does not install any build targets by default. That resulted in the create throwing the following somewhat cryptic error. An unexpected error occurred: "$ANDROID_BIN" create project --target $TARGET --path "$PROJECT_PATH" --package $PACKAGE --activity $ACTIVITY >&/dev/null exited with 1 This just adds a check that the variables that are set to the values of the build targets are properly set, and exit if they are not.
This commit is contained in:
parent
dd86d7a5ed
commit
2683803ef3
@ -98,6 +98,13 @@ MANIFEST_PATH="$PROJECT_PATH"/AndroidManifest.xml
|
|||||||
TARGET=$("$ANDROID_BIN" list targets | grep id: | tail -1 | cut -f 2 -d ' ' )
|
TARGET=$("$ANDROID_BIN" list targets | grep id: | tail -1 | cut -f 2 -d ' ' )
|
||||||
API_LEVEL=$("$ANDROID_BIN" list target | grep "API level:" | tail -n 1 | cut -f 2 -d ':' | tr -d ' ')
|
API_LEVEL=$("$ANDROID_BIN" list target | grep "API level:" | tail -n 1 | cut -f 2 -d ':' | tr -d ' ')
|
||||||
|
|
||||||
|
# check that build targets exist
|
||||||
|
if [ -z "$TARGET" ] || [ -z "$API_LEVEL" ]
|
||||||
|
then
|
||||||
|
echo "No Android Targets are installed. Please install at least one via the android SDK"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# if this a distribution release no need to build a jar
|
# if this a distribution release no need to build a jar
|
||||||
if [ ! -e "$BUILD_PATH"/cordova-$VERSION.jar ] && [ -d "$BUILD_PATH"/framework ]
|
if [ ! -e "$BUILD_PATH"/cordova-$VERSION.jar ] && [ -d "$BUILD_PATH"/framework ]
|
||||||
then
|
then
|
||||||
|
Loading…
Reference in New Issue
Block a user