Skip to content

Commit

Permalink
Attempt to fix robolectric build issues. (stripe#7064)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaynewstrom-stripe authored Jul 24, 2023
1 parent 016da6f commit 1f547cf
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ workflows:
inputs:
- content: ./gradlew ktlint detekt lintRelease apiCheck verifyReleaseResources
test:
envs:
- opts:
is_expand: false
NEEDS_ROBOLECTRIC: true
before_run:
- prepare_all
after_run:
Expand Down Expand Up @@ -168,6 +172,12 @@ workflows:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone@8: { }
- cache-pull@2: { }
- script-runner@0:
# Maven doesn't like java 17, so running it before.
run_if: '{{getenv "NEEDS_ROBOLECTRIC" | ne ""}}'
title: Download robolectric dependencies
inputs:
- file_path: ./scripts/download_robolectric.sh
- set-java-version@1:
inputs:
- set_java_version: 17
Expand Down
14 changes: 14 additions & 0 deletions scripts/download_robolectric.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -e # Fail on error.

# To get this list run the following commands.
# rm -rf ~/.m2/repository/org/robolectric/android-all-instrumented
# ./gradlew testDebugUnitTest
# ls ~/.m2/repository/org/robolectric/android-all-instrumented/
# The resulting list of versions should be added below.
declare -a robolectric_versions=("10-robolectric-5803371-i4" "11-robolectric-6757853-i4" "13-robolectric-9030017-i4" "4.1.2_r1-robolectric-r1-i4" "9-robolectric-4913185-2-i4")

for i in ${robolectric_versions[@]}; do
mvn dependency:get -Dartifact=org.robolectric:android-all-instrumented:${i}
done

0 comments on commit 1f547cf

Please sign in to comment.