Add a `Plugin<Settings>` to the included build

pull/1908/head
Simon Marquis 2 months ago
parent 27e0336729
commit 27441601c5
No known key found for this signature in database

@ -114,5 +114,9 @@ gradlePlugin {
id = libs.plugins.nowinandroid.jvm.library.get().pluginId id = libs.plugins.nowinandroid.jvm.library.get().pluginId
implementationClass = "JvmLibraryConventionPlugin" implementationClass = "JvmLibraryConventionPlugin"
} }
register("foo") {
id = libs.plugins.nowinandroid.foo.get().pluginId
implementationClass = "FooSettingsPlugin"
}
} }
} }

@ -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<Settings> {
override fun apply(target: Settings) {
System.err.println("FOO!")
}
}

@ -198,3 +198,4 @@ nowinandroid-android-room = { id = "nowinandroid.android.room" }
nowinandroid-android-test = { id = "nowinandroid.android.test" } nowinandroid-android-test = { id = "nowinandroid.android.test" }
nowinandroid-hilt = { id = "nowinandroid.hilt" } nowinandroid-hilt = { id = "nowinandroid.hilt" }
nowinandroid-jvm-library = { id = "nowinandroid.jvm.library" } nowinandroid-jvm-library = { id = "nowinandroid.jvm.library" }
nowinandroid-foo = { id = "nowinandroid.foo" }

@ -76,6 +76,10 @@ include(":sync:work")
include(":sync:sync-test") include(":sync:sync-test")
include(":ui-test-hilt-manifest") include(":ui-test-hilt-manifest")
plugins {
id("nowinandroid.foo")
}
check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { check(JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) {
""" """
Now in Android requires JDK 17+ but it is currently using JDK ${JavaVersion.current()}. Now in Android requires JDK 17+ but it is currently using JDK ${JavaVersion.current()}.

Loading…
Cancel
Save