From fc1c804bfda1d76c0399bbb6214e75b3def951cc Mon Sep 17 00:00:00 2001 From: AntsyLich <59261191+AntsyLich@users.noreply.github.com> Date: Tue, 3 Sep 2024 14:09:12 +0600 Subject: [PATCH] Migrate some classpaths to gradle plugins --- app/build.gradle.kts | 4 ++-- build.gradle.kts | 8 ++++---- data/build.gradle.kts | 2 +- gradle/libs.versions.toml | 10 ++++++---- i18n/build.gradle.kts | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 015af54d7..fbcdb0204 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -6,13 +6,13 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("mihon.android.application") id("mihon.android.application.compose") - id("com.mikepenz.aboutlibraries.plugin") id("com.github.zellius.shortcut-helper") kotlin("plugin.serialization") + alias(libs.plugins.aboutLibraries) } if (gradle.startParameter.taskRequests.toString().contains("Standard")) { - apply() + pluginManager.apply(libs.plugins.google.services.get().pluginId) } shortcutHelper.setFilePath("./shortcuts.xml") diff --git a/build.gradle.kts b/build.gradle.kts index 93146c0a6..4ef17d6bc 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,15 +1,15 @@ buildscript { dependencies { classpath(libs.android.shortcut.gradle) - classpath(libs.google.services.gradle) - classpath(libs.aboutLibraries.gradle) - classpath(libs.sqldelight.gradle) - classpath(libs.moko.gradle) } } plugins { alias(kotlinx.plugins.serialization) apply false + alias(libs.plugins.aboutLibraries) apply false + alias(libs.plugins.google.services) apply false + alias(libs.plugins.moko) apply false + alias(libs.plugins.sqldelight) apply false } tasks.register("clean") { diff --git a/data/build.gradle.kts b/data/build.gradle.kts index 2fded2043..d3ca29085 100644 --- a/data/build.gradle.kts +++ b/data/build.gradle.kts @@ -1,8 +1,8 @@ plugins { id("mihon.library") - id("app.cash.sqldelight") kotlin("android") kotlin("plugin.serialization") + alias(libs.plugins.sqldelight) } android { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 49fd4fe89..1263cecc2 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -14,7 +14,6 @@ ktlint-core = "1.3.1" [libraries] desugar = "com.android.tools:desugar_jdk_libs:2.1.1" android-shortcut-gradle = "com.github.zellius:android-shortcut-gradle-plugin:0.1.2" -google-services-gradle = "com.google.gms:google-services:4.4.2" rxjava = "io.reactivex:rxjava:1.3.8" @@ -69,13 +68,11 @@ compose-stablemarker = "com.github.skydoves:compose-stable-marker:1.0.5" swipe = "me.saket.swipe:swipe:1.3.0" moko-core = { module = "dev.icerock.moko:resources", version.ref = "moko" } -moko-gradle = { module = "dev.icerock.moko:resources-generator", version.ref = "moko" } logcat = "com.squareup.logcat:logcat:0.1" firebase-analytics = "com.google.firebase:firebase-analytics:22.1.0" -aboutLibraries-gradle = { module = "com.mikepenz.aboutlibraries.plugin:aboutlibraries-plugin", version.ref = "aboutlib_version" } aboutLibraries-compose = { module = "com.mikepenz:aboutlibraries-compose-m3", version.ref = "aboutlib_version" } shizuku-api = { module = "dev.rikka.shizuku:api", version.ref = "shizuku_version" } @@ -88,7 +85,6 @@ sqldelight-android-driver = { module = "app.cash.sqldelight:android-driver", ver sqldelight-coroutines = { module = "app.cash.sqldelight:coroutines-extensions-jvm", version.ref = "sqldelight" } sqldelight-android-paging = { module = "app.cash.sqldelight:androidx-paging3-extensions", version.ref = "sqldelight" } sqldelight-dialects-sql = { module = "app.cash.sqldelight:sqlite-3-38-dialect", version.ref = "sqldelight" } -sqldelight-gradle = { module = "app.cash.sqldelight:gradle-plugin", version.ref = "sqldelight" } junit = "org.junit.jupiter:junit-jupiter:5.11.0" kotest-assertions = "io.kotest:kotest-assertions-core:5.9.1" @@ -102,6 +98,12 @@ voyager-transitions = { module = "cafe.adriel.voyager:voyager-transitions", vers spotless-gradle = { group = "com.diffplug.spotless", name = "spotless-plugin-gradle", version.ref = "spotless" } ktlint-core = { module = "com.pinterest.ktlint:ktlint-cli", version.ref = "ktlint-core" } +[plugins] +google-services = { id = "com.google.gms.google-services", version = "4.4.2" } +aboutLibraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "aboutlib_version" } +sqldelight = { id = "app.cash.sqldelight", version.ref = "sqldelight" } +moko = { id = "dev.icerock.mobile.multiplatform-resources", version.ref = "moko" } + [bundles] okhttp = ["okhttp-core", "okhttp-logging", "okhttp-brotli", "okhttp-dnsoverhttps"] js-engine = ["quickjs-android"] diff --git a/i18n/build.gradle.kts b/i18n/build.gradle.kts index a7d5b889a..ac5fa0bd4 100644 --- a/i18n/build.gradle.kts +++ b/i18n/build.gradle.kts @@ -4,8 +4,8 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { id("mihon.library") - id("dev.icerock.mobile.multiplatform-resources") kotlin("multiplatform") + alias(libs.plugins.moko) } kotlin {