Skip to content

Commit 3c29a88

Browse files
authored
Update build.gradle (#115)
1 parent 7896a45 commit 3c29a88

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/core/android/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
33

4+
def defaultKotlinVersion = '1.3.21'
5+
def safeExtGet(prop, fallback) {
6+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
7+
}
8+
49
buildscript {
510
repositories {
611
jcenter()
712
maven { url 'https://maven.google.com' }
813
}
914
dependencies {
1015
classpath 'com.android.tools.build:gradle:3.1.4'
11-
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.21'
16+
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${safeExtGet("kotlinVersion", defaultKotlinVersion)}"
1217
}
1318
}
1419

15-
def safeExtGet(prop, fallback) {
16-
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
17-
}
18-
1920
android {
2021
compileSdkVersion safeExtGet('compileSdkVersion', 26)
2122
buildToolsVersion safeExtGet('buildToolsVersion', '26.0.3')
@@ -41,5 +42,5 @@ dependencies {
4142
api 'com.segment.analytics.android:analytics:4.+'
4243

4344
api 'com.facebook.react:react-native:+'
44-
api 'org.jetbrains.kotlin:kotlin-stdlib:1.3.21'
45+
api "org.jetbrains.kotlin:kotlin-stdlib:${safeExtGet("kotlinVersion", defaultKotlinVersion)}"
4546
}

0 commit comments

Comments
 (0)