From 777b6e89643f414db8cff739121807fa5efa5700 Mon Sep 17 00:00:00 2001 From: lihenggui Date: Fri, 15 Nov 2024 12:59:52 -0800 Subject: [PATCH] Remove AndroidApplicationComposeConventionPlugin.kt and AndroidApplicationConventionPlugin.kt --- build-logic/convention/build.gradle.kts | 8 --- ...droidApplicationComposeConventionPlugin.kt | 35 ------------ .../AndroidApplicationConventionPlugin.kt | 53 ------------------- gradle/libs.versions.toml | 2 - 4 files changed, 98 deletions(-) delete mode 100644 build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt delete mode 100644 build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 3217f7830..36556d3da 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -54,14 +54,6 @@ tasks { gradlePlugin { plugins { - register("androidApplicationCompose") { - id = "nowinandroid.android.application.compose" - implementationClass = "AndroidApplicationComposeConventionPlugin" - } - register("androidApplication") { - id = "nowinandroid.android.application" - implementationClass = "AndroidApplicationConventionPlugin" - } register("androidApplicationJacoco") { id = "nowinandroid.android.application.jacoco" implementationClass = "AndroidApplicationJacocoConventionPlugin" diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt deleted file mode 100644 index a8b1b1779..000000000 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationComposeConventionPlugin.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import com.android.build.api.dsl.ApplicationExtension -import com.google.samples.apps.nowinandroid.configureAndroidCompose -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.getByType - -class AndroidApplicationComposeConventionPlugin : Plugin { - override fun apply(target: Project) { - with(target) { - apply(plugin = "com.android.application") - apply(plugin = "org.jetbrains.kotlin.plugin.compose") - - val extension = extensions.getByType() - configureAndroidCompose(extension) - } - } - -} diff --git a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt b/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt deleted file mode 100644 index f4d5bb0d0..000000000 --- a/build-logic/convention/src/main/kotlin/AndroidApplicationConventionPlugin.kt +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import com.android.build.api.dsl.ApplicationExtension -import com.android.build.api.variant.ApplicationAndroidComponentsExtension -import com.android.build.gradle.BaseExtension -import com.google.samples.apps.nowinandroid.configureBadgingTasks -import com.google.samples.apps.nowinandroid.configureGradleManagedDevices -import com.google.samples.apps.nowinandroid.configureKotlinAndroid -import com.google.samples.apps.nowinandroid.configurePrintApksTask -import org.gradle.api.Plugin -import org.gradle.api.Project -import org.gradle.kotlin.dsl.configure -import org.gradle.kotlin.dsl.getByType - -class AndroidApplicationConventionPlugin : Plugin { - override fun apply(target: Project) { - with(target) { - with(pluginManager) { - apply("com.android.application") - apply("org.jetbrains.kotlin.android") - apply("nowinandroid.android.lint") - apply("com.dropbox.dependency-guard") - } - - extensions.configure { - configureKotlinAndroid(this) - defaultConfig.targetSdk = 34 - @Suppress("UnstableApiUsage") - testOptions.animationsDisabled = true - configureGradleManagedDevices(this) - } - extensions.configure { - configurePrintApksTask(this) - configureBadgingTasks(extensions.getByType(), this) - } - } - } - -} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 9ffe1452e..e76ec79f7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -213,8 +213,6 @@ ktrofit = { id = "de.jensklingenberg.ktorfit", version.ref = "ktrofit" } buildkonfig = { id = "com.codingfeline.buildkonfig", version.ref = "buildKonfig" } # Plugins defined by this project -nowinandroid-android-application = { id = "nowinandroid.android.application" } -nowinandroid-android-application-compose = { id = "nowinandroid.android.application.compose" } nowinandroid-android-application-flavors = { id = "nowinandroid.android.application.flavors" } nowinandroid-android-application-jacoco = { id = "nowinandroid.android.application.jacoco" } nowinandroid-android-library = { id = "nowinandroid.android.library" }