Running Robolectric SNAPSHOT - robolectric/robolectric GitHub Wiki

  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 publishMavenJavaPublicationToMavenLocal in the Robolectric root directory. It is also faster to run SKIP_JAVADOC=true ./gradlew publishMavenJavaPublicationToMavenLocal.
  4. Add mavenLocal() to your project's root project build.gradle:
    allprojects {
      repositories {
        mavenCentral()
        google()
        mavenLocal()
      }
    }
    
  5. Update your project to use the SNAPSHOT version of Roblectric (4.10-SNAPSHOT at time of writing).
    dependencies {
        ...
        testImplementation 'org.robolectric:robolectric:4.10-SNAPSHOT'
        ...
    }
    
  6. Run your project's tests.