mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-14 00:00:59 +00:00
Gradle: improved build script
This commit is contained in:
1 parent
4f02f68454
commit
9b28056122
1 file changed
+12
-9
@@ -629,21 +629,22 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
|||||||
TARGET_API=21
|
TARGET_API=21
|
||||||
TEST_API=18
|
TEST_API=18
|
||||||
ANDROID_ABI=armeabi-v7a
|
ANDROID_ABI=armeabi-v7a
|
||||||
|
AVD_NAME=androidTest
|
||||||
echo "Updating Android SDK...."
|
echo "Updating Android SDK...."
|
||||||
echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
|
echo yes | android update sdk --filter platform-tools --no-ui --force --all > /dev/null
|
||||||
echo yes | android update sdk --filter build-tools-${BUILD_TOOLS} --no-ui --force > /dev/null
|
echo yes | android update sdk --filter build-tools-${BUILD_TOOLS} --no-ui --force --all > /dev/null
|
||||||
echo yes | android update sdk --filter android-${TARGET_API} --no-ui --force > /dev/null
|
echo yes | android update sdk --filter android-${TARGET_API} --no-ui --force --all > /dev/null
|
||||||
echo yes | android update sdk --filter extra-android-m2repository --no-ui --force > /dev/null
|
echo yes | android update sdk --filter extra-android-m2repository --no-ui --force --all > /dev/null
|
||||||
echo yes | android update sdk --filter extra-google-m2repository --no-ui --force > /dev/null
|
echo yes | android update sdk --filter extra-google-m2repository --no-ui --force --all > /dev/null
|
||||||
./gradlew clean build
|
./gradlew clean build
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
exit 100
|
exit 100
|
||||||
fi
|
fi
|
||||||
if [ $testing -eq 1 ]; then
|
if [ $testing -eq 1 ]; then
|
||||||
echo "Downloading and installing emulator image..."
|
echo "Downloading and installing emulator image..."
|
||||||
echo yes | android update sdk -u -a -t sys-img-${ANDROID_ABI}-android-${TEST_API} > /dev/null
|
echo yes | android update sdk --filter sys-img-${ANDROID_ABI}-android-${TEST_API} --no-ui --force --all > /dev/null
|
||||||
echo no | android create avd --force -n androidTest -t android-${TEST_API} --abi ${ANDROID_ABI}
|
echo no | android create avd --name ${AVD_NAME} --target android-${TEST_API} --abi ${ANDROID_ABI} --force
|
||||||
emulator -avd androidTest -no-skin -no-audio -no-window &
|
emulator -avd ${AVD_NAME} -no-skin -no-audio -no-window &
|
||||||
echo "Waiting for device to start..."
|
echo "Waiting for device to start..."
|
||||||
adb wait-for-device
|
adb wait-for-device
|
||||||
echo "Waiting 10 seconds to complete startup..."
|
echo "Waiting 10 seconds to complete startup..."
|
||||||
@@ -651,10 +652,12 @@ if [[ "$@" == "build" ]] || [[ "$@" == "all" ]]; then
|
|||||||
adb shell input keyevent 82 &
|
adb shell input keyevent 82 &
|
||||||
./gradlew deviceCheck connectedCheck
|
./gradlew deviceCheck connectedCheck
|
||||||
if [[ $? != 0 ]]; then
|
if [[ $? != 0 ]]; then
|
||||||
exit 101
|
|
||||||
adb emu kill
|
adb emu kill
|
||||||
|
android delete avd --name ${AVD_NAME}
|
||||||
|
exit 101
|
||||||
fi
|
fi
|
||||||
adb emu kill
|
adb emu kill
|
||||||
|
android delete avd --name ${AVD_NAME}
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo "INFO: Deactivating mobile modules"
|
echo "INFO: Deactivating mobile modules"
|
||||||
|
|||||||
Reference in new issue
Block a user