12345678910111213141516171819202122232425262728293031323334 |
- def robolectricDependenciesFolder = new File(rootProject.buildDir, "robolectric-3.2.2-dependencies")
-
- configurations.create('robolectricRuntime')
-
- dependencies {
- testCompile "org.khronos:opengl-api:gl1.1-android-2.1_r1"
- robolectricRuntime "org.robolectric:android-all:6.0.1_r3-robolectric-0"
- robolectricRuntime "org.robolectric:shadows-core:3.2.2"
- }
-
- rootProject.task(type: Copy, overwrite: true, "downloadRobolectricDependencies") {
- println "downloadRobolectricDependencies into " + robolectricDependenciesFolder
- 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
- }
- }
- }
-
|