11language : android
2-
32sudo : false
3+ dist : precise
4+
5+ env :
6+ global :
7+ - ANDROID_API_LEVEL=26
8+ - ANDROID_EMULATOR_API_LEVEL=21
9+ - ANDROID_BUILD_TOOLS_VERSION=26.0.2
10+ - ANDROID_ABI=armeabi-v7a
11+ # install timeout in minutes (2 minutes by default)
12+ - ADB_INSTALL_TIMEOUT=8
413
514android :
615 components :
@@ -11,23 +20,19 @@ android:
1120 # Additional components
1221 - extra-google-google_play_services
1322 - extra-google-m2repository
23+ # Support library
24+ - extra-android-support
1425 - extra-android-m2repository
1526
1627 # The BuildTools version used by this project
17- - build-tools-25.0.2
28+ - build-tools-$ANDROID_BUILD_TOOLS_VERSION
1829
1930 # The SDK version used to compile your project
20- - android-16
21- - android-21
22- - android-22
23- - android-25
31+ - android-$ANDROID_API_LEVEL
2432
2533 # Specify at least one system image,
2634 # if you need to run emulator(s) during your tests
27- - sys-img-armeabi-v7a-android-16
28- - sys-img-armeabi-v7a-android-21
29- - sys-img-armeabi-v7a-android-22
30- - sys-img-armeabi-v7a-android-25
35+ - sys-img-armeabi-v7a-$ANDROID_EMULATOR_API_LEVEL
3136
3237jdk :
3338 - oraclejdk8
3641 - linux
3742
3843before_install :
44+ - chmod +x ./gradlew
3945 - mkdir "$ANDROID_HOME/licenses" || true
4046 - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
4147 - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
@@ -45,18 +51,13 @@ licenses:
4551 - ' android-sdk-license-.+'
4652 - ' google-gdk-license-.+'
4753
48- env :
49- global :
50- # install timeout in minutes (2 minutes by default)
51- - ADB_INSTALL_TIMEOUT=8
52-
5354script :
5455 - android list target
5556 - ./gradlew build connectedCheck -PdisablePreDex
5657
5758# Emulator Management: Create, Start and Wait
5859before_script :
59- - echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
60+ - echo no | android create avd --force -n test -t android-$ANDROID_EMULATOR_API_LEVEL --abi $ANDROID_ABI
6061 - emulator -avd test -no-skin -no-audio -no-window &
6162 - android-wait-for-emulator
6263 - adb shell input keyevent 82 &
0 commit comments