Skip to content

Commit

Permalink
Merge pull request #87 from SaeedZhiany/patch-1
Browse files Browse the repository at this point in the history
Load Android Gradle Plugin conditionally
  • Loading branch information
prscX authored Jan 8, 2020
2 parents 7aba84e + 8a04dd1 commit bf09e67
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@

buildscript {
repositories {
google()
maven { url "https://maven.google.com" }
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
// 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.
if (project == rootProject) {
repositories {
google()
jcenter()
}

dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
}
}
}

Expand All @@ -18,12 +22,12 @@ def safeExtGet(prop, fallback) {
}

android {
compileSdkVersion safeExtGet("compileSdkVersion", 27)
compileSdkVersion safeExtGet("compileSdkVersion", 28)
buildToolsVersion safeExtGet("buildToolsVersion", "28.0.3")

defaultConfig {
minSdkVersion safeExtGet("minSdkVersion", 16)
targetSdkVersion safeExtGet("targetSdkVersion", 27)
targetSdkVersion safeExtGet("targetSdkVersion", 28)
versionCode 1
versionName "1.0"
}
Expand All @@ -33,8 +37,8 @@ android {
}

repositories {
google()
mavenCentral()
maven { url "https://maven.google.com" }
}


Expand Down

0 comments on commit bf09e67

Please sign in to comment.