18
18
// buildToolsVersion = "26.0.2"
19
19
// supportLibVersion = "26.1.0"
20
20
// googlePlayServicesVersion = "11.8.0"
21
- // oreoEXPERIMENTAL = "hellyes"
22
21
// }
23
22
//
24
23
//
28
27
apply plugin : ' com.android.library'
29
28
30
29
apply from : ' ../common/VERSIONS.gradle'
31
- def playServicesVersion = getPlayServicesVersion()
32
- def supportLibVersion = getSupportLibVersion()
33
- def hasGradle3Support = getGradle3Support()
34
30
def hasApp = findProject(' :app' ) != null
35
31
36
- def projectFlavor = " preoreo"
37
- if (rootProject. hasProperty(' oreoEXPERIMENTAL' )) {
38
- projectFlavor = " oreo"
39
- }
40
-
41
32
// https://hackernoon.com/android-how-to-add-gradle-dependencies-using-foreach-c4cbcc070458
42
- def oreoDependencies = [
33
+ def projDependencies = [
43
34
[configuration : " implementation" , dependency : libs. slf4j],
44
35
[configuration : " implementation" , dependency : libs. reactNative],
36
+ [configuration : " testImplementation" , dependency : testLibs. testRunner],
37
+ [configuration : " testImplementation" , dependency : testLibs. testRules],
45
38
[configuration : " testImplementation" , dependency : testLibs. junit],
46
39
[configuration : " testImplementation" , dependency : testLibs. powermockMockito],
47
40
[configuration : " testImplementation" , dependency : testLibs. powermockjUnit],
@@ -53,20 +46,6 @@ def oreoDependencies = [
53
46
[configuration : " androidTestImplementation" , dependency : testLibs. testRules],
54
47
]
55
48
56
- def preoreoDependencies = [
57
- [configuration : " compile" , dependency : libs. slf4j],
58
- [configuration : " compile" , dependency : libs. reactNative],
59
- [configuration : " testCompile" , dependency : testLibs. junit],
60
- [configuration : " testCompile" , dependency : testLibs. powermockMockito],
61
- [configuration : " testCompile" , dependency : testLibs. powermockjUnit],
62
- [configuration : " testCompile" , dependency : testLibs. powermockClassloading],
63
- [configuration : " testCompile" , dependency : testLibs. mockitoCore],
64
- [configuration : " testCompile" , dependency : testLibs. festAssertCore],
65
- [configuration : " testCompile" , dependency : testLibs. robolectric],
66
- [configuration : " androidTestCompile" , dependency : testLibs. testRunner],
67
- [configuration : " androidTestCompile" , dependency : testLibs. testRules],
68
- ]
69
-
70
49
repositories {
71
50
// Google dependencies are now hosted at Maven
72
51
// unfortunately this is ignored when installing as react-native plugin
@@ -83,6 +62,12 @@ android {
83
62
evaluationDependsOn(' :app' )
84
63
}
85
64
65
+ // Tip: https://stackoverflow.com/questions/39987669/renamingdelegatingcontext-is-deprecated-how-do-we-test-sqlite-db-now/52170737#52170737
66
+ // Gradle automatically adds 'android.test.runner' as a dependency.
67
+ useLibrary ' android.test.runner'
68
+ useLibrary ' android.test.base'
69
+ useLibrary ' android.test.mock'
70
+
86
71
defaultConfig {
87
72
testInstrumentationRunner " android.support.test.runner.AndroidJUnitRunner"
88
73
minSdkVersion project. ext. getMinSdkVersion()
@@ -97,18 +82,9 @@ android {
97
82
}
98
83
99
84
dependencies {
100
- if (hasGradle3Support) {
101
- implementation project(path : ' :@mauron85_react-native-background-geolocation-common' )
102
-
103
- oreoDependencies. each {
104
- add(it. configuration, it. dependency)
105
- }
106
- } else {
107
- releaseCompile project(path : ' :@mauron85_react-native-background-geolocation-common' , configuration : " ${ projectFlavor} Release" )
108
- debugCompile project(path : ' :@mauron85_react-native-background-geolocation-common' , configuration : " ${ projectFlavor} Debug" )
85
+ implementation project(path : ' :@mauron85_react-native-background-geolocation-common' )
109
86
110
- preoreoDependencies. each {
111
- add(it. configuration, it. dependency)
112
- }
87
+ projDependencies. each {
88
+ add(it. configuration, it. dependency)
113
89
}
114
90
}
0 commit comments