Skip to content

Commit b873c70

Browse files
Update kotlin monorepo to v2.2.20 (#1728)
* Update kotlin monorepo to v2.2.20 * Replace plugins `withType` with `withId` Fixes ``` e: warnings found and -Werror specified w: file:///Users/goooler/IdeaProjects/shadow/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt:118:13 Type argument is not within its bounds: must be subtype of '(Plugin<Any!>..Plugin<*>?)'. w: file:///Users/goooler/IdeaProjects/shadow/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPlugin.kt:17:5 Type argument is not within its bounds: must be subtype of '(Plugin<Any!>..Plugin<*>?)'. w: file:///Users/goooler/IdeaProjects/shadow/src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPlugin.kt:21:5 Type argument is not within its bounds: must be subtype of '(Plugin<Any!>..Plugin<*>?)'. ``` --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Goooler <[email protected]>
1 parent 975e8a8 commit b873c70

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[versions]
22
jdkRelease = "11"
3-
kotlin = "2.2.10"
3+
kotlin = "2.2.20"
44
moshi = "1.15.2"
55
pluginPublish = "2.0.0"
66

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowJavaPlugin.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import org.gradle.api.plugins.JavaPlugin.API_CONFIGURATION_NAME
2424
import org.gradle.api.plugins.JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME
2525
import org.gradle.api.plugins.JavaPlugin.COMPILE_ONLY_CONFIGURATION_NAME
2626
import org.gradle.api.tasks.bundling.Jar
27-
import org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin
2827

2928
public abstract class ShadowJavaPlugin @Inject constructor(
3029
private val softwareComponentFactory: SoftwareComponentFactory,
@@ -115,7 +114,8 @@ public abstract class ShadowJavaPlugin @Inject constructor(
115114
}
116115

117116
protected open fun Project.configureJavaGradlePlugin() {
118-
plugins.withType(JavaGradlePluginPlugin::class.java).configureEach {
117+
// org.gradle.plugin.devel.plugins.JavaGradlePluginPlugin
118+
plugins.withId("org.gradle.java-gradle-plugin") {
119119
val gradleApi = dependencies.gradleApi()
120120
// Remove the gradleApi so it isn't merged into the jar file.
121121
// This is required because 'java-gradle-plugin' adds gradleApi() to the 'api' configuration.

src/main/kotlin/com/github/jengelman/gradle/plugins/shadow/ShadowPlugin.kt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,17 @@ import com.github.jengelman.gradle.plugins.shadow.internal.findOptionalProperty
66
import com.github.jengelman.gradle.plugins.shadow.legacy.LegacyShadowPlugin
77
import org.gradle.api.Plugin
88
import org.gradle.api.Project
9-
import org.gradle.api.plugins.ApplicationPlugin
10-
import org.gradle.api.plugins.JavaPlugin
119

1210
public abstract class ShadowPlugin : Plugin<Project> {
1311

1412
override fun apply(project: Project): Unit = with(project.plugins) {
1513
apply(ShadowBasePlugin::class.java)
16-
@Suppress("WithTypeWithoutConfigureEach")
17-
withType(JavaPlugin::class.java) {
14+
// org.gradle.api.plugins.JavaPlugin
15+
withId("org.gradle.java") {
1816
apply(ShadowJavaPlugin::class.java)
1917
}
20-
@Suppress("WithTypeWithoutConfigureEach")
21-
withType(ApplicationPlugin::class.java) {
18+
// org.gradle.api.plugins.ApplicationPlugin
19+
withId("org.gradle.application") {
2220
apply(ShadowApplicationPlugin::class.java)
2321
}
2422
withId(KOTLIN_MULTIPLATFORM_PLUGIN_ID) {

0 commit comments

Comments
 (0)