Skip to content

Commit

Permalink
Move emulator script to travis
Browse files Browse the repository at this point in the history
  • Loading branch information
manas-chaudhari committed Jun 15, 2018
1 parent ce48d35 commit 635161c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 35 deletions.
18 changes: 15 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,25 @@ android:
components:
- tools
- platform-tools
- build-tools-27.0.3
- android-27
- extra-android-m2repository
- sys-img-armeabi-v7a-android-19

jdk:
- oraclejdk8

before_script:
# Install SDK license so Android Gradle plugin can install deps.
- mkdir "$ANDROID_HOME/licenses" || true
- echo "d56f5187479451eabf01fb78af6dfcb131a6481e" > "$ANDROID_HOME/licenses/android-sdk-license"
# Install the rest of tools (e.g., avdmanager)
- sdkmanager tools
# Install emulator system image
- sdkmanager "system-images;android-19;default;armeabi-v7a"
# Start Emulator
- echo no | $ANDROID_HOME/tools/bin/avdmanager create avd --force -n test -k "system-images;android-19;default;armeabi-v7a"
- emulator -avd test -no-audio -no-window &
- android-wait-for-emulator
- adb shell input keyevent 82 &

script:
./gradlew build test connectedCheck

Expand Down
24 changes: 0 additions & 24 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,28 +26,4 @@ task clean(type: Delete) {
delete rootProject.buildDir
}

ext.isCi = "true" == System.getenv("CI")

if (isCi) {
println 'Running on CI. Adding task to start emulator.'

task startEmulator {
doLast {
"$rootDir/gradle/start-emulator.sh".execute().waitFor()
}
}

subprojects {
afterEvaluate { Project project ->
project.android.testVariants.all { variant ->
variant.connectedInstrumentTest.dependsOn startEmulator
}

project.android.dexOptions {
preDexLibraries = false
}
}
}
}

apply from: file("gradle/bintray-properties.gradle")
8 changes: 0 additions & 8 deletions gradle/start-emulator.sh

This file was deleted.

0 comments on commit 635161c

Please sign in to comment.