forked from osmdroid/osmdroid
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
140 lines (130 loc) · 5.39 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
language: android
jdk: openjdk7
android:
components:
# The BuildTools version used by your project
- tools
- platform-tools
- build-tools-23.0.2 # 23.0.2 was not available on build
- build-tools-23.0.1
- build-tools-23.0.3
# The SDK version used to compile your project
- android-24
- android-23
- android-22
- android-21
- android-19
- android-18
- android-15
- android-10
- android-8
- addon-google_apis-google-10
- addon-google_apis-google-15
- addon-google_apis-google-18
- addon-google_apis-google-19
- addon-google_apis-google-21
- addon-google_apis-google-22
- addon-google_apis-google-23
- addon-google_apis-google-8
- sys-img-armeabi-v7a-google_apis-23
# Additional components
- extra-google-google_play_services
- extra-google-m2repository
- extra-android-m2repository
- addon-google_apis-google-19
- sys-img-armeabi-android-8
- sys-img-armeabi-android-10
- sys-img-armeabi-android-15
- sys-img-armeabi-android-19
- sys-img-armeabi-android-21
- sys-img-armeabi-v7a-android-10
- sys-img-armeabi-v7a-google_apis-19
- sys-img-armeabi-v7a-google_apis-21
- sys-img-armeabi-v7a-google_apis-15
- sys-img-armeabi-v7a-google_apis-23
- addon-google_apis-google-23
sudo: required
# fun fact, travis doesn't really support multiple AVDs running currently for a single build (tried it, build timed out constantly while starting up the AVDs)
# thus we're using a build matrix (which makes more sense anyhow)
env:
global:
#minutes (2 minutes by default), prevents CommandShellUnresponsiveExceptions
- ADB_INSTALL_TIMEOUT=14
matrix:
#note when changing these, updating the gradle build file for the GoogleWrapper project
# first env var is just for display purposes
- API=8g ANDROID_TARGET=11 ANDROID_ABI=armeabi
- API=8 ANDROID_TARGET=1 ANDROID_ABI=armeabi
- API=10 ANDROID_TARGET=2 ANDROID_ABI=armeabi
# - API=19 ANDROID_TARGET=5 ANDROID_ABI=google_apis/armeabi-v7a
# (above) stopped working sept 2017 unknown reason
# - API=15 ANDROID_TARGET=3 ANDROID_ABI=google_apis/armeabi-v7a
# (above) stopped working sept 2017 unknown reason
# - API=10g ANDROID_TARGET=12 ANDROID_ABI=armeabi
# (above) stopped working sept 2017 unknown reason, the emulator says google services aren't installed
# - API=15g ANDROID_TARGET=13 ANDROID_ABI=armeabi-v7a
# (above) stopped working sept 2017 unknown reason
before_install:
# create and start emulators
- export ANDROID_SDK_ROOT=/usr/local/android-sdk/
- android list targets
- echo android create avd --force -n test$ANDROID_TARGET -t $ANDROID_TARGET --abi $ANDROID_ABI --sdcard 200M
- echo no | android create avd --force -n test$ANDROID_TARGET -t $ANDROID_TARGET --abi $ANDROID_ABI --sdcard 200M
- emulator -memory 1536 -avd test$ANDROID_TARGET -no-skin -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &
# mvn sdk deploy
before_script:
# android list
# TEMPORARY comment out of the maven build since it's broken at the moment
#- mkdir temp
#- cd temp
#- git clone https://github.com/simpligility/maven-android-sdk-deployer
#- cd maven-android-sdk-deployer
#- mvn clean install -fn -B -U
#- cd ..
#- cd ..
- android-wait-for-emulator
- adb shell input keyevent 82 &
#setup for maps forge adapter
#- wget http://download.mapsforge.org/maps/world/world.map
- adb shell ls /
- adb shell ls /sdcard/
- adb shell ls /sdcard/osmdroid
- adb root
- adb shell mount -o rw,remount rootfs /
- adb shell chmod 777 /mnt/sdcard
- adb shell mkdir /sdcard/osmdroid/
- adb push world.map /sdcard/osmdroid/world.map
- adb push testzoom4.sqlite /sdcard/osmdroid/testzoom4.sqlite
- adb push testzoom4.zip /sdcard/osmdroid/testzoom4.zip
- adb push testzoom4.gemf /sdcard/osmdroid/testzoom4.gemf
#maybe one day it will be added to the repo- adb push ERDC_Whitehorse_GeoPackage.gpkg /sdcard/osmdroid/ERDC_Whitehorse_GeoPackage.gpkg
#- adb push resources/usgsbase.gemf /sdcard/osmdroid/usgsbase.gemf
#- adb push resources/usgstopo.sqlite /sdcard/osmdroid/usgstopo.sqlite
#- adb push resources/usgssat.zip /sdcard/osmdroid/usgssat.zip
#build
script:
#build using maven with integration tests
#we build 3 times due to issues with the maven-android-plugin. root cause is unknown but seems to be related to how artifacts are resolved for android projects
#in case you're wondering -fn means fail never, which loosely means, if the build fails, the exit code is always 0, which is basically all CI engines look for.
#the dist profile adds the zip and tar outputs of all javadocs and source jars
#- ./travis.sh
#- mvn install -fn -B -U -Pdist
#- mvn install -Pdist
#- mvn android:undeploy
#build using gradle
# travis_wait 30 https://docs.travis-ci.com/user/common-build-problems/#My-builds-are-timing-out
- ./gradlew -version
- echo $JAVA_HOME
- export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64
- travis_wait 60 ./gradlew clean install connectedCheck
# fun fact, maven runs android tests concurrently for all connected devices, gradle does not
# since we're using build matrix, each build target compiles the source, fires up it's specific vm, runs the tests, then exits.
# --stacktrace
after_failure:
# run this on failure
- adb pull /sdcard/osmdroid/crash.log
- cat crash.log
# dumps the log then exits
- adb logcat -d