diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 574ddaa4..80387e26 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -7,8 +7,8 @@ import org.gradle.api.tasks.testing.logging.TestExceptionFormat import java.io.ByteArrayOutputStream plugins { - id("com.android.application") - kotlin("android") + alias(libs.plugins.android.application) + alias(libs.plugins.jetbrains.kotlin.android) } val gitDescribe = { diff --git a/build.gradle.kts b/build.gradle.kts index 7bcd2111..4285e7a2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,13 +12,13 @@ buildscript { } plugins { - id("com.android.application") version plugins.versions.androidGradle apply false - id("com.android.library") version plugins.versions.androidGradle apply false - id("com.google.protobuf") version plugins.versions.protobuf apply false - id("org.jetbrains.kotlin.android") version plugins.versions.kotlin apply false - id("org.jetbrains.kotlin.kapt") version plugins.versions.kotlin apply false - id("org.jetbrains.dokka") version plugins.versions.kotlin apply false - id("org.jlleitschuh.gradle.ktlint") version plugins.versions.ktlint apply false + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.google.protobuf) apply false + alias(libs.plugins.jetbrains.kotlin.android) apply false + alias(libs.plugins.jetbrains.kotlin.kapt) apply false + alias(libs.plugins.jetbrains.dokka) apply false + alias(libs.plugins.jlleitschuh.ktlint) apply false } tasks.register("clean", Delete::class) { diff --git a/build.plugins.toml b/build.plugins.toml deleted file mode 100644 index 796aa181..00000000 --- a/build.plugins.toml +++ /dev/null @@ -1,20 +0,0 @@ -# -# SPDX-FileCopyrightText: 2023 The Calyx Institute -# SPDX-License-Identifier: Apache-2.0 -# - -[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 -# 1.9.0 Android 14 (QPR2) -# Check: -# https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-14.0.0_r29/build.txt -kotlin = "1.9.0" - -androidGradle = "8.4.1" -protobuf = "0.9.4" -ktlint = "11.5.0" diff --git a/contactsbackup/build.gradle.kts b/contactsbackup/build.gradle.kts index e6f2cf87..adbb4712 100644 --- a/contactsbackup/build.gradle.kts +++ b/contactsbackup/build.gradle.kts @@ -6,8 +6,8 @@ import java.io.FileInputStream import java.util.Properties plugins { - id("com.android.application") - id("org.jetbrains.kotlin.android") + alias(libs.plugins.android.application) + alias(libs.plugins.jetbrains.kotlin.android) } android { diff --git a/build.libs.toml b/gradle/libs.versions.toml similarity index 83% rename from build.libs.toml rename to gradle/libs.versions.toml index e2f31e0a..a305859c 100644 --- a/build.libs.toml +++ b/gradle/libs.versions.toml @@ -1,11 +1,14 @@ # -# SPDX-FileCopyrightText: 2023 The Calyx Institute +# SPDX-FileCopyrightText: 2024 The Calyx Institute # SPDX-License-Identifier: Apache-2.0 # -[metadata] - [versions] +# Gradle plugin versions +androidGradlePlugin = "8.4.1" +protobufPlugin = "0.9.4" +ktlint = "11.5.0" + # Android SDK versions compileSdk = "34" minSdk = "33" @@ -21,9 +24,14 @@ espresso = "3.4.0" # We use "strictly" to enforce the version cannot be overriden by transitive dependencies. # 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_r29/build.txt -aosp-kotlin = { strictly = "1.9.0" } +# 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 +# 1.9.0 Android 14 (QPR2) +# Check: https://android.googlesource.com/platform/external/kotlinc/+/refs/tags/android-14.0.0_r29/build.txt +kotlin = { strictly = "1.9.0" } # Lint versions lint-rules = { strictly = "0.1.0" } @@ -64,9 +72,9 @@ androidx-work-runtime = { strictly = "2.10.0-alpha01" } [libraries] # Kotlin standard dependencies -kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "aosp-kotlin" } -kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "aosp-kotlin" } -kotlin-stdlib-common = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "aosp-kotlin" } +kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } +kotlin-stdlib-jdk8 = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } +kotlin-stdlib-common = { module = "org.jetbrains.kotlin:kotlin-stdlib-common", version.ref = "kotlin" } # Lint dependencies thirdegg-lint-rules = { module = "com.github.thirdegg:lint-rules", version.ref = "lint-rules" } @@ -96,3 +104,12 @@ androidx-room-runtime = { module = "androidx.room:room-runtime", version.ref = " [bundles] kotlin = ["kotlin-stdlib", "kotlin-stdlib-jdk8", "kotlin-stdlib-common"] coroutines = ["kotlinx-coroutines-core-jvm", "kotlinx-coroutines-android"] + +[plugins] +android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +google-protobuf = { id = "com.google.protobuf", version.ref = "protobufPlugin" } +jetbrains-dokka = { id = "org.jetbrains.dokka", version.ref = "kotlin" } +jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +jetbrains-kotlin-kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } +jlleitschuh-ktlint = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 170d5ce4..7da91e2c 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -32,14 +32,6 @@ dependencyResolutionManagement { mavenCentral() maven("https://jitpack.io") } - versionCatalogs { - create("libs") { - from(files("build.libs.toml")) - } - create("plugins") { - from(files("build.plugins.toml")) - } - } } rootProject.name = "Seedvault" diff --git a/storage/demo/build.gradle.kts b/storage/demo/build.gradle.kts index 0f598924..effa673e 100644 --- a/storage/demo/build.gradle.kts +++ b/storage/demo/build.gradle.kts @@ -4,10 +4,10 @@ */ plugins { - id("com.android.application") - id("com.google.protobuf") - id("org.jetbrains.kotlin.android") - id("org.jetbrains.kotlin.kapt") + alias(libs.plugins.android.application) + alias(libs.plugins.google.protobuf) + alias(libs.plugins.jetbrains.kotlin.android) + alias(libs.plugins.jetbrains.kotlin.kapt) } android { diff --git a/storage/lib/build.gradle.kts b/storage/lib/build.gradle.kts index 3cd72ba5..dec7c24e 100644 --- a/storage/lib/build.gradle.kts +++ b/storage/lib/build.gradle.kts @@ -5,11 +5,11 @@ import com.google.protobuf.gradle.id * SPDX-License-Identifier: Apache-2.0 */ plugins { - id("com.google.protobuf") - id("org.jetbrains.kotlin.kapt") - id("org.jetbrains.dokka") - id("com.android.library") - kotlin("android") + alias(libs.plugins.android.library) + alias(libs.plugins.google.protobuf) + alias(libs.plugins.jetbrains.kotlin.android) + alias(libs.plugins.jetbrains.kotlin.kapt) + alias(libs.plugins.jetbrains.dokka) } android { @@ -98,7 +98,7 @@ dependencies { lintChecks(libs.thirdegg.lint.rules) testImplementation("junit:junit:${libs.versions.junit4.get()}") testImplementation("io.mockk:mockk:${libs.versions.mockk.get()}") - testImplementation("org.jetbrains.kotlin:kotlin-test-junit:${libs.versions.aosp.kotlin.get()}") + testImplementation("org.jetbrains.kotlin:kotlin-test-junit:${libs.versions.kotlin.get()}") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation( "androidx.test.espresso:espresso-core:${libs.versions.espresso.get()}"