|
@@ -0,0 +1,42 @@
|
|
1
|
+def robolectricDependenciesFolder = new File(rootProject.buildDir, "robolectric-3.3-dependencies")
|
|
2
|
+
|
|
3
|
+configurations.create('robolectricRuntime')
|
|
4
|
+
|
|
5
|
+dependencies {
|
|
6
|
+ testCompile "org.khronos:opengl-api:gl1.1-android-2.1_r1"
|
|
7
|
+
|
|
8
|
+ robolectricRuntime "org.robolectric:android-all:7.1.0_r7-robolectric-0"
|
|
9
|
+ robolectricRuntime "org.robolectric:shadows-core:3.3"
|
|
10
|
+ robolectricRuntime "org.robolectric:robolectric-utils:3.3"
|
|
11
|
+ robolectricRuntime "org.robolectric:robolectric-resources:3.3"
|
|
12
|
+ robolectricRuntime "org.robolectric:robolectric-processor:3.3"
|
|
13
|
+ robolectricRuntime "org.robolectric:robolectric-sandbox:3.3"
|
|
14
|
+ robolectricRuntime "org.robolectric:shadows-support-v4:3.3"
|
|
15
|
+ robolectricRuntime "org.robolectric:shadows-multidex:3.3"
|
|
16
|
+ robolectricRuntime "org.robolectric:shadows-play-services:3.3"
|
|
17
|
+ robolectricRuntime "org.robolectric:shadows-maps:3.3"
|
|
18
|
+}
|
|
19
|
+
|
|
20
|
+rootProject.task(type: Copy, overwrite: true, "downloadRobolectricDependencies") {
|
|
21
|
+ println "downloadRobolectricDependencies into " + robolectricDependenciesFolder
|
|
22
|
+ from configurations.robolectricRuntime
|
|
23
|
+ into robolectricDependenciesFolder
|
|
24
|
+}
|
|
25
|
+
|
|
26
|
+project.afterEvaluate {
|
|
27
|
+ tasks.all {
|
|
28
|
+ if (it.name.startsWith("test")) {
|
|
29
|
+ it.dependsOn(rootProject.tasks.findByName("downloadRobolectricDependencies"))
|
|
30
|
+ }
|
|
31
|
+ }
|
|
32
|
+}
|
|
33
|
+
|
|
34
|
+android {
|
|
35
|
+ testOptions {
|
|
36
|
+ unitTests.all {
|
|
37
|
+ systemProperty 'robolectric.offline', 'true'
|
|
38
|
+ systemProperty 'robolectric.dependency.dir', robolectricDependenciesFolder
|
|
39
|
+ }
|
|
40
|
+ }
|
|
41
|
+}
|
|
42
|
+
|