|
@@ -1,21 +1,22 @@
|
1
|
1
|
buildscript {
|
2
|
|
- //Buildscript is evaluated before everything else so we can't use getExtOrDefault
|
3
|
|
- def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['ReactNativeWebView_kotlinVersion']
|
4
|
|
-
|
5
|
|
- repositories {
|
6
|
|
- google()
|
7
|
|
- jcenter()
|
|
2
|
+ ext.getExtOrDefault = {name ->
|
|
3
|
+ return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebView_' + name]
|
8
|
4
|
}
|
9
|
5
|
|
10
|
|
- dependencies {
|
11
|
|
- classpath 'com.android.tools.build:gradle:3.2.1'
|
12
|
|
- //noinspection DifferentKotlinGradleVersion
|
13
|
|
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
14
|
|
- }
|
15
|
|
-}
|
|
6
|
+ // The Android Gradle plugin is only required when opening the android folder stand-alone.
|
|
7
|
+ // This avoids unnecessary downloads and potential conflicts when the library is included as a
|
|
8
|
+ // module dependency in an application project.
|
|
9
|
+ if (project == rootProject) {
|
|
10
|
+ repositories {
|
|
11
|
+ google()
|
|
12
|
+ jcenter()
|
|
13
|
+ }
|
16
|
14
|
|
17
|
|
-def getExtOrDefault(name) {
|
18
|
|
- return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNativeWebView_' + name]
|
|
15
|
+ dependencies {
|
|
16
|
+ classpath("com.android.tools.build:gradle:3.6.0")
|
|
17
|
+ classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}")
|
|
18
|
+ }
|
|
19
|
+ }
|
19
|
20
|
}
|
20
|
21
|
|
21
|
22
|
def getExtOrIntegerDefault(name) {
|