Created
September 5, 2017 13:50
-
-
Save STAR-ZERO/70c4b3aa477deb8d9521278af8ab70df to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def robolectricDependenciesFolder = project.rootDir.path + "/.robolectric-dependencies" | |
configurations.create('robolectricRuntime') | |
dependencies { | |
robolectricRuntime "org.robolectric:android-all:o-preview-4-robolectric-0" | |
} | |
rootProject.task(type: Copy, overwrite: true, "downloadRobolectricDependencies") { | |
from configurations.robolectricRuntime | |
into robolectricDependenciesFolder | |
} | |
project.afterEvaluate { | |
tasks.all { | |
if (it.name.startsWith("test")) { | |
it.dependsOn(rootProject.tasks.findByName("downloadRobolectricDependencies")) | |
} | |
} | |
} | |
android { | |
testOptions { | |
unitTests.all { | |
systemProperty 'robolectric.offline', 'true' | |
systemProperty 'robolectric.dependency.dir', robolectricDependenciesFolder | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment