Skip to content

Commit fe50950

Browse files
authored
Use configureEach (#129)
Co-authored-by: hfhbd <[email protected]>
1 parent bea0c95 commit fe50950

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

.github/workflows/CD.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
with:
2020
distribution: 'adopt'
2121
java-version: 17
22+
- uses: gradle/gradle-build-action@v2
2223
- run: brew install libpq
2324
- name: Build with Gradle
2425
run: ./gradlew assemble

build-logic/src/main/kotlin/publish.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ publishing {
1818
credentials(PasswordCredentials::class)
1919
}
2020
}
21-
publications.all {
21+
publications.configureEach {
2222
this as MavenPublication
2323
artifact(emptyJar) {
2424
classifier = "javadoc"

postgres-native-sqldelight-dialect/build.gradle.kts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ dependencies {
4343
kotlin {
4444
jvmToolchain(11)
4545

46-
target.compilations.all {
46+
target.compilations.configureEach {
4747
kotlinOptions.allWarningsAsErrors = true
4848
}
4949
explicitApi()
5050
sourceSets {
51-
all {
51+
configureEach {
5252
languageSettings.progressiveMode = true
5353
}
5454
}
@@ -62,7 +62,7 @@ tasks.shadowJar {
6262
include("META-INF/services/*")
6363
}
6464

65-
tasks.jar.configure {
65+
tasks.jar {
6666
// Prevents shadowJar (with classifier = '') and this task from writing to the same path.
6767
enabled = false
6868
}
@@ -72,10 +72,10 @@ configurations {
7272
it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(tasks.jar.get()) }
7373
it.outgoing.artifact(tasks.shadowJar)
7474
}
75-
apiElements.configure {
75+
apiElements {
7676
conf(this)
7777
}
78-
runtimeElements.configure { conf(this) }
78+
runtimeElements { conf(this) }
7979
}
8080

8181
artifacts {
@@ -84,14 +84,14 @@ artifacts {
8484
}
8585

8686
// Disable Gradle module.json as it lists wrong dependencies
87-
tasks.withType<GenerateModuleMetadata> {
87+
tasks.withType<GenerateModuleMetadata>().configureEach {
8888
enabled = false
8989
}
9090

9191
// Remove dependencies from POM: uber jar has no dependencies
9292
publishing {
9393
publications {
94-
withType<MavenPublication> {
94+
withType<MavenPublication>().configureEach {
9595
if (name == "pluginMaven") {
9696
pom.withXml {
9797
val pomNode = asNode()
@@ -106,7 +106,7 @@ publishing {
106106
classifier = "sources"
107107
}
108108
}
109-
create("shadow", MavenPublication::class.java) {
109+
register<MavenPublication>("shadow") {
110110
project.shadow.component(this)
111111
}
112112
}

postgres-native-sqldelight-driver/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ plugins {
1010
kotlin {
1111
explicitApi()
1212
sourceSets {
13-
all {
13+
configureEach {
1414
languageSettings.progressiveMode = true
1515
}
1616
}
1717

1818
fun KotlinNativeTarget.config() {
19-
compilations.getByName("main") {
19+
compilations.named("main") {
2020
cinterops {
21-
val libpq by creating {
21+
register("libpq") {
2222
defFile(project.file("src/nativeInterop/cinterop/libpq.def"))
2323
}
2424
}

0 commit comments

Comments
 (0)