diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index 6d0237010..70a1511d0 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -114,5 +114,9 @@ gradlePlugin { id = libs.plugins.nowinandroid.jvm.library.get().pluginId implementationClass = "JvmLibraryConventionPlugin" } + register("foo") { + id = libs.plugins.nowinandroid.foo.get().pluginId + implementationClass = "FooSettingsPlugin" + } } } diff --git a/build-logic/convention/src/main/kotlin/FooSettingsPlugin.kt b/build-logic/convention/src/main/kotlin/FooSettingsPlugin.kt new file mode 100644 index 000000000..bad5454fc --- /dev/null +++ b/build-logic/convention/src/main/kotlin/FooSettingsPlugin.kt @@ -0,0 +1,24 @@ +/* + * Copyright 2023 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 org.gradle.api.Plugin +import org.gradle.api.initialization.Settings + +class FooSettingsPlugin : Plugin { + override fun apply(target: Settings) { + System.err.println("FOO!") + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5ea4c084c..ec44ab379 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -198,3 +198,4 @@ nowinandroid-android-room = { id = "nowinandroid.android.room" } nowinandroid-android-test = { id = "nowinandroid.android.test" } nowinandroid-hilt = { id = "nowinandroid.hilt" } nowinandroid-jvm-library = { id = "nowinandroid.jvm.library" } +nowinandroid-foo = { id = "nowinandroid.foo" } diff --git a/settings.gradle.kts b/settings.gradle.kts index 2b8c6e45c..5c52f5ad6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -76,6 +76,10 @@ include(":sync:work") include(":sync:sync-test") include(":ui-test-hilt-manifest") +plugins { + id("nowinandroid.foo") +} + check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { """ Now in Android requires JDK 17+ but it is currently using JDK ${JavaVersion.current()}.