Skip to content

Commit f7b2ce3

Browse files
committed
build: update & reconfigure version plugin
1 parent 37a1d94 commit f7b2ce3

5 files changed

Lines changed: 59 additions & 56 deletions

File tree

‎build-logic/src/main/kotlin/openapiparser.library.gradle.kts‎

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
1-
import com.github.benmanes.gradle.versions.reporter.PlainTextReporter
2-
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
3-
import org.gradle.accessors.dm.LibrariesForLibs
41
import org.gradle.accessors.dm.LibrariesForBuild
5-
import org.gradle.jvm.toolchain.JavaLanguageVersion
6-
import org.gradle.kotlin.dsl.withType
2+
import org.gradle.accessors.dm.LibrariesForLibs
73

84
plugins {
95
kotlin
106
`java-library`
117
id("org.checkerframework")
12-
id("io.github.ben-manes.versions")
138
}
149

1510
// see build.gradle.kts
@@ -41,10 +36,6 @@ tasks.javadoc {
4136

4237
kotlin {
4338
jvmToolchain(build.versions.build.jdk.get().toInt())
44-
45-
compilerOptions {
46-
freeCompilerArgs.add("-Xannotation-default-target=param-property")
47-
}
4839
}
4940

5041
repositories {
@@ -79,26 +70,6 @@ configure<org.checkerframework.gradle.plugin.CheckerFrameworkExtension> {
7970
)
8071
}
8172

82-
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
83-
rejectVersionIf {
84-
println("candidate: $candidate stable: ${!candidate.version.isNonStable()}")
85-
candidate.version.isNonStable()
86-
}
87-
88-
val projectPath = project.path
89-
90-
outputFormatter {
91-
exceeded.dependencies.removeIf { d -> ignore.contains("${d.group}:${d.name}") }
92-
93-
val plainTextReporter = PlainTextReporter(
94-
projectPath,
95-
revision,
96-
gradleReleaseChannel
97-
)
98-
plainTextReporter.write(System.out, this)
99-
}
100-
}
101-
10273
tasks.withType<Test>().configureEach {
10374
jvmArgs(listOf(
10475
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
@@ -115,25 +86,3 @@ tasks.withType<Test>().configureEach {
11586

11687
finalizedBy(tasks.named("jacocoTestReport"))
11788
}
118-
119-
fun String.isNonStable(): Boolean {
120-
val nonStable = listOf(
121-
".M[0-9]+$",
122-
".RC[0-9]*$",
123-
".alpha.?[0-9]+$",
124-
".beta.?[0-9]+$",
125-
)
126-
127-
for (n in nonStable) {
128-
if (this.contains("(?i)$n".toRegex())) {
129-
//println("not stable: $this")
130-
return true
131-
}
132-
}
133-
134-
return false
135-
}
136-
137-
val ignore = listOf(
138-
"org.checkerframework:jdk8"
139-
)
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import com.github.benmanes.gradle.versions.reporter.PlainTextReporter
2+
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
3+
4+
plugins {
5+
id("io.github.ben-manes.versions")
6+
}
7+
8+
val projectPath = project.path
9+
10+
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
11+
rejectVersionIf {
12+
// println("candidate: $candidate stable: ${!candidate.version.isNonStable()}")
13+
candidate.version.isNonStable()
14+
}
15+
16+
// outputFormatter {
17+
// exceeded.dependencies.removeIf { d -> ignore.contains("${d.group}:${d.name}") }
18+
//
19+
// val plainTextReporter = PlainTextReporter(
20+
// projectPath,
21+
// revision,
22+
// gradleReleaseChannel
23+
// )
24+
// plainTextReporter.write(System.out, this)
25+
// }
26+
}
27+
28+
fun String.isNonStable(): Boolean {
29+
val nonStable = listOf(
30+
".M[0-9]+$",
31+
".RC[0-9]*$",
32+
".alpha.?[0-9]+$",
33+
".beta.?[0-9]+$",
34+
)
35+
36+
for (n in nonStable) {
37+
if (this.contains("(?i)$n".toRegex())) {
38+
//println("not stable: $this")
39+
return true
40+
}
41+
}
42+
43+
return false
44+
}
45+
46+
val ignore = listOf(
47+
"org.checkerframework:jdk8"
48+
)

‎build.gradle.kts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
alias(build.plugins.kotlin.jvm) apply false
44
alias(build.plugins.openapiprocessor.publish)
55
alias(build.plugins.openapiprocessor.bump)
6-
// alias(build.plugins.jacocolog)
6+
id("openapiparser.versions")
77
id("test-report-aggregation")
88
}
99

‎gradle/build.versions.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ build-jdk = "21"
77
test-jdk = "21"
88

99
# using the embedded kotlin version of Gradle to avoid mixed versions
10-
kotlin = "2.3.0"
10+
kotlin = "2.4.0"
1111

1212
checker = "0.6.61"
1313
jacoco = "0.8.11"
1414
jacocolog = "4.0.1"
15-
updates = "0.55.0"
15+
updates = "0.61.0"
1616

1717
[libraries]
1818
plugin-build = { module = "io.openapiprocessor:build-plugins", version.ref = "build-plugins" }

‎settings.gradle.kts‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@ dependencyResolutionManagement {
1717
}
1818

1919
plugins {
20-
id("io.github.ben-manes.versions.settings") version "0.56.0"
20+
id("io.github.ben-manes.versions.settings") version("0.61.0")
2121
}
2222

23+
//dependencyUpdates {
24+
//}
25+
26+
/*
27+
*/
28+
2329
include("openapi-parser")
2430
include("openapi-parser-bom")
2531
include("json-schema-validator")

0 commit comments

Comments
 (0)