-
Notifications
You must be signed in to change notification settings - Fork 6
/
.travis.yml
59 lines (46 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
dist: focal
language: java
jdk: openjdk11
env:
global:
# Android command line tools, check for updates here https://developer.android.com/studio/#command-tools
- COMMAND_LINE_TOOLS_VERSION=9477386
- ANDROID_HOME=$HOME/android-sdk
- TARGET_SDK_VERSION=`grep -H targetSdk buildSrc/src/main/kotlin/info/metadude/kotlin/library/roadsigns/Dependencies.kt | grep -Po "\d+"`
- BUILD_TOOLS_VERSION=`grep -H buildToolsVersion buildSrc/src/main/kotlin/info/metadude/kotlin/library/roadsigns/Dependencies.kt | grep -Po "\d+.\d+.\d+"`
branches:
except:
- /^v\..*$/ # Exclude version tags
notifications:
email: true
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
- $HOME/android-cmdline-tools
- $HOME/android-sdk
- $HOME/.android/build-cache
# Gradle
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
install:
- mkdir -p $HOME/android-cmdline-tools
# Download and unzip the Android command line tools (if not already there thanks to the cache mechanism)
- if test ! -e $HOME/android-cmdline-tools/cmdline-tools.zip ; then curl "https://dl.google.com/android/repository/commandlinetools-linux-${COMMAND_LINE_TOOLS_VERSION}_latest.zip" > $HOME/android-cmdline-tools/cmdline-tools.zip ; fi
- unzip -qq -n $HOME/android-cmdline-tools/cmdline-tools.zip -d $HOME/android-cmdline-tools
- echo y | $HOME/android-cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk "platform-tools"
- echo y | $HOME/android-cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk "build-tools;${BUILD_TOOLS_VERSION}"
- echo y | $HOME/android-cmdline-tools/cmdline-tools/bin/sdkmanager --sdk_root=$HOME/android-sdk "platforms;android-${TARGET_SDK_VERSION}"
before_script:
# To see if the correct values have been extracted.
- echo TARGET_SDK_VERSION=$TARGET_SDK_VERSION
- echo BUILD_TOOLS_VERSION=$BUILD_TOOLS_VERSION
# Ensure Gradle wrapper is executable
- chmod +x gradlew
# Reduce memory usage / avoid OutOfMemoryError with Gradle 4.10.3
- echo "org.gradle.jvmargs=-Xmx2048m -Xms512m -XX:MaxPermSize=768m" >> gradle.properties
script:
- ./gradlew clean testDebug assembleDebug -PdisablePreDex