Refactored Gradle setup

- moved safeExtGet to out of `buildscript` block, because it's no longer needed to be there (previously we needed it there for getting AGP version from root project)

- bumped AGP version to 3.5.3

- replace `${safeExtGet('reactnativeVersion', '+')}` with `+`, becase react-native version automatically resolved by npm and it does not need to handle using `safeExtGet`
This commit is contained in:
SaeedZhiany
2020-02-11 15:36:28 +03:30
committed by GitHub
parent b2f2d15dc6
commit 81252b8249
+6 -7
View File
@@ -1,8 +1,4 @@
buildscript {
ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
// The Android Gradle plugin is only required when opening the android folder stand-alone.
// This avoids unnecessary downloads and potential conflicts when the library is included as a
// module dependency in an application project.
@@ -13,14 +9,17 @@ buildscript {
}
dependencies {
//noinspection GradleDependency
classpath("com.android.tools.build:gradle:3.5.1")
classpath("com.android.tools.build:gradle:3.5.3")
}
}
}
apply plugin: 'com.android.library'
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
//noinspection GradleDependency
@@ -48,5 +47,5 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:${safeExtGet('reactnativeVersion', '+')}"
implementation "com.facebook.react:react-native:+"
}