-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Running Robolectric SNAPSHOT
utzcoz edited this page Jan 8, 2022
·
14 revisions
- Clone the robolectric repository:
git clone --recurse-submodules https://github.com/robolectric/robolectric
. - Check out the branch/commit that you want to run.
- Run
sudo apt install cmake ninja
if you use Ubuntu orbrew install cmake ninja
if you use macOS to install build-tools used by Robolectric nativeruntime. - Run
./gradlew publishMavenJavaPublicationToMavenLocal
in the Robolectric root directory. It is also faster to runSKIP_JAVADOC=true ./gradlew publishMavenJavaPublicationToMavenLocal
. If nativeruntime building failed on macOS/Linux with error "missing JAVA_INCLUDE...", you can check Building failed on macOS with M1 chipset for a workaround. - Add
mavenLocal()
to your project's root project build.gradle:allprojects { repositories { mavenCentral() google() mavenLocal() } }
- Update your project to use the SNAPSHOT version of Roblectric (4.8-SNAPSHOT at time of writing).
dependencies { ... testImplementation 'org.robolectric:robolectric:4.8-SNAPSHOT' ... }
- Run your project's tests.