Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

android: allow root project to specify dependency versions #149

Merged
merged 3 commits into from
Apr 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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}"
}