-
Notifications
You must be signed in to change notification settings - Fork 184
/
.travis.yml
105 lines (91 loc) · 3.42 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
103
104
105
language: android
jdk: oraclejdk8
sudo: required # false for Container-Based Infrastructure, required for Sudo-enabled Infrastructure
before_cache:
- rm -f ${TRAVIS_BUILD_DIR}/gradle/caches/modules-2/modules-2.lock # Avoid to repack it due locks
- rm -f ${TRAVIS_BUILD_DIR}/gradle/caches/3.3/classAnalysis/classAnalysis.lock
- rm -f ${TRAVIS_BUILD_DIR}/gradle/caches/3.3/jarSnapshots/jarSnapshots.lock
# - rm -fr $HOME/.gradle/caches/*/plugin-resolution/ # from unknown tutorial and no idea if I need it
cache:
directories:
- ${TRAVIS_BUILD_DIR}/gradle/caches/
- ${TRAVIS_BUILD_DIR}/gradle/wrapper/dists/
# - $HOME/.gradle/wrapper/ # from unknown tutorial and no idea if I need it
# - $HOME/.android/build-cache # from unknown tutorial and no idea if I need it
notifications:
email: false
env:
global:
- ANDROID_API=25
- EMULATOR_API=26
- ANDROID_BUILD_TOOLS=27.0.2
- ADB_INSTALL_TIMEOUT=5 # minutes
- secure: "xxx"
- secure: "xxx"
android:
components:
- tools
- platform-tools
- build-tools-$ANDROID_BUILD_TOOLS
- android-$ANDROID_API
# Additional components
- extra-google-google_play_services # google play services
- extra-google-m2repository
- extra-android-m2repository # for design library
- extra-android-support # Support library
- addon-google_apis-google-$ANDROID_API
- addon-google_apis-google-$EMULATOR_API
# Android emulator system image(s) to be used during tests
- sys-img-armeabi-v7a-addon-google_apis-google-$ANDROID_API
- sys-img-armeabi-v7a-addon-google_apis-google-$EMULATOR_API
licenses:
- android-sdk-preview-license-.+
- android-sdk-license-.+
- google-gdk-license-.+
before_install:
# for Constraint Layout
#- openssl aes-256-cbc -K $encrypted_c0801aa05af4_key -iv $encrypted_c0801aa05af4_iv -in example_keystore.jks.enc -out example_keystore.jks -d
# - mkdir "$ANDROID_HOME/licenses" || true
# - echo -e "\n8933bad161af4178b1185d1a37fbf41ea5269c55" > "$ANDROID_HOME/licenses/android-sdk-license"
# - echo -e "\n84831b9409646a918e30573bab4c9c91346d8abd" > "$ANDROID_HOME/licenses/android-sdk-preview-license"
- chmod +x gradlew
# - ./gradlew dependencies || true # DON'T ADD unless you are getting "Install missing components using SDK manager"
#Source: https://medium.com/@oldergod/constraint-layout-and-circleci-travis-d50342696d2
# blocklist
#branches:
# except:
# - legacy
# - experimental
# safelist
#branches:
# only:
# - master
before_script:
- echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a
- emulator -avd test -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
script:
- ./gradlew clean build connectedCheck -PdisablePreDex --stacktrace
- ./gradlew bintrayupload --info
# - ./gradlew clean
# - ./gradlew assembleDebug
# - ./gradlew assembleDebugAndroidTest
# before_deploy:
# - cp $TRAVIS_BUILD_DIR/example_keystore.jks $HOME
# - cd app/build/outputs/apk/
# - jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore $HOME/example_keystore.jks -storepass $storepass -keypass $keypass app-release-unsigned.apk ExampleKeystoreAlias
# Verification
# - jarsigner -verify app-release-unsigned.apk
# - "${ANDROID_HOME}/build-tools/24.0.2/zipalign -v 4 app-release-unsigned.apk TravisExample.apk"
# deploy:
# provider: releases
# file: TravisExample.apk
# skip_cleanup: true
#
# on:
# repo: harmittaa/travis-example-android
# tags: true
# jdk: oraclejdk8
# api_key:
# secure: "xxx"