From cdbc901a267b76d3d2e1c51cebfe7e97622af7e2 Mon Sep 17 00:00:00 2001 From: Sungyong An Date: Sat, 9 Dec 2023 16:30:11 +0900 Subject: [PATCH] Migrate buildscript to plugins --- app/build.gradle | 6 +- build.gradle | 31 +++---- dependencies/classpath.txt | 172 ------------------------------------- gradle/libs.versions.toml | 26 ++++-- 4 files changed, 31 insertions(+), 204 deletions(-) delete mode 100644 dependencies/classpath.txt diff --git a/app/build.gradle b/app/build.gradle index da387e3a2..f4918ecb0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,13 +2,13 @@ plugins { id "moop.android.application" id "moop.android.compose" id "moop.android.hilt" + alias libs.plugins.firebase.crashlytics + alias libs.plugins.firebase.perf + alias libs.plugins.dependencyGuard } if (file("google-services.json").exists()) { apply plugin: 'com.google.gms.google-services' } -apply plugin: 'com.google.firebase.crashlytics' -apply plugin: 'com.google.firebase.firebase-perf' -apply plugin: 'com.dropbox.dependency-guard' def useReleaseKeystore = rootProject.file("signing/app-release.jks").exists() diff --git a/build.gradle b/build.gradle index 68824a935..4eb2b5e75 100644 --- a/build.gradle +++ b/build.gradle @@ -1,20 +1,15 @@ -buildscript { - dependencies { - classpath libs.android.pluginGradle - classpath libs.kotlin.pluginGradle - classpath libs.kotlin.serializationPluginGradle - classpath libs.dagger.hilt.pluginGradle - classpath libs.google.pluginGradle - classpath libs.firebase.crashlytics.pluginGradle - classpath libs.firebase.perf.pluginGradle - classpath libs.dependencyGuard.pluginGradle - } -} - plugins { - alias(libs.plugins.spotless) - alias(libs.plugins.ksp) - alias(libs.plugins.dependencyGuard) + alias(libs.plugins.android.application) apply false + alias(libs.plugins.android.library) apply false + alias(libs.plugins.gms) apply false + alias(libs.plugins.kotlin.jvm) apply false + alias(libs.plugins.kotlin.serialization) apply false + alias(libs.plugins.dagger.hilt) apply false + alias(libs.plugins.spotless) apply false + alias(libs.plugins.ksp) apply false + alias(libs.plugins.dependencyGuard) apply false + alias(libs.plugins.firebase.crashlytics) apply false + alias(libs.plugins.firebase.perf) apply false } apply from: "$rootDir/gradle/version.gradle" @@ -33,10 +28,6 @@ subprojects { } } -dependencyGuard { - configuration("classpath") -} - Object propOrDef(String propertyName, Object defaultValue) { def properties = new Properties() def keyFile = rootProject.file("signing/key.properties") diff --git a/dependencies/classpath.txt b/dependencies/classpath.txt deleted file mode 100644 index 5b2c54fbd..000000000 --- a/dependencies/classpath.txt +++ /dev/null @@ -1,172 +0,0 @@ -androidx.databinding:databinding-common:8.1.4 -androidx.databinding:databinding-compiler-common:8.1.4 -com.android.databinding:baseLibrary:8.1.4 -com.android.tools.analytics-library:crash:31.1.4 -com.android.tools.analytics-library:protos:31.1.4 -com.android.tools.analytics-library:shared:31.1.4 -com.android.tools.analytics-library:tracker:31.1.4 -com.android.tools.build.jetifier:jetifier-core:1.0.0-beta10 -com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta10 -com.android.tools.build:aapt2-proto:8.1.4-10154469 -com.android.tools.build:aaptcompiler:8.1.4 -com.android.tools.build:apksig:8.1.4 -com.android.tools.build:apkzlib:8.1.4 -com.android.tools.build:builder-model:8.1.4 -com.android.tools.build:builder-test-api:8.1.4 -com.android.tools.build:builder:8.1.4 -com.android.tools.build:bundletool:1.14.0 -com.android.tools.build:gradle-api:8.1.4 -com.android.tools.build:gradle-settings-api:8.1.4 -com.android.tools.build:gradle:8.1.4 -com.android.tools.build:manifest-merger:31.1.4 -com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api -com.android.tools.ddms:ddmlib:31.1.4 -com.android.tools.layoutlib:layoutlib-api:31.1.4 -com.android.tools.lint:lint-model:31.1.4 -com.android.tools.lint:lint-typedef-remover:31.1.4 -com.android.tools.utp:android-device-provider-ddmlib-proto:31.1.4 -com.android.tools.utp:android-device-provider-gradle-proto:31.1.4 -com.android.tools.utp:android-test-plugin-host-additional-test-output-proto:31.1.4 -com.android.tools.utp:android-test-plugin-host-apk-installer-proto:31.1.4 -com.android.tools.utp:android-test-plugin-host-coverage-proto:31.1.4 -com.android.tools.utp:android-test-plugin-host-emulator-control-proto:31.1.4 -com.android.tools.utp:android-test-plugin-host-logcat-proto:31.1.4 -com.android.tools.utp:android-test-plugin-host-retention-proto:31.1.4 -com.android.tools.utp:android-test-plugin-result-listener-gradle-proto:31.1.4 -com.android.tools:annotations:31.1.4 -com.android.tools:common:31.1.4 -com.android.tools:dvlib:31.1.4 -com.android.tools:repository:31.1.4 -com.android.tools:sdk-common:31.1.4 -com.android.tools:sdklib:31.1.4 -com.android:signflinger:8.1.4 -com.android:zipflinger:8.1.4 -com.diffplug.durian:durian-collect:1.2.0 -com.diffplug.durian:durian-core:1.2.0 -com.diffplug.durian:durian-io:1.2.0 -com.diffplug.spotless:com.diffplug.spotless.gradle.plugin:6.11.0 -com.diffplug.spotless:spotless-lib-extra:2.30.0 -com.diffplug.spotless:spotless-lib:2.30.0 -com.diffplug.spotless:spotless-plugin-gradle:6.11.0 -com.dropbox.dependency-guard:com.dropbox.dependency-guard.gradle.plugin:0.3.2 -com.dropbox.dependency-guard:dependency-guard:0.3.2 -com.google.android.gms:strict-version-matcher-plugin:1.2.4 -com.google.android:annotations:4.1.1.4 -com.google.api.grpc:proto-google-common-protos:2.0.1 -com.google.auto.value:auto-value-annotations:1.6.2 -com.google.code.findbugs:jsr305:3.0.2 -com.google.code.gson:gson:2.8.9 -com.google.crypto.tink:tink:1.7.0 -com.google.dagger:dagger:2.28.3 -com.google.dagger:hilt-android-gradle-plugin:2.45 -com.google.devtools.ksp:com.google.devtools.ksp.gradle.plugin:1.8.10-1.0.9 -com.google.devtools.ksp:symbol-processing-gradle-plugin:1.8.10-1.0.9 -com.google.errorprone:error_prone_annotations:2.11.0 -com.google.firebase:firebase-crashlytics-buildtools:2.9.2 -com.google.firebase:firebase-crashlytics-gradle:2.9.2 -com.google.firebase:perf-plugin:1.4.2 -com.google.flatbuffers:flatbuffers-java:1.12.0 -com.google.gms:google-services:4.3.14 -com.google.guava:failureaccess:1.0.1 -com.google.guava:guava:31.1-jre -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava -com.google.j2objc:j2objc-annotations:1.3 -com.google.jimfs:jimfs:1.1 -com.google.protobuf:protobuf-java-util:3.19.3 -com.google.protobuf:protobuf-java:3.19.3 -com.google.testing.platform:core-proto:0.0.8-alpha08 -com.googlecode.concurrent-trees:concurrent-trees:2.6.1 -com.googlecode.javaewah:JavaEWAH:1.1.13 -com.googlecode.juniversalchardet:juniversalchardet:1.0.3 -com.squareup:javapoet:1.13.0 -com.squareup:javawriter:2.5.0 -com.sun.activation:javax.activation:1.2.0 -com.sun.istack:istack-commons-runtime:3.0.8 -com.sun.xml.fastinfoset:FastInfoset:1.2.16 -commons-codec:commons-codec:1.11 -commons-io:commons-io:2.4 -commons-logging:commons-logging:1.2 -io.grpc:grpc-api:1.45.1 -io.grpc:grpc-context:1.45.1 -io.grpc:grpc-core:1.45.1 -io.grpc:grpc-netty:1.45.1 -io.grpc:grpc-protobuf-lite:1.45.1 -io.grpc:grpc-protobuf:1.45.1 -io.grpc:grpc-stub:1.45.1 -io.netty:netty-buffer:4.1.72.Final -io.netty:netty-codec-http2:4.1.72.Final -io.netty:netty-codec-http:4.1.72.Final -io.netty:netty-codec-socks:4.1.72.Final -io.netty:netty-codec:4.1.72.Final -io.netty:netty-common:4.1.72.Final -io.netty:netty-handler-proxy:4.1.72.Final -io.netty:netty-handler:4.1.72.Final -io.netty:netty-resolver:4.1.72.Final -io.netty:netty-tcnative-classes:2.0.46.Final -io.netty:netty-transport:4.1.72.Final -io.perfmark:perfmark-api:0.23.0 -jakarta.activation:jakarta.activation-api:1.2.1 -jakarta.xml.bind:jakarta.xml.bind-api:2.3.2 -javax.annotation:javax.annotation-api:1.3.2 -javax.inject:javax.inject:1 -net.java.dev.jna:jna-platform:5.6.0 -net.java.dev.jna:jna:5.6.0 -net.sf.jopt-simple:jopt-simple:4.9 -net.sf.kxml:kxml2:2.3.0 -org.apache.commons:commons-compress:1.21 -org.apache.httpcomponents:httpclient:4.5.13 -org.apache.httpcomponents:httpcore:4.4.15 -org.apache.httpcomponents:httpmime:4.5.6 -org.bitbucket.b_c:jose4j:0.7.0 -org.bouncycastle:bcpkix-jdk15on:1.67 -org.bouncycastle:bcprov-jdk15on:1.67 -org.checkerframework:checker-qual:3.12.0 -org.codehaus.groovy:groovy-xml:3.0.10 -org.codehaus.groovy:groovy:3.0.10 -org.codehaus.mojo:animal-sniffer-annotations:1.19 -org.eclipse.jgit:org.eclipse.jgit:5.13.1.202206130422-r -org.glassfish.jaxb:jaxb-runtime:2.3.2 -org.glassfish.jaxb:txw2:2.3.2 -org.javassist:javassist:3.26.0-GA -org.jdom:jdom2:2.0.6 -org.jetbrains.intellij.deps:trove4j:1.0.20200330 -org.jetbrains.kotlin:kotlin-android-extensions:1.8.10 -org.jetbrains.kotlin:kotlin-annotation-processing-gradle:1.8.10 -org.jetbrains.kotlin:kotlin-build-common:1.8.10 -org.jetbrains.kotlin:kotlin-compiler-embeddable:1.8.10 -org.jetbrains.kotlin:kotlin-compiler-runner:1.8.10 -org.jetbrains.kotlin:kotlin-daemon-client:1.8.10 -org.jetbrains.kotlin:kotlin-daemon-embeddable:1.8.10 -org.jetbrains.kotlin:kotlin-gradle-plugin-api:1.8.10 -org.jetbrains.kotlin:kotlin-gradle-plugin-idea-proto:1.8.10 -org.jetbrains.kotlin:kotlin-gradle-plugin-idea:1.8.10 -org.jetbrains.kotlin:kotlin-gradle-plugin-model:1.8.10 -org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10 -org.jetbrains.kotlin:kotlin-klib-commonizer-api:1.8.10 -org.jetbrains.kotlin:kotlin-native-utils:1.8.10 -org.jetbrains.kotlin:kotlin-project-model:1.8.10 -org.jetbrains.kotlin:kotlin-reflect:1.8.20-RC2 -org.jetbrains.kotlin:kotlin-scripting-common:1.8.10 -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.8.10 -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.8.10 -org.jetbrains.kotlin:kotlin-scripting-jvm:1.8.10 -org.jetbrains.kotlin:kotlin-serialization:1.8.10 -org.jetbrains.kotlin:kotlin-stdlib-common:1.8.20-RC2 -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.20-RC2 -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20-RC2 -org.jetbrains.kotlin:kotlin-stdlib:1.8.20-RC2 -org.jetbrains.kotlin:kotlin-tooling-core:1.8.10 -org.jetbrains.kotlin:kotlin-util-io:1.8.10 -org.jetbrains.kotlin:kotlin-util-klib:1.8.10 -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.5.0 -org.jetbrains:annotations:13.0 -org.jvnet.staxex:stax-ex:1.8.1 -org.ow2.asm:asm-analysis:9.2 -org.ow2.asm:asm-commons:9.2 -org.ow2.asm:asm-tree:9.2 -org.ow2.asm:asm-util:9.2 -org.ow2.asm:asm:9.2 -org.slf4j:slf4j-api:1.7.30 -org.tensorflow:tensorflow-lite-metadata:0.1.0-rc2 -xerces:xercesImpl:2.12.0 -xml-apis:xml-apis:1.4.01 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 38012ee17..00318d7e5 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,9 @@ [versions] +# Android +androidGradlePlugin = "8.1.4" +gms = "4.3.14" + # Kotlin kotlin = "1.8.10" coroutines = "1.6.4" @@ -34,14 +38,12 @@ dependencyGuard = "0.3.2" [libraries] -android-pluginGradle = "com.android.tools.build:gradle:8.1.4" +# Android android-desugar-jdk = "com.android.tools:desugar_jdk_libs:1.1.5" # Kotlin -kotlin-pluginGradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8", version.ref = "kotlin" } -kotlin-serializationPluginGradle = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "serialization" } coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" } @@ -50,7 +52,6 @@ coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", ve # Dagger -dagger-hilt-pluginGradle = { module = "com.google.dagger:hilt-android-gradle-plugin", version.ref = "dagger" } dagger-hilt-android = { module = "com.google.dagger:hilt-android", version.ref = "dagger" } dagger-hilt-compiler = { module = "com.google.dagger:hilt-android-compiler", version.ref = "dagger" } dagger-hilt-testing = { module = "com.google.dagger:hilt-android-testing", version.ref = "dagger" } @@ -128,7 +129,6 @@ androidx-test-uiautomator = "androidx.test.uiautomator:uiautomator:2.2.0" # Google -google-pluginGradle = "com.google.gms:google-services:4.3.14" google-play-appUpdate = "com.google.android.play:app-update-ktx:2.0.1" google-ads = "com.google.android.gms:play-services-ads:21.3.0" @@ -139,8 +139,6 @@ firebase-crashlytics = { module = "com.google.firebase:firebase-crashlytics-ktx" firebase-dynamicLinks = { module = "com.google.firebase:firebase-dynamic-links-ktx" } firebase-messaging = { module = "com.google.firebase:firebase-messaging-ktx" } firebase-perf = { module = "com.google.firebase:firebase-perf-ktx" } -firebase-crashlytics-pluginGradle = { module = "com.google.firebase:firebase-crashlytics-gradle", version = "2.9.2" } -firebase-perf-pluginGradle = { module = "com.google.firebase:perf-plugin", version = "1.4.2" } # Etc @@ -153,9 +151,19 @@ kakaoLink = "com.kakao.sdk:v2-share:2.13.0" naverMapCompose = { module = "io.github.fornewid:naver-map-compose", version.ref = "navermapcompose" } timber = "com.jakewharton.timber:timber:5.0.1" -dependencyGuard-pluginGradle = { module = "com.dropbox.dependency-guard:dependency-guard", version.ref = "dependencyGuard" } +# Dependencies of the included build-logic +android-pluginGradle = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" } +kotlin-pluginGradle = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } [plugins] -spotless = { id = "com.diffplug.spotless", version = "6.11.0" } +android-application = { id = "com.android.application", version.ref = "androidGradlePlugin" } +android-library = { id = "com.android.library", version.ref = "androidGradlePlugin" } +gms = { id = "com.google.gms.google-services", version.ref = "gms" } +dagger-hilt = { id = "com.google.dagger.hilt.android", version.ref = "dagger" } +kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } +kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" } ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" } +spotless = { id = "com.diffplug.spotless", version = "6.11.0" } dependencyGuard = { id = "com.dropbox.dependency-guard", version.ref = "dependencyGuard" } +firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "2.9.2" } +firebase-perf = { id = "com.google.firebase.firebase-perf", version = "1.4.2" }