Skip to content

Running Robolectric SNAPSHOT

LitterSun edited this page Nov 25, 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 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()
        jcenter()
        mavenLocal()
      }
    }
  5. Update your project to use the SNAPSHOT version of Roblectric (4.5-SNAPSHOT at time of writing).
    dependencies {
        ...
        testImplementation 'org.robolectric:robolectric:4.5-SNAPSHOT'
        ...
    }
  6. Run your project's tests