From b525f3ea4cec889a121c9c9664a648199e1e1b7c Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 16 Jun 2026 21:14:14 +0000 Subject: [PATCH 1/2] fix(deps): update spotlessplugin to v8.7.0 --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 0de53fe5..2b3de8fe 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -19,7 +19,7 @@ protobuf3 = "4.35.1" protobufPlugin = "0.10.0" shadowPlugin = "9.4.2" slf4j = "1.7.36" -spotlessPlugin = "8.6.0" +spotlessPlugin = "8.7.0" [bundles] # Bundles serve two purposes: From 7d7e89e6cdf86f602e44a1c9fdf18b136cee3524 Mon Sep 17 00:00:00 2001 From: Robert Stupp Date: Wed, 17 Jun 2026 09:18:58 +0200 Subject: [PATCH 2/2] spotless apply --- build.gradle.kts | 15 +- buildSrc/src/main/kotlin/CodeCoverage.kt | 39 +- .../src/main/kotlin/ProtobufHelperPlugin.kt | 11 +- .../src/main/kotlin/PublishingHelperPlugin.kt | 422 +++++++++--------- 4 files changed, 241 insertions(+), 246 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index afb09feb..3b350254 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -72,15 +72,14 @@ val buildToolIntegrationMaven by commandLine("./mvnw", "clean", "package", "-Dcel.version=${project.version}") } -val buildToolIntegrations by - tasks.registering { - group = "Verification" - description = - "Checks whether bom works fine with build tools, requires preceding publishToMavenLocal in a separate Gradle invocation" +val buildToolIntegrations by tasks.registering { + group = "Verification" + description = + "Checks whether bom works fine with build tools, requires preceding publishToMavenLocal in a separate Gradle invocation" - dependsOn(buildToolIntegrationGradle) - dependsOn(buildToolIntegrationMaven) - } + dependsOn(buildToolIntegrationGradle) + dependsOn(buildToolIntegrationMaven) +} publishingHelper { nessieRepoName.set("cel-java") diff --git a/buildSrc/src/main/kotlin/CodeCoverage.kt b/buildSrc/src/main/kotlin/CodeCoverage.kt index 391efa7a..04373d87 100644 --- a/buildSrc/src/main/kotlin/CodeCoverage.kt +++ b/buildSrc/src/main/kotlin/CodeCoverage.kt @@ -27,32 +27,31 @@ import org.gradle.testing.jacoco.plugins.JacocoTaskExtension import org.gradle.testing.jacoco.tasks.JacocoReport class CelCodeCoveragePlugin : Plugin { - override fun apply(project: Project): Unit = - project.run { - apply() - apply() + override fun apply(project: Project): Unit = project.run { + apply() + apply() - tasks.withType().configureEach { - reports { - html.required.set(true) - xml.required.set(true) - } + tasks.withType().configureEach { + reports { + html.required.set(true) + xml.required.set(true) } + } - configure { toolVersion = libsRequiredVersion("jacoco") } + configure { toolVersion = libsRequiredVersion("jacoco") } - if (plugins.hasPlugin("io.quarkus")) { - tasks.named("classes") { dependsOn(tasks.named("compileQuarkusGeneratedSourcesJava")) } + if (plugins.hasPlugin("io.quarkus")) { + tasks.named("classes") { dependsOn(tasks.named("compileQuarkusGeneratedSourcesJava")) } - tasks.withType().configureEach { - extensions.configure(JacocoTaskExtension::class.java) { - val excluded = excludeClassLoaders - excludeClassLoaders = - listOf("*QuarkusClassLoader") + (if (excluded != null) excluded else emptyList()) - } - systemProperty("quarkus.jacoco.report", "false") - systemProperty("quarkus.jacoco.reuse-data-file", "true") + tasks.withType().configureEach { + extensions.configure(JacocoTaskExtension::class.java) { + val excluded = excludeClassLoaders + excludeClassLoaders = + listOf("*QuarkusClassLoader") + (if (excluded != null) excluded else emptyList()) } + systemProperty("quarkus.jacoco.report", "false") + systemProperty("quarkus.jacoco.reuse-data-file", "true") } } + } } diff --git a/buildSrc/src/main/kotlin/ProtobufHelperPlugin.kt b/buildSrc/src/main/kotlin/ProtobufHelperPlugin.kt index 8f995277..8f7539ab 100644 --- a/buildSrc/src/main/kotlin/ProtobufHelperPlugin.kt +++ b/buildSrc/src/main/kotlin/ProtobufHelperPlugin.kt @@ -24,12 +24,11 @@ import org.gradle.kotlin.dsl.withType /** Makes the generated sources available to IDEs, disables Checkstyle on generated code. */ @Suppress("unused") class ProtobufHelperPlugin : Plugin { - override fun apply(project: Project): Unit = - project.run { - apply() + override fun apply(project: Project): Unit = project.run { + apply() - tasks.withType(ProtobufExtract::class.java).configureEach { - dependsOn(tasks.named("processJandexIndex")) - } + tasks.withType(ProtobufExtract::class.java).configureEach { + dependsOn(tasks.named("processJandexIndex")) } + } } diff --git a/buildSrc/src/main/kotlin/PublishingHelperPlugin.kt b/buildSrc/src/main/kotlin/PublishingHelperPlugin.kt index 1f7317ba..141549d6 100644 --- a/buildSrc/src/main/kotlin/PublishingHelperPlugin.kt +++ b/buildSrc/src/main/kotlin/PublishingHelperPlugin.kt @@ -51,152 +51,150 @@ import org.gradle.plugins.signing.SigningPlugin class PublishingHelperPlugin @Inject constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Plugin { - override fun apply(project: Project): Unit = - project.run { - extensions.create("publishingHelper", PublishingHelperExtension::class.java, this) + override fun apply(project: Project): Unit = project.run { + extensions.create("publishingHelper", PublishingHelperExtension::class.java, this) - apply(plugin = "maven-publish") - apply(plugin = "signing") + apply(plugin = "maven-publish") + apply(plugin = "signing") - plugins.withId("publishing") { - configure { - publications { - register("maven") { - val mavenPublication = this - afterEvaluate { - // This MUST happen in an 'afterEvaluate' to ensure that the Shadow*Plugin has - // been applied. - if (project.plugins.hasPlugin(ShadowPlugin::class.java)) { - configureShadowPublishing(project, mavenPublication, softwareComponentFactory) - } else { - val component = - components.firstOrNull { c -> c.name == "javaPlatform" || c.name == "java" } - if (component is AdhocComponentWithVariants) { - listOf("testFixturesApiElements", "testFixturesRuntimeElements").forEach { cfg - -> - configurations.findByName(cfg)?.apply { - component.addVariantsFromConfiguration(this) { skip() } - } + plugins.withId("publishing") { + configure { + publications { + register("maven") { + val mavenPublication = this + afterEvaluate { + // This MUST happen in an 'afterEvaluate' to ensure that the Shadow*Plugin has + // been applied. + if (project.plugins.hasPlugin(ShadowPlugin::class.java)) { + configureShadowPublishing(project, mavenPublication, softwareComponentFactory) + } else { + val component = components.firstOrNull { c -> + c.name == "javaPlatform" || c.name == "java" + } + if (component is AdhocComponentWithVariants) { + listOf("testFixturesApiElements", "testFixturesRuntimeElements").forEach { cfg -> + configurations.findByName(cfg)?.apply { + component.addVariantsFromConfiguration(this) { skip() } } } - from(component) } - suppressPomMetadataWarningsFor("testApiElements") - suppressPomMetadataWarningsFor("testJavadocElements") - suppressPomMetadataWarningsFor("testRuntimeElements") - suppressPomMetadataWarningsFor("testSourcesElements") - suppressPomMetadataWarningsFor("testFixturesApiElements") - suppressPomMetadataWarningsFor("testFixturesRuntimeElements") + from(component) } + suppressPomMetadataWarningsFor("testApiElements") + suppressPomMetadataWarningsFor("testJavadocElements") + suppressPomMetadataWarningsFor("testRuntimeElements") + suppressPomMetadataWarningsFor("testSourcesElements") + suppressPomMetadataWarningsFor("testFixturesApiElements") + suppressPomMetadataWarningsFor("testFixturesRuntimeElements") + } - groupId = "$group" - version = project.version.toString() + groupId = "$group" + version = project.version.toString() - tasks.named("generatePomFileForMavenPublication") { - val e = project.extensions.getByType(PublishingHelperExtension::class.java) + tasks.named("generatePomFileForMavenPublication") { + val e = project.extensions.getByType(PublishingHelperExtension::class.java) - pom { - name.set( - project.provider { - if (project.extra.has("maven.name")) { - project.extra["maven.name"].toString() - } else { - project.name - } + pom { + name.set( + project.provider { + if (project.extra.has("maven.name")) { + project.extra["maven.name"].toString() + } else { + project.name } - ) - description.set(project.description) - if (project != rootProject) { - withXml { - val projectNode = asNode() + } + ) + description.set(project.description) + if (project != rootProject) { + withXml { + val projectNode = asNode() - val parentNode = projectNode.appendNode("parent") - parentNode.appendNode("groupId", parent!!.group) - parentNode.appendNode("artifactId", parent!!.name) - parentNode.appendNode("version", parent!!.version) + val parentNode = projectNode.appendNode("parent") + parentNode.appendNode("groupId", parent!!.group) + parentNode.appendNode("artifactId", parent!!.name) + parentNode.appendNode("version", parent!!.version) - addMissingMandatoryDependencyVersions(projectNode) - } - } else { - val nessieRepoName = e.nessieRepoName.get() + addMissingMandatoryDependencyVersions(projectNode) + } + } else { + val nessieRepoName = e.nessieRepoName.get() - inputs - .file(rootProject.file("gradle/developers.csv")) - .withPathSensitivity(PathSensitivity.RELATIVE) - inputs - .file(rootProject.file("gradle/contributors.csv")) - .withPathSensitivity(PathSensitivity.RELATIVE) - doFirst { - inceptionYear.set(e.inceptionYear.get()) - url.set("https://github.com/projectnessie/$nessieRepoName") - organization { - name.set("Project Nessie") - url.set("https://projectnessie.org") + inputs + .file(rootProject.file("gradle/developers.csv")) + .withPathSensitivity(PathSensitivity.RELATIVE) + inputs + .file(rootProject.file("gradle/contributors.csv")) + .withPathSensitivity(PathSensitivity.RELATIVE) + doFirst { + inceptionYear.set(e.inceptionYear.get()) + url.set("https://github.com/projectnessie/$nessieRepoName") + organization { + name.set("Project Nessie") + url.set("https://projectnessie.org") + } + licenses { + license { + name.set("The Apache License, Version 2.0") + url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") } - licenses { - license { - name.set("The Apache License, Version 2.0") - url.set("https://www.apache.org/licenses/LICENSE-2.0.txt") - } + } + mailingLists { + mailingList { + name.set("Project Nessie List") + subscribe.set("projectnessie-subscribe@googlegroups.com") + unsubscribe.set("projectnessie-unsubscribe@googlegroups.com") + post.set("projectnessie@googlegroups.com") + archive.set("https://groups.google.com/g/projectnessie") } - mailingLists { - mailingList { - name.set("Project Nessie List") - subscribe.set("projectnessie-subscribe@googlegroups.com") - unsubscribe.set("projectnessie-unsubscribe@googlegroups.com") - post.set("projectnessie@googlegroups.com") - archive.set("https://groups.google.com/g/projectnessie") + } + scm { + connection.set("scm:git:https://github.com/projectnessie/$nessieRepoName") + developerConnection.set( + "scm:git:https://github.com/projectnessie/$nessieRepoName" + ) + url.set("https://github.com/projectnessie/$nessieRepoName/tree/main") + tag.set("main") + } + issueManagement { + system.set("Github") + url.set("https://github.com/projectnessie/$nessieRepoName/issues") + } + developers { + file(rootProject.file("gradle/developers.csv")) + .readLines() + .map { line -> line.trim() } + .filter { line -> line.isNotEmpty() && !line.startsWith("#") } + .forEach { line -> + val args = line.split(",") + if (args.size < 3) { + throw GradleException( + "gradle/developers.csv contains invalid line '${line}'" + ) + } + developer { + id.set(args[0]) + name.set(args[1]) + url.set(args[2]) + } } - } - scm { - connection.set("scm:git:https://github.com/projectnessie/$nessieRepoName") - developerConnection.set( - "scm:git:https://github.com/projectnessie/$nessieRepoName" - ) - url.set("https://github.com/projectnessie/$nessieRepoName/tree/main") - tag.set("main") - } - issueManagement { - system.set("Github") - url.set("https://github.com/projectnessie/$nessieRepoName/issues") - } - developers { - file(rootProject.file("gradle/developers.csv")) - .readLines() - .map { line -> line.trim() } - .filter { line -> line.isNotEmpty() && !line.startsWith("#") } - .forEach { line -> - val args = line.split(",") - if (args.size < 3) { - throw GradleException( - "gradle/developers.csv contains invalid line '${line}'" - ) - } - developer { - id.set(args[0]) - name.set(args[1]) - url.set(args[2]) - } + } + contributors { + file(rootProject.file("gradle/contributors.csv")) + .readLines() + .map { line -> line.trim() } + .filter { line -> line.isNotEmpty() && !line.startsWith("#") } + .forEach { line -> + val args = line.split(",") + if (args.size > 2) { + throw GradleException( + "gradle/contributors.csv contains invalid line '${line}'" + ) } - } - contributors { - file(rootProject.file("gradle/contributors.csv")) - .readLines() - .map { line -> line.trim() } - .filter { line -> line.isNotEmpty() && !line.startsWith("#") } - .forEach { line -> - val args = line.split(",") - if (args.size > 2) { - throw GradleException( - "gradle/contributors.csv contains invalid line '${line}'" - ) - } - contributor { - name.set(args[0]) - url.set(args[1]) - } + contributor { + name.set(args[0]) + url.set(args[1]) } - } + } } } } @@ -205,30 +203,31 @@ constructor(private val softwareComponentFactory: SoftwareComponentFactory) : Pl } } } + } - // Gradle complains when a Gradle module metadata ("pom on steroids") is generated with an - // enforcedPlatform() dependency - but Quarkus requires enforcedPlatform(), so we have to - // allow it. - tasks.withType().configureEach { - suppressedValidationErrors.add("enforced-platform") - } + // Gradle complains when a Gradle module metadata ("pom on steroids") is generated with an + // enforcedPlatform() dependency - but Quarkus requires enforcedPlatform(), so we have to + // allow it. + tasks.withType().configureEach { + suppressedValidationErrors.add("enforced-platform") + } - if (project.hasProperty("release")) { - plugins.withType().configureEach { - configure { - val signingKey: String? by project - val signingPassword: String? by project - useInMemoryPgpKeys(signingKey, signingPassword) - val publishing = project.extensions.getByType(PublishingExtension::class.java) - afterEvaluate { sign(publishing.publications.getByName("maven")) } + if (project.hasProperty("release")) { + plugins.withType().configureEach { + configure { + val signingKey: String? by project + val signingPassword: String? by project + useInMemoryPgpKeys(signingKey, signingPassword) + val publishing = project.extensions.getByType(PublishingExtension::class.java) + afterEvaluate { sign(publishing.publications.getByName("maven")) } - if (project.hasProperty("useGpgAgent")) { - useGpgCmd() - } + if (project.hasProperty("useGpgAgent")) { + useGpgCmd() } } } } + } /** * Scans the generated pom.xml for `` in `` that do not have a @@ -289,84 +288,83 @@ internal fun configureShadowPublishing( project: Project, mavenPublication: MavenPublication, softwareComponentFactory: SoftwareComponentFactory, -) = - project.run { - fun isPublishable(element: ConfigurationVariant): Boolean { - for (artifact in element.artifacts) { - if (JavaBasePlugin.UNPUBLISHABLE_VARIANT_ARTIFACTS.contains(artifact.type)) { - return false - } +) = project.run { + fun isPublishable(element: ConfigurationVariant): Boolean { + for (artifact in element.artifacts) { + if (JavaBasePlugin.UNPUBLISHABLE_VARIANT_ARTIFACTS.contains(artifact.type)) { + return false } - return true } + return true + } - val shadowJar = project.tasks.named("shadowJar") + val shadowJar = project.tasks.named("shadowJar") - val shadowApiElements = - project.configurations.create("shadowApiElements") { - isCanBeConsumed = true - isCanBeResolved = false - attributes { - attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, Usage.JAVA_API)) - attribute( - Category.CATEGORY_ATTRIBUTE, - project.objects.named(Category::class.java, Category.LIBRARY), - ) - attribute( - LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, - project.objects.named(LibraryElements::class.java, LibraryElements.JAR), - ) - attribute( - Bundling.BUNDLING_ATTRIBUTE, - project.objects.named(Bundling::class.java, Bundling.SHADOWED), - ) - } - outgoing.artifact(shadowJar) + val shadowApiElements = + project.configurations.create("shadowApiElements") { + isCanBeConsumed = true + isCanBeResolved = false + attributes { + attribute(Usage.USAGE_ATTRIBUTE, project.objects.named(Usage::class.java, Usage.JAVA_API)) + attribute( + Category.CATEGORY_ATTRIBUTE, + project.objects.named(Category::class.java, Category.LIBRARY), + ) + attribute( + LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, + project.objects.named(LibraryElements::class.java, LibraryElements.JAR), + ) + attribute( + Bundling.BUNDLING_ATTRIBUTE, + project.objects.named(Bundling::class.java, Bundling.SHADOWED), + ) } + outgoing.artifact(shadowJar) + } - val component = softwareComponentFactory.adhoc("shadow") - component.addVariantsFromConfiguration(shadowApiElements) { - if (isPublishable(configurationVariant)) { - mapToMavenScope("compile") - } else { - skip() - } + val component = softwareComponentFactory.adhoc("shadow") + component.addVariantsFromConfiguration(shadowApiElements) { + if (isPublishable(configurationVariant)) { + mapToMavenScope("compile") + } else { + skip() } - // component.addVariantsFromConfiguration(configurations.getByName("runtimeElements")) { - component.addVariantsFromConfiguration( - project.configurations.getByName("shadowRuntimeElements") - ) { - if (isPublishable(configurationVariant)) { - mapToMavenScope("runtime") - } else { - skip() - } + } + // component.addVariantsFromConfiguration(configurations.getByName("runtimeElements")) { + component.addVariantsFromConfiguration( + project.configurations.getByName("shadowRuntimeElements") + ) { + if (isPublishable(configurationVariant)) { + mapToMavenScope("runtime") + } else { + skip() } - // Sonatype requires the javadoc and sources jar to be present, but the - // Shadow extension does not publish those. - component.addVariantsFromConfiguration(project.configurations.getByName("javadocElements")) {} - component.addVariantsFromConfiguration(project.configurations.getByName("sourcesElements")) {} - mavenPublication.from(component) + } + // Sonatype requires the javadoc and sources jar to be present, but the + // Shadow extension does not publish those. + component.addVariantsFromConfiguration(project.configurations.getByName("javadocElements")) {} + component.addVariantsFromConfiguration(project.configurations.getByName("sourcesElements")) {} + mavenPublication.from(component) - // This a replacement to add dependencies to the pom, if necessary. Equivalent to - // 'shadowExtension.component(mavenPublication)', which we cannot use. + // This a replacement to add dependencies to the pom, if necessary. Equivalent to + // 'shadowExtension.component(mavenPublication)', which we cannot use. - mavenPublication.pom { - withXml { - val node = asNode() - val depNode = node.get("dependencies") - val dependenciesNode = - if ((depNode as NodeList).isNotEmpty()) depNode[0] as Node - else node.appendNode("dependencies") - project.configurations.getByName("shadow").allDependencies.forEach { - if (it is ProjectDependency) { - val dependencyNode = dependenciesNode.appendNode("dependency") - dependencyNode.appendNode("groupId", it.group) - dependencyNode.appendNode("artifactId", it.name) - dependencyNode.appendNode("version", it.version) - dependencyNode.appendNode("scope", "runtime") - } + mavenPublication.pom { + withXml { + val node = asNode() + val depNode = node.get("dependencies") + val dependenciesNode = + if ((depNode as NodeList).isNotEmpty()) depNode[0] as Node + else node.appendNode("dependencies") + project.configurations.getByName("shadow").allDependencies.forEach { + if (it is ProjectDependency) { + val dependencyNode = dependenciesNode.appendNode("dependency") + dependencyNode.appendNode("groupId", it.group) + dependencyNode.appendNode("artifactId", it.name) + dependencyNode.appendNode("version", it.version) + dependencyNode.appendNode("scope", "runtime") } } } } +}