From 8ecf15ddc9ee9f9fcd21d2a0e4e8cbcf98f2478a Mon Sep 17 00:00:00 2001 From: David Cruz Date: Mon, 27 May 2024 15:29:50 +0100 Subject: [PATCH] Move all possible plugins in to toml and replace where is called. --- bike/build.gradle.kts | 8 ++++---- build.gradle.kts | 12 ++++++------ gabimoreno/build.gradle.kts | 12 ++++++------ gradle.properties | 4 ---- gradle/libs.versions.toml | 14 +++++++++++++- modules/core-testing/build.gradle.kts | 6 +++--- modules/core-view/build.gradle.kts | 6 +++--- modules/framework/build.gradle.kts | 6 +++--- modules/player/build.gradle.kts | 6 +++--- modules/remote-config/build.gradle.kts | 6 +++--- shared/build.gradle.kts | 10 +++++----- 11 files changed, 49 insertions(+), 41 deletions(-) diff --git a/bike/build.gradle.kts b/bike/build.gradle.kts index b50d8f9..b44e9bd 100644 --- a/bike/build.gradle.kts +++ b/bike/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.android.application") + alias(libs.plugins.androidApplication) kotlin("android") kotlin("kapt") id("dagger.hilt.android.plugin") @@ -7,12 +7,12 @@ plugins { android { namespace = "soy.gabimoreno.bike" - compileSdk = extra["compileSdk.version"]?.toString()?.toInt() + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { applicationId = "soy.gabimoreno.bike" - minSdk = extra["minSdk.version"]?.toString()?.toInt() - targetSdk = extra["targetSdk.version"]?.toString()?.toInt() + minSdk = libs.versions.sdk.minimum.get().toInt() + targetSdk = libs.versions.sdk.target.get().toInt() versionCode = 1 versionName = "1.0" diff --git a/build.gradle.kts b/build.gradle.kts index 576b3fc..8278365 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,12 +6,12 @@ buildscript { } plugins { - kotlin("multiplatform").apply(false) - id("com.android.application").apply(false) - id("com.android.library").apply(false) - id("org.jetbrains.compose").apply(false) - id("io.gitlab.arturbosch.detekt") version libs.versions.detekt.get() - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") version libs.versions.secrets.gradle.plugin.get() apply false + alias(libs.plugins.kotlinMultiplatform).apply(false) + alias(libs.plugins.androidApplication).apply(false) + alias(libs.plugins.androidLibrary).apply(false) + alias(libs.plugins.jetbrainsCompose).apply(false) + alias(libs.plugins.detekt.gradle.plugin) + alias(libs.plugins.secrets.gradle.plugin) apply false } apply(from = "gradle-scripts/detekt.gradle") diff --git a/gabimoreno/build.gradle.kts b/gabimoreno/build.gradle.kts index 8ee5e17..42bc80f 100644 --- a/gabimoreno/build.gradle.kts +++ b/gabimoreno/build.gradle.kts @@ -3,14 +3,14 @@ import com.google.firebase.crashlytics.buildtools.gradle.CrashlyticsExtension import org.jetbrains.compose.ComposePlugin.CommonComponentsDependencies.resources plugins { - id("com.android.application") + alias(libs.plugins.androidApplication) kotlin("android") alias(libs.plugins.google.services) kotlin("kapt") id("dagger.hilt.android.plugin") id("com.google.firebase.crashlytics") - id("com.google.android.libraries.mapsplatform.secrets-gradle-plugin") - id("org.jetbrains.compose") + alias(libs.plugins.secrets.gradle.plugin) + alias(libs.plugins.jetbrainsCompose) } @Suppress("UnstableApiUsage") @@ -28,12 +28,12 @@ android { } namespace = "soy.gabimoreno" - compileSdk = extra["compileSdk.version"]?.toString()?.toInt() + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { applicationId = "soy.gabimoreno" - minSdk = extra["minSdk.version"]?.toString()?.toInt() - targetSdk = extra["targetSdk.version"]?.toString()?.toInt() + minSdk = libs.versions.sdk.minimum.get().toInt() + targetSdk = libs.versions.sdk.target.get().toInt() versionCode = 54 versionName = "1.3.0" diff --git a/gradle.properties b/gradle.properties index aed24cd..3181e06 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,8 +12,4 @@ kotlin.mpp.androidSourceSetLayoutVersion=2 kotlin.version=1.9.20 agp.version=8.2.0 compose.version=1.5.11 -compileSdk.version=34 -minSdk.version=23 -targetSdk.version=34 org.jetbrains.compose.experimental.uikit.enabled=true -kotlin.native.cacheKind=none diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5385d14..24fd246 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,4 +1,9 @@ [versions] +sdk-compile = "34" +sdk-target = "34" +sdk-minimum = "23" +agp = "8.2.0" +kotlin = "1.9.20" accompanist-coil = "0.12.0" accompanist-insets = "0.12.0" androidx-junit = "1.1.5" @@ -24,8 +29,9 @@ glide = "4.12.0" google-material = "1.10.0" google-services = "4.4.0" gson = "2.10.1" -hilt-android = "2.48.1" +hilt-android = "2.51.1" secrets-gradle-plugin = "2.0.1" +compose-plugin = "1.6.10" junit = "4.13.2" kluent-android = "1.73" @@ -120,3 +126,9 @@ compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = [plugins] google-services = { id = "com.google.gms.google-services", version.ref = "google-services" } +androidApplication = { id = "com.android.application", version.ref = "agp" } +androidLibrary = { id = "com.android.library", version.ref = "agp" } +jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" } +kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" } +secrets-gradle-plugin = { id = "com.google.android.libraries.mapsplatform.secrets-gradle-plugin", version.ref = "secrets-gradle-plugin" } +detekt-gradle-plugin = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } diff --git a/modules/core-testing/build.gradle.kts b/modules/core-testing/build.gradle.kts index cd37385..aa4d53e 100644 --- a/modules/core-testing/build.gradle.kts +++ b/modules/core-testing/build.gradle.kts @@ -1,15 +1,15 @@ plugins { - id("com.android.library") + alias(libs.plugins.androidLibrary) kotlin("android") } @Suppress("UnstableApiUsage") android { namespace = "soy.gabimoreno.core.testing" - compileSdk = 33 + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.sdk.minimum.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/modules/core-view/build.gradle.kts b/modules/core-view/build.gradle.kts index 1b18bce..90130a7 100644 --- a/modules/core-view/build.gradle.kts +++ b/modules/core-view/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.android.library") + alias(libs.plugins.androidLibrary) kotlin("android") kotlin("kapt") } @@ -7,10 +7,10 @@ plugins { @Suppress("UnstableApiUsage") android { namespace = "soy.gabimoreno.core.view" - compileSdk = 33 + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.sdk.minimum.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/modules/framework/build.gradle.kts b/modules/framework/build.gradle.kts index 0b01cfb..3d20e39 100644 --- a/modules/framework/build.gradle.kts +++ b/modules/framework/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.android.library") + alias(libs.plugins.androidLibrary) kotlin("android") kotlin("kapt") } @@ -7,10 +7,10 @@ plugins { @Suppress("UnstableApiUsage") android { namespace = "soy.gabimoreno.framework" - compileSdk = 33 + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.sdk.minimum.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/modules/player/build.gradle.kts b/modules/player/build.gradle.kts index c945836..0f0804a 100644 --- a/modules/player/build.gradle.kts +++ b/modules/player/build.gradle.kts @@ -1,15 +1,15 @@ plugins { - id("com.android.library") + alias(libs.plugins.androidLibrary) id("org.jetbrains.kotlin.android") } @Suppress("UnstableApiUsage") android { namespace = "soy.gabimoreno.player" - compileSdk = 33 + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.sdk.minimum.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/modules/remote-config/build.gradle.kts b/modules/remote-config/build.gradle.kts index c4582d5..cd58122 100644 --- a/modules/remote-config/build.gradle.kts +++ b/modules/remote-config/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("com.android.library") + alias(libs.plugins.androidLibrary) kotlin("android") kotlin("kapt") } @@ -7,10 +7,10 @@ plugins { @Suppress("UnstableApiUsage") android { namespace = "soy.gabimoreno.remoteconfig" - compileSdk = 33 + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.sdk.minimum.get().toInt() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles("consumer-rules.pro") diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts index 02b7451..cfb35e3 100644 --- a/shared/build.gradle.kts +++ b/shared/build.gradle.kts @@ -1,9 +1,9 @@ import java.util.Locale plugins { - kotlin("multiplatform") - id("com.android.library") - id("org.jetbrains.compose") + alias(libs.plugins.kotlinMultiplatform) + alias(libs.plugins.androidLibrary) + alias(libs.plugins.jetbrainsCompose) } @OptIn(org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi::class) @@ -86,9 +86,9 @@ kotlin { android { namespace = "soy.gabimoreno.shared" - compileSdk = 33 + compileSdk = libs.versions.sdk.compile.get().toInt() defaultConfig { - minSdk = 23 + minSdk = libs.versions.sdk.minimum.get().toInt() } compileOptions { sourceCompatibility = JavaVersion.VERSION_17