From 63191689014b1200967ffba9e53f61ab97c657fe Mon Sep 17 00:00:00 2001 From: Harry Chen Date: Fri, 8 Sep 2023 22:14:55 +0800 Subject: [PATCH] Refine gradle plugin versioning in Android build Signed-off-by: Harry Chen --- android/build.gradle | 8 ++------ android/gradle.properties | 2 ++ android/gradle/wrapper/gradle-wrapper.properties | 11 ++++++----- android/settings.gradle | 12 ++++++++++++ example/android/app/build.gradle | 2 +- example/android/build.gradle | 10 ---------- example/android/gradle.properties | 2 ++ example/android/settings.gradle | 5 +++++ 8 files changed, 30 insertions(+), 22 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 9a894b3..4a23601 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,7 +1,3 @@ -buildscript { - ext.kotlin_version = '1.9.10' -} - plugins { id 'com.android.library' id 'org.jetbrains.kotlin.android' @@ -41,7 +37,7 @@ android { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KotlinVersion" + implementation "org.jetbrains.kotlin:kotlin-reflect:$KotlinVersion" implementation 'androidx.core:core-ktx:1.10.1' } diff --git a/android/gradle.properties b/android/gradle.properties index 94adc3a..39a8970 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,3 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +AGPVersion=7.0.4 +KotlinVersion=1.9.10 \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 62a48dd..4a16027 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,6 @@ -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStorePath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME +#Fri Sep 08 22:01:14 CST 2023 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/android/settings.gradle b/android/settings.gradle index 13c731b..b30c81d 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1 +1,13 @@ +pluginManagement { + repositories { + gradlePluginPortal() + google() + mavenCentral() + } + plugins { + id 'com.android.library' version "${AGPVersion}" + id 'org.jetbrains.kotlin.android' version "${KotlinVersion}" + } +} + rootProject.name = 'flutter_nfc_kit' diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index e2ef232..9933fee 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -69,5 +69,5 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$KotlinVersion" } diff --git a/example/android/build.gradle b/example/android/build.gradle index 9836807..fc45178 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -1,13 +1,3 @@ -buildscript { - ext.kotlin_version = '1.9.10' -} - -plugins { - id 'com.android.application' version '7.0.4' apply false - id 'com.android.library' version '7.0.4' apply false - id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false -} - allprojects { repositories { gradlePluginPortal() diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 94adc3a..39a8970 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -1,3 +1,5 @@ org.gradle.jvmargs=-Xmx1536M android.useAndroidX=true android.enableJetifier=true +AGPVersion=7.0.4 +KotlinVersion=1.9.10 \ No newline at end of file diff --git a/example/android/settings.gradle b/example/android/settings.gradle index d3250ab..886cb45 100644 --- a/example/android/settings.gradle +++ b/example/android/settings.gradle @@ -4,6 +4,11 @@ pluginManagement { google() mavenCentral() } + plugins { + id 'com.android.application' version "${AGPVersion}" + id 'com.android.library' version "${AGPVersion}" + id 'org.jetbrains.kotlin.android' version "${KotlinVersion}" + } } include ':app'