Skip to content

Commit 5ad4f1b

Browse files
authored
Fix Travis build by downloading Robolectric dependency (#508)
1 parent 67eb95b commit 5ad4f1b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.travis.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ env:
1616
- PATH=${ANDROID_HOME}:${ANDROID_HOME}/emulator:${TOOLS}:${TOOLS}/bin:${ANDROID_HOME}/platform-tools:${PATH}
1717
# If you want to run snapshot tests change value to 'true'. Build time will be increased by 6 minutes.
1818
- RUN_SNAPSHOT_TESTS=false
19+
- ROBOLECTRIC_SDK8_URL=https://repo1.maven.org/maven2/org/robolectric/android-all/8.0.0_r4-robolectric-r1/android-all-8.0.0_r4-robolectric-r1
20+
- ROBOLECTRIC_SDK8_DIR=$HOME/.m2/repository/org/robolectric/android-all/8.0.0_r4-robolectric-r1
21+
- ROBOLECTRIC_SDK8_FILE=${ROBOLECTRIC_SDK8_DIR}/android-all-8.0.0_r4-robolectric-r1
1922

2023
android:
2124
components:
@@ -31,12 +34,6 @@ licenses:
3134
- 'android-sdk-license-.+'
3235
- 'google-gdk-license-.+'
3336

34-
cache:
35-
directories:
36-
# cache is used for the Robolectric dependencies that are frequently failing to download
37-
- .autoconf
38-
- $HOME/.m2
39-
4037
before_install:
4138
- curl -s "https://get.sdkman.io" | bash
4239
- source "$HOME/.sdkman/bin/sdkman-init.sh"
@@ -64,6 +61,13 @@ before_script:
6461
- if [[ $RUN_SNAPSHOT_TESTS == true ]]; then emulator -verbose -avd test -no-accel -no-snapshot -no-window -no-audio -camera-back none -camera-front none -selinux permissive -qemu -m 2048 & fi;
6562

6663
script:
64+
# make sure Robolectric dependency is presented
65+
- mkdir -p ${ROBOLECTRIC_SDK8_DIR}
66+
- curl ${ROBOLECTRIC_SDK8_URL}.jar --output ${ROBOLECTRIC_SDK8_FILE}.jar
67+
- curl ${ROBOLECTRIC_SDK8_URL}.jar.sha1 --output ${ROBOLECTRIC_SDK8_FILE}.jar.sha1
68+
- curl ${ROBOLECTRIC_SDK8_URL}.pom --output ${ROBOLECTRIC_SDK8_FILE}.pom
69+
- curl ${ROBOLECTRIC_SDK8_URL}.pom.sha1 --output ${ROBOLECTRIC_SDK8_FILE}.pom.sha1
70+
- ls -la ${ROBOLECTRIC_SDK8_DIR}
6771
- ./gradlew assembleRelease testReleaseUnitTest
6872

6973
# wait emulator to come alive and start snapshot tests

0 commit comments

Comments
 (0)