Skip to content

Commit

Permalink
Merge pull request #149 from mlc/gradle_conf_in_root_project
Browse files Browse the repository at this point in the history
android: allow root project to specify dependency versions
  • Loading branch information
lbalmaceda authored Apr 25, 2018
2 parents 32d6247 + 2cfc81a commit 31c838d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ android:windowSoftInputMode="adjustResize">

> For more info please read [react native docs](https://facebook.github.io/react-native/docs/linking.html)

In order to reduce the potential for conflict which may be caused by the presence of differing versions of the Android support libraries, you may wish to [configure project-wide properties](https://developer.android.com/studio/build/gradle-tips.html#configure-project-wide-properties). Setting the Compile and Target SDK versions, Build Tools version, and Support Library version in your **root project's** `build.gradle` file will make `react-native-auth0` and many other React Native modules use them.

#### iOS

Inside the `ios` folder find the file `AppDelegate.[swift|m]` add the following to it
Expand Down
19 changes: 11 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
project.ext {
buildToolsVersion = "23.0.1"
}

buildscript {
repositories {
jcenter()
Expand All @@ -14,13 +10,18 @@ buildscript {

apply plugin: 'com.android.library'

def DEFAULT_COMPILE_SDK_VERSION = 23
def DEFAULT_BUILD_TOOLS_VERSION = "23.0.1"
def DEFAULT_TARGET_SDK_VERSION = 22
def DEFAULT_SUPPORT_LIB_VERSION = "23.0.1"

android {
compileSdkVersion 23
buildToolsVersion "${project.ext.buildToolsVersion}"
compileSdkVersion rootProject.hasProperty('compileSdkVersion') ? rootProject.compileSdkVersion : DEFAULT_COMPILE_SDK_VERSION
buildToolsVersion rootProject.hasProperty('buildToolsVersion') ? rootProject.buildToolsVersion : DEFAULT_BUILD_TOOLS_VERSION

defaultConfig {
minSdkVersion 16
targetSdkVersion 22
targetSdkVersion rootProject.hasProperty('targetSdkVersion') ? rootProject.targetSdkVersion : DEFAULT_TARGET_SDK_VERSION
versionCode 1
versionName "1.0"
}
Expand All @@ -33,8 +34,10 @@ repositories {
mavenCentral()
}

def supportVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION

dependencies {
compile 'com.facebook.react:react-native:+'
compile "com.android.support:customtabs:${project.ext.buildToolsVersion}"
compile "com.android.support:customtabs:${supportVersion}"
}

0 comments on commit 31c838d

Please sign in to comment.