-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
66 lines (56 loc) · 2.35 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
sudo: false
language: android
jdk:
- oraclejdk8
# Only create build on Pushes to Master or Pull Requests.
branches:
only:
- master
# Disable emails entirely
notifications:
email: false
before_cache:
# Do not cache a few Gradle files/directories (see https://docs.travis-ci.com/user/languages/java/#Caching)
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
cache:
directories:
# Android SDK
- $HOME/android-sdk-dl
- $HOME/android-sdk
# Gradle dependencies
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
# Android build cache (see http://tools.android.com/tech-docs/build-cache)
- $HOME/.android/build-cache
# INSTRUMENTED TESTS ARE DISABLED - until Google or Travis fix the mess with emulation, only local tests are enabled
# - sys-img-armeabi-v7a-android-24
install:
# Download and unzip the Android SDK tools (if not already there thanks to the cache mechanism)
# Latest version available here: https://developer.android.com/studio/index.html#downloads
- if test ! -e $HOME/android-sdk-dl/sdk-tools.zip ; then curl https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip > $HOME/android-sdk-dl/sdk-tools.zip ; fi
- unzip -qq -n $HOME/android-sdk-dl/sdk-tools.zip -d $HOME/android-sdk
# Travis still uses 'android' command behind the 'components' section update.
# That command is obsolete and cannot update Android SDK Tools after 25.2.5.
# Let's solve it here with the new command 'sdkmanager'
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'tools' > /dev/null
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'platform-tools' > /dev/null
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'build-tools;26.0.1' > /dev/null
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'platforms;android-26' > /dev/null
- echo y | $HOME/android-sdk/tools/bin/sdkmanager 'extras;google;m2repository' > /dev/null
script:
# force init of adb way before any Gradle task that uses ADB; prevents a timeout error that skips emulators of android-24
- adb devices
# Gradle Clean
- ./gradlew clean
# build app and assemble APK, in debug mode
- ./gradlew assembleDebug
# run all the local unit tests of app module
- ./gradlew test
# run lint checker
- ./gradlew lint
env:
global:
- ANDROID_HOME=$HOME/android-sdk
matrix:
- ANDROID_TARGET=android-24 ANDROID_ABI=armeabi-v7a