-
Notifications
You must be signed in to change notification settings - Fork 296
/
.travis.yml
75 lines (61 loc) · 2.66 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
language: android
jdk:
- oraclejdk8
os: linux
dist: trusty
env:
global:
- ANDROID_API_LEVEL=29
- ANDROID_BUILD_TOOLS_VERSION=29.0.2
- ADB_INSTALL_TIMEOUT=20 # wait up to 20 minutes for adb to connect to emulator (2 minutes by default)
- ANDROID_ABI=armeabi-v7a
- ANDROID_EMULATOR_IMAGE=sys-img-armeabi-v7a-android-19
- EMULATOR_API_LEVEL=19
android:
components:
# Base components
- tools # to get the new `repository-11.xml`
- tools # https://github.com/travis-ci/travis-ci/issues/6040#issuecomment-219367943)
- platform-tools
- build-tools-$ANDROID_BUILD_TOOLS_VERSION
# used sdk versions
- android-$ANDROID_API_LEVEL # get the android sdk version to build the project
- android-$EMULATOR_API_LEVEL # get the android sdk version for the emulator
# Get the latest version of additional components
- extra-android-support
- extra-google-m2repository
- extra-android-m2repository
- extra-google-google_play_services
# Specify the needed emulator
- $ANDROID_EMULATOR_IMAGE
install:
#- sdkmanager --list || true # List all available targets, device definitions and AVDs.
# Update sdk tools to latest version and install/update components
- echo yes | sdkmanager "tools"
- echo yes | sdkmanager "platform-tools"
- echo yes | sdkmanager "build-tools;"$ANDROID_BUILD_TOOLS_VERSION
- echo yes | sdkmanager "platforms;android-"$ANDROID_API_LEVEL # Latest platform required by SDK tools
#- echo yes | sdkmanager "extras;android;m2repository"
#- echo yes | sdkmanager "extras;google;m2repository"
#- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
#- echo yes | sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2"
- echo yes | sdkmanager --update
#- echo yes | sdkmanager --licenses
before_script:
# Create and start the emulator
- sdkmanager "system-images;android-"$EMULATOR_API_LEVEL";google_apis;armeabi-v7a"
- echo no | avdmanager -v create avd -f -n test -k "system-images;android-"$EMULATOR_API_LEVEL";google_apis;armeabi-v7a"
- $ANDROID_HOME/emulator/emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
# Turn off animations
- adb shell settings put global window_animation_scale 0 &
- adb shell settings put global transition_animation_scale 0 &
- adb shell settings put global animator_duration_scale 0 &
# Wake up
- adb shell input keyevent 82 &
- adb shell input keyevent 1 &
script:
- ./gradlew test # Local unit test
- ./gradlew connectedAndroidTest # Instrumented unit test
- ./gradlew lint #maybe at some point
#- ./gradlew clean test build