From 4cc11e55c85f9bc21d48903f25bac12522aa27e5 Mon Sep 17 00:00:00 2001 From: borednaeem Date: Sat, 28 Oct 2023 19:59:34 +0200 Subject: [PATCH] - add plugins section to version catalog and update gradle build files (#918) --- app/build.gradle.kts | 8 ++++---- build.gradle.kts | 14 ++++++-------- gradle/libs.versions.toml | 12 ++++++++++++ macrobenchmark/build.gradle.kts | 4 ++-- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 85aa874a6..51d6e0480 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -15,10 +15,10 @@ */ plugins { - id("com.android.application") - id("kotlin-android") - id("com.google.devtools.ksp") - id("dagger.hilt.android.plugin") + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.ksp) + alias(libs.plugins.hilt) } android { diff --git a/build.gradle.kts b/build.gradle.kts index 9d6186efb..7b15be8fa 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,17 +19,15 @@ buildscript { google() mavenCentral() } - - dependencies { - classpath(libs.android.gradle.plugin) - classpath(libs.kotlin.gradle.plugin) - classpath(libs.hilt.android.gradle.plugin) - } } plugins { - id("com.diffplug.spotless") version "6.4.1" - id("com.google.devtools.ksp") version "1.9.10-1.0.13" apply false + alias(libs.plugins.android.application) apply false + alias(libs.plugins.kotlin.android) apply false + alias(libs.plugins.hilt) apply false + alias(libs.plugins.spotless) + alias(libs.plugins.ksp) apply false + alias(libs.plugins.android.test) apply false } spotless { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 96544debb..d22e1646c 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -58,6 +58,8 @@ uiAutomator = "2.2.0" viewModelCompose = "2.5.1" work = "2.7.1" systemuicontroller = "0.30.1" +ksp = "1.9.10-1.0.13" +spotless = "6.4.1" [libraries] accessibility-test-framework = { module = "com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework", version.ref = "accessibilityTestFramework" } @@ -115,3 +117,13 @@ accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist- okhttp3-logging-interceptor = { module = "com.squareup.okhttp3:logging-interceptor", version.ref = "okhttpLogging" } retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit" } retrofit2-converter-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +android-test = { id = "com.android.test", version.ref = "androidGradlePlugin" } +ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin"} +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } diff --git a/macrobenchmark/build.gradle.kts b/macrobenchmark/build.gradle.kts index 69b9f277d..82ea68b39 100644 --- a/macrobenchmark/build.gradle.kts +++ b/macrobenchmark/build.gradle.kts @@ -15,8 +15,8 @@ */ plugins { - id("com.android.test") - id("org.jetbrains.kotlin.android") + alias(libs.plugins.android.test) + alias(libs.plugins.kotlin.android) } android {