Skip to content

Running Robolectric SNAPSHOT

Michael Hoisie edited this page Aug 13, 2020 · 14 revisions
  1. Clone the robolectric repository: git clone https://github.com/robolectric/robolectric
  2. Check out the branch/commit that you want to run
  3. Run ./gradlew install in the Robolectric root directory. It is also faster to run SKIP_JAVADOC=true ./gradlew install.
  4. Add mavenLocal() to your project's root project build.gradle:
    allprojects {
      repositories {
        mavenCentral()
        google()
        jcenter()
        mavenLocal()
      }
    }
  5. Update your project to use the SNAPSHOT version of Roblectric (4.4-SNAPSHOT at time of writing).
    dependencies {
        ...
        testImplementation 'org.robolectric:robolectric:4.4-SNAPSHOT'
        ...
    }
  6. Run your project's tests