-
Notifications
You must be signed in to change notification settings - Fork 64
/
.travis.yml
102 lines (85 loc) · 4.37 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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=7583922
- ANDROID_HOME=$HOME/android-sdk
- TARGET_SDK_VERSION=31
- BUILD_TOOLS_VERSION=30.0.2
branches:
except:
- /^v\..*$/ # Exclude version tags
notifications:
slack:
secure: HejMl0EUociwGu+5djx95snbS+m/Yw8DseQKCSqeyWvMQLrAy8bi9oa89mZvXnvjqSVY3kKRZgJncEkQdIe9c7xwgNA9QYLkc7UVbXqga291HMoNnWaIMewD2ervbzM4aBQAHnkDr+GsXgb7+1YdOktIn8dA7jdIuB90ar4So9U=
before_cache:
# Only cache the latest version used by the Gradle wrapper
# List content in wrapper/dist sorted by modification time and remove entries starting by the second entry
- ls -d $HOME/.gradle/wrapper/dists/* -1t | tail -n +2 | xargs rm -rf
# Do not cache a few Gradle files/directories (see https://docs.travis-ci.com/user/languages/java/#caching)
- rm -rf $HOME/.gradle/caches/*/plugin-resolution/
- rm -f $HOME/.gradle/caches/*/executionHistory/executionHistory.bin
- rm -f $HOME/.gradle/caches/*/executionHistory/executionHistory.lock
- rm -f $HOME/.gradle/caches/*/fileContent/fileContent.lock
- rm -f $HOME/.gradle/caches/*/fileContent/java-modules.bin
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.bin
- rm -f $HOME/.gradle/caches/*/fileHashes/fileHashes.lock
- rm -f $HOME/.gradle/caches/*/fileHashes/resourceHashesCache.bin
- rm -f $HOME/.gradle/caches/*/generated-gradle-jars/generated-gradle-jars.lock
- rm -f $HOME/.gradle/caches/*/javaCompile/jarAnalysis.bin
- rm -f $HOME/.gradle/caches/*/javaCompile/javaCompile.lock
- rm -f $HOME/.gradle/caches/*/kotlin-dsl/kotlin-dsl.lock
- rm -f $HOME/.gradle/caches/jars-9/*/buildSrc.jar
- rm -f $HOME/.gradle/caches/jars-9/*/buildSrc.jar.lock.lock
- rm -f $HOME/.gradle/caches/jars-9/*/buildSrc.jar.receipt
- rm -f $HOME/.gradle/caches/jars-9/jars-*.lock
- rm -f $HOME/.gradle/caches/journal-1/file-access.bin
- rm -f $HOME/.gradle/caches/journal-1/journal-1.lock
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
- rm -f $HOME/.gradle/caches/transforms-*/*/results.bin
- rm -f $HOME/.gradle/caches/transforms-*/*/transformed/android.jar
- rm -f $HOME/.gradle/caches/transforms-*/*/transformed/output.bin
- rm -f $HOME/.gradle/caches/transforms-*/transforms-*.lock
- rm -f $HOME/.gradle/caches/user-id.txt.lock
cache:
directories:
# Android SDK
- $HOME/android-cmdline-tools
- $HOME/android-sdk
# Gradle dependencies
- $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
# Create directory for user Gradle settings
- mkdir -p $HOME/.gradle
# Reduce memory usage / avoid OutOfMemoryError with Gradle 4.10.3
- echo "org.gradle.jvmargs=-Xmx2048m -Xms512m -XX:MaxPermSize=768m" >> gradle.properties
# Enable Gradle's build cache. To be disabled for an Android RELEASE build.
- echo "org.gradle.caching=true" >> $HOME/.gradle/gradle.properties
script:
- ./gradlew :apptentive:test -i
after_script:
- >
if [ "$TRAVIS_BRANCH" = "develop" ]; then
./gradlew :apptentive:uploadArchives;
if [ -d "apptentive-internal-app" ]; then ./gradlew :apptentive-internal-app:assembleQaDebug; fi
fi
addons:
# Fix OpenJDK builds
# https://github.com/travis-ci/travis-ci/issues/5227
hostname: short-hostname