Load Android Gradle Plugin conditionally

This commit is contained in:
SaeedZhiany
2019-10-21 09:11:01 +03:30
committed by GitHub
parent 189df82f17
commit d3b2f27e22
+14 -8
View File
@@ -2,14 +2,20 @@ buildscript {
ext.safeExtGet = {prop, fallback -> ext.safeExtGet = {prop, fallback ->
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
} }
repositories {
google() // The Android Gradle plugin is only required when opening the android folder stand-alone.
jcenter() // This avoids unnecessary downloads and potential conflicts when the library is included as a
} // module dependency in an application project.
if (project == rootProject) {
dependencies { repositories {
//noinspection GradleDependency google()
classpath("com.android.tools.build:gradle:${safeExtGet('gradlePluginVersion', '3.4.1')}") jcenter()
}
dependencies {
//noinspection GradleDependency
classpath("com.android.tools.build:gradle:3.5.1")
}
} }
} }