Skip to content

Commit d4bf5dc

Browse files
authored
Use task configuration avoidance (#906)
1 parent 5995e37 commit d4bf5dc

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,12 @@ tasks.register("preMerge") {
6262
dependsOn(gradle.includedBuild("plugin-build").task(":check"))
6363
}
6464

65-
tasks.getByName("spotlessCheck") {
65+
tasks.named("spotlessCheck") {
6666
dependsOn(gradle.includedBuild("sentry-kotlin-compiler-plugin").task(":spotlessCheck"))
6767
dependsOn(gradle.includedBuild("plugin-build").task(":spotlessCheck"))
6868
}
6969

70-
tasks.getByName("spotlessApply") {
70+
tasks.named("spotlessApply") {
7171
dependsOn(gradle.includedBuild("sentry-kotlin-compiler-plugin").task(":spotlessApply"))
7272
dependsOn(gradle.includedBuild("plugin-build").task(":spotlessApply"))
7373
}

examples/multi-module-sample/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ plugins {
55
id("io.sentry.jvm.gradle")
66
}
77

8-
tasks.withType<KotlinCompile> {
8+
tasks.withType<KotlinCompile>().configureEach {
99
kotlinOptions {
1010
freeCompilerArgs = listOf("-Xjsr305=strict")
1111
jvmTarget = JavaVersion.VERSION_1_8.toString()

examples/multi-module-sample/spring-boot-in-multi-module-sample/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ dependencies {
3434
}
3535
}
3636

37-
tasks.withType<Test> { useJUnitPlatform() }
37+
tasks.withType<Test>().configureEach { useJUnitPlatform() }
3838

39-
tasks.withType<KotlinCompile> {
39+
tasks.withType<KotlinCompile>().configureEach {
4040
kotlinOptions {
4141
freeCompilerArgs = listOf("-Xjsr305=strict")
4242
jvmTarget = JavaVersion.VERSION_1_8.toString()

examples/multi-module-sample/spring-boot-in-multi-module-sample2/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ dependencies {
3434
}
3535
}
3636

37-
tasks.withType<Test> { useJUnitPlatform() }
37+
tasks.withType<Test>().configureEach { useJUnitPlatform() }
3838

39-
tasks.withType<KotlinCompile> {
39+
tasks.withType<KotlinCompile>().configureEach {
4040
kotlinOptions {
4141
freeCompilerArgs = listOf("-Xjsr305=strict")
4242
jvmTarget = JavaVersion.VERSION_1_8.toString()

examples/spring-boot-sample/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ dependencies {
3434
}
3535
}
3636

37-
tasks.withType<Test> { useJUnitPlatform() }
37+
tasks.withType<Test>().configureEach { useJUnitPlatform() }
3838

39-
tasks.withType<KotlinCompile> {
39+
tasks.withType<KotlinCompile>().configureEach {
4040
kotlinOptions {
4141
freeCompilerArgs = listOf("-Xjsr305=strict")
4242
jvmTarget = JavaVersion.VERSION_1_8.toString()

plugin-build/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,12 +189,12 @@ gradlePlugin {
189189
}
190190
}
191191

192-
tasks.withType<Jar> {
192+
tasks.withType<Jar>().configureEach {
193193
from(agp70.output)
194194
from(agp74.output)
195195
}
196196

197-
tasks.withType<ShadowJar> {
197+
tasks.withType<ShadowJar>().configureEach {
198198
archiveClassifier.set("")
199199
configurations = listOf(project.configurations.getByName("shade"))
200200

@@ -244,7 +244,7 @@ tasks.named("distZip") {
244244
onlyIf { inputs.sourceFiles.isEmpty.not().also { require(it) { "No distribution to zip." } } }
245245
}
246246

247-
tasks.withType<Test> {
247+
tasks.withType<Test>().configureEach {
248248
testLogging {
249249
events = setOf(TestLogEvent.SKIPPED, TestLogEvent.PASSED, TestLogEvent.FAILED)
250250
showStandardStreams = true

sentry-kotlin-compiler-plugin/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ plugins.withId("com.vanniktech.maven.publish.base") {
7272
}
7373
}
7474

75-
tasks.withType<Jar> {
75+
tasks.withType<Jar>().configureEach {
7676
from(kotlin1920.output)
7777
from(kotlin2120.output)
7878
}

0 commit comments

Comments
 (0)