Add support for Android Gradle Plugin 3.0 "implementation" keyword. (#1958)

This commit is contained in:
Christian Melchior 2018-08-14 13:12:06 +02:00 committed by GitHub
parent 97c310980a
commit d05725c914
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 15 deletions

View File

@ -16,7 +16,7 @@
* [Sync] Added `Session.isConnected()`. * [Sync] Added `Session.isConnected()`.
### Bug fixes ### Bug fixes
* None. * React Native for Android now supports the Android Gradle Plugin 3.0 (#1742).
### Internals ### Internals
* Updated to Object Store commit: 97fd03819f398b3c81c8b007feaca8636629050b * Updated to Object Store commit: 97fd03819f398b3c81c8b007feaca8636629050b

View File

@ -126,11 +126,11 @@ android {
} }
dependencies { dependencies {
compile project(':react-native-exit-app-no-history') implementation project(':react-native-exit-app-no-history')
compile fileTree(dir: "libs", include: ["*.jar"]) implementation fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1" implementation "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules implementation "com.facebook.react:react-native:+" // From node_modules
compile project(":realm") implementation project(":realm")
} }
// Run this once to be able to run the application with BUCK // Run this once to be able to run the application with BUCK

View File

@ -6,7 +6,7 @@ buildscript {
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.2' classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files

View File

@ -392,8 +392,15 @@ afterEvaluate { project ->
} }
} }
dependencies { def dependencyType = "implementation"
compile fileTree(dir: 'libs', include: ['*.jar']) try {
compile 'org.nanohttpd:nanohttpd:2.2.0' project.getConfigurations().getByName("implementation")
compile 'com.facebook.react:react-native:+' // From node_modules } catch (UnknownConfigurationException e) {
dependencyType = "compile" // Pre 3.0 Android Gradle Plugin
}
project.dependencies {
add(dependencyType, fileTree(dir: 'libs', include: ['*.jar']))
add(dependencyType, 'org.nanohttpd:nanohttpd:2.2.0')
add(dependencyType, 'com.facebook.react:react-native:+')
} }

View File

@ -81,8 +81,15 @@ task send(type: SendAnalyticsTask) << {
preBuild.dependsOn send preBuild.dependsOn send
dependencies { def dependencyType = "implementation"
compile fileTree(dir: 'libs', include: ['*.jar']) try {
compile 'org.nanohttpd:nanohttpd:2.2.0' project.getConfigurations().getByName("implementation")
compile 'com.facebook.react:react-native:+' // From node_modules } catch (UnknownConfigurationException e) {
dependencyType = "compile" // Pre 3.0 Android Gradle Plugin
}
project.dependencies {
add(dependencyType, fileTree(dir: 'libs', include: ['*.jar']))
add(dependencyType, 'org.nanohttpd:nanohttpd:2.2.0')
add(dependencyType, 'com.facebook.react:react-native:+')
} }