Skip to content

Commit 6ce678f

Browse files
stigiandpor
authored andcommitted
[Android] Pulling SDK versions from root project (#287)
This adresses #286. See the issue for details.
1 parent 8c935c4 commit 6ce678f

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/android-native/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ buildscript {
1010

1111
apply plugin: 'com.android.library'
1212

13+
def safeExtGet(prop, fallback) {
14+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
15+
}
16+
1317
android {
14-
compileSdkVersion 23
15-
buildToolsVersion "23.0.1"
18+
compileSdkVersion safeExtGet('compileSdkVersion', 23)
19+
buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1')
1620

1721
defaultConfig {
18-
minSdkVersion 16
19-
targetSdkVersion 22
22+
minSdkVersion safeExtGet('minSdkVersion', 16)
23+
targetSdkVersion safeExtGet('targetSdkVersion', 22)
2024
versionCode 1
2125
versionName "1.0"
2226
}

src/android/build.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,17 @@ buildscript {
1010

1111
apply plugin: 'com.android.library'
1212

13+
def safeExtGet(prop, fallback) {
14+
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
15+
}
16+
1317
android {
14-
compileSdkVersion 23
15-
buildToolsVersion "23.0.1"
18+
compileSdkVersion safeExtGet('compileSdkVersion', 23)
19+
buildToolsVersion safeExtGet('buildToolsVersion', '23.0.1')
1620

1721
defaultConfig {
18-
minSdkVersion 16
19-
targetSdkVersion 22
22+
minSdkVersion safeExtGet('minSdkVersion', 16)
23+
targetSdkVersion safeExtGet('targetSdkVersion', 22)
2024
versionCode 1
2125
versionName "1.0"
2226
}

0 commit comments

Comments
 (0)