Skip to content
This repository has been archived by the owner on Oct 20, 2020. It is now read-only.

Commit

Permalink
Update build.gradle to allow rootProject overrides of versions
Browse files Browse the repository at this point in the history
  • Loading branch information
cbrevik committed Aug 27, 2018
1 parent 6b034af commit 959d1ed
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
apply plugin: 'com.android.library'

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
compileSdkVersion safeExtGet('compileSdkVersion', 23)
buildToolsVersion safeExtGet('buildToolsVersion', "23.0.1")

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
minSdkVersion safeExtGet('minSdkVersion', 16)
targetSdkVersion safeExtGet('targetSdkVersion', 22)
versionCode 1
versionName "0.0.1"
}
}

dependencies {
compile 'com.facebook.react:react-native:+'
compile 'com.anjlab.android.iab.v3:library:1.0.44'
compile "com.facebook.react:react-native:${safeExtGet('reactNativeVersion', '+')}"
compile "com.anjlab.android.iab.v3:library:${safeExtGet('anjlabIABVersion', '1.0.44')}"
}

0 comments on commit 959d1ed

Please sign in to comment.