From 81252b824932b536078db42e943e63f042706b24 Mon Sep 17 00:00:00 2001 From: SaeedZhiany Date: Tue, 11 Feb 2020 15:36:28 +0330 Subject: [PATCH] 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` --- android/build.gradle | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 89bcf416..fe22bbfe 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -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:+" }