From b131aaf8988980b785656b8aff0220e312be3247 Mon Sep 17 00:00:00 2001 From: Steve Soltys Date: Thu, 19 Oct 2023 00:23:06 -0400 Subject: [PATCH] Clean up Gradle build scripts --- build.gradle.kts | 11 +---------- build.libs.toml | 1 + build.plugins.toml | 9 +++++++++ contactsbackup/build.gradle.kts | 3 ++- storage/demo/build.gradle.kts | 9 ++++++--- storage/lib/build.gradle.kts | 3 +-- 6 files changed, 20 insertions(+), 16 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index bb491f53..2a5dde5d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,15 +3,6 @@ import org.jlleitschuh.gradle.ktlint.KtlintExtension buildscript { repositories { google() - jcenter() - } - - dependencies { - classpath("com.android.tools.build:gradle:${plugins.versions.androidGradle}") - classpath("com.google.protobuf:protobuf-gradle-plugin:${plugins.versions.protobuf}") - classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${plugins.versions.kotlin}") - classpath("org.jetbrains.dokka:dokka-gradle-plugin:${plugins.versions.kotlin}") - classpath("org.jlleitschuh.gradle:ktlint-gradle:${plugins.versions.ktlint}") } } @@ -30,7 +21,7 @@ tasks.register("clean", Delete::class) { } subprojects { - if (path == ":app" || path == ":storage:lib") { + if (path != ":storage:demo") { apply(plugin = "org.jlleitschuh.gradle.ktlint") configure { diff --git a/build.libs.toml b/build.libs.toml index 76069aaa..b723baab 100644 --- a/build.libs.toml +++ b/build.libs.toml @@ -17,6 +17,7 @@ espresso = "3.4.0" # We need to enforce that the versions we use are the same as AOSP to ensure compatibility. # Kotlin versions +# https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-14.0.0_r1/build.txt aosp-kotlin = { strictly = "1.8.10" } # Lint versions diff --git a/build.plugins.toml b/build.plugins.toml index 1e9acf93..defb8bff 100644 --- a/build.plugins.toml +++ b/build.plugins.toml @@ -1,5 +1,14 @@ [versions] +# We need to enforce that the versions we use are the same as AOSP to ensure compatibility. +# 1.3.61 Android 11 +# 1.4.30 Android 12 +# 1.6.10 Android 13 +# 1.7.20 Android 13 (QPR2) +# 1.8.10 Android 14 +# Check: +# https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-14.0.0_r1/build.txt kotlin = "1.8.10" + androidGradle = "8.1.2" protobuf = "0.9.4" ktlint = "11.5.0" diff --git a/contactsbackup/build.gradle.kts b/contactsbackup/build.gradle.kts index 36e7fcf1..92ad822d 100644 --- a/contactsbackup/build.gradle.kts +++ b/contactsbackup/build.gradle.kts @@ -72,6 +72,7 @@ dependencies { androidTestImplementation(libs.kotlin.stdlib.jdk8) androidTestImplementation("androidx.test.ext:junit:1.1.5") - androidTestImplementation("androidx.test.espresso:espresso-core:${libs.versions.espresso.get()}") + androidTestImplementation( + "androidx.test.espresso:espresso-core:${libs.versions.espresso.get()}") androidTestImplementation("io.mockk:mockk-android:${libs.versions.mockk.get()}") } diff --git a/storage/demo/build.gradle.kts b/storage/demo/build.gradle.kts index 20c91b53..0f598924 100644 --- a/storage/demo/build.gradle.kts +++ b/storage/demo/build.gradle.kts @@ -46,11 +46,14 @@ android { freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn") } - lintOptions { - disable("DialogFragmentCallbacksDetector", "InvalidFragmentVersionForActivityResult") + lint { + disable += setOf( + "DialogFragmentCallbacksDetector", + "InvalidFragmentVersionForActivityResult" + ) } - packagingOptions { + packaging { jniLibs { excludes += listOf("META-INF/services/kotlin*") } diff --git a/storage/lib/build.gradle.kts b/storage/lib/build.gradle.kts index 657c5f21..3cd72ba5 100644 --- a/storage/lib/build.gradle.kts +++ b/storage/lib/build.gradle.kts @@ -18,9 +18,8 @@ android { defaultConfig { minSdk = libs.versions.minSdk.get().toInt() - targetSdk = libs.versions.targetSdk.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" - testInstrumentationRunnerArguments(mapOf("disableAnalytics" to "true")) + testInstrumentationRunnerArguments["disableAnalytics"] = "true" } buildTypes {