Skip to content

Commit 635161c

Browse files
Move emulator script to travis
1 parent ce48d35 commit 635161c

File tree

3 files changed

+15
-35
lines changed

3 files changed

+15
-35
lines changed

.travis.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,25 @@ android:
44
components:
55
- tools
66
- platform-tools
7-
- build-tools-27.0.3
87
- android-27
9-
- extra-android-m2repository
10-
- sys-img-armeabi-v7a-android-19
8+
119
jdk:
1210
- oraclejdk8
1311

12+
before_script:
13+
# Install SDK license so Android Gradle plugin can install deps.
14+
- mkdir "$ANDROID_HOME/licenses" || true
15+
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"
16+
# Install the rest of tools (e.g., avdmanager)
17+
- sdkmanager tools
18+
# Install emulator system image
19+
- sdkmanager "system-images;android-19;default;armeabi-v7a"
20+
# Start Emulator
21+
- echo no | $ANDROID_HOME/tools/bin/avdmanager create avd --force -n test -k "system-images;android-19;default;armeabi-v7a"
22+
- emulator -avd test -no-audio -no-window &
23+
- android-wait-for-emulator
24+
- adb shell input keyevent 82 &
25+
1426
script:
1527
./gradlew build test connectedCheck
1628

build.gradle

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,4 @@ task clean(type: Delete) {
2626
delete rootProject.buildDir
2727
}
2828

29-
ext.isCi = "true" == System.getenv("CI")
30-
31-
if (isCi) {
32-
println 'Running on CI. Adding task to start emulator.'
33-
34-
task startEmulator {
35-
doLast {
36-
"$rootDir/gradle/start-emulator.sh".execute().waitFor()
37-
}
38-
}
39-
40-
subprojects {
41-
afterEvaluate { Project project ->
42-
project.android.testVariants.all { variant ->
43-
variant.connectedInstrumentTest.dependsOn startEmulator
44-
}
45-
46-
project.android.dexOptions {
47-
preDexLibraries = false
48-
}
49-
}
50-
}
51-
}
52-
5329
apply from: file("gradle/bintray-properties.gradle")

gradle/start-emulator.sh

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)