Skip to content

Handle null versions in dependency reports; fix "which/that" doc grammar#693

Open
alexander-yevsyukov wants to merge 2 commits into
masterfrom
which-that
Open

Handle null versions in dependency reports; fix "which/that" doc grammar#693
alexander-yevsyukov wants to merge 2 commits into
masterfrom
which-that

Conversation

@alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Two related build-logic changes to config's buildSrc (both float to all
consumer repos via the submodule + pull):

  1. Handle null versions gracefully in the POM dependency report — a
    functional bug fix.
  2. Fix "which/that" grammar in build-logic KDoc/comments — a documentation
    pass.

1. Handle null versions in the POM dependency report

The POM dependency-report generator emitted BOM-managed coordinates (declared
without an explicit version) as the literal <version>null</version> in every
consumer repo's generated docs/dependencies/pom.xml. null is not a valid
Maven version, making the report hard to consume by tooling.

Root cause. DependencyWriter.writeXmlTo wrote
"version" { xml.text(dependency.version) } unconditionally; for a version-less
dependency dependency.version is null, and the MarkupBuilder.text helper
does value.toString(), turning null into the string "null". The data layer
already knew a null version was possible (deduplicate() guards it with
it.version ?: "") — only this emission site did not.

Fix. Emit <version> only when present, mirroring the existing conditional
for the optional <scope> element:

dependency.version?.let { version ->
    "version" { xml.text(version) }
}

A version-less dependency now omits <version> entirely — the correct Maven
representation for a dependency-managed version — instead of emitting invalid
XML. Covered by a new DependencyWriterSpec regression test
(omit the version of a dependency that declares none).

Surfaced by a Copilot review on
SpineEventEngine/compiler#69.
Pre-existing on master; not introduced by that PR. Same family as the vendored
buildSrc audit follow-ups tracked in
config#691 (fixed
directly here, since it is self-contained).

2. Fix "which/that" grammar in build-logic docs

An English wording pass across ~32 buildSrc/**/*.kt files, correcting
restrictive relative clauses ("which" → "that") in KDoc and inline comments,
plus an incidental copyright-year bump (2025 → 2026) on the touched files and
two trivial whitespace cleanups. Doc-only: no executable code changed in these
files.

🤖 Generated with Claude Code
🙌🏻 Updated by @alexander-yevsyukov

@alexander-yevsyukov alexander-yevsyukov changed the title Handle null versions in dependency reports; fix "which/that" doc grammar Handle null versions in dependency reports; fix "which/that" doc grammar Jun 15, 2026
@alexander-yevsyukov alexander-yevsyukov self-assigned this Jun 15, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates config’s shared Gradle build logic (buildSrc) to (1) avoid emitting invalid Maven XML in the generated dependency POM report when a dependency has no declared version, and (2) apply an English “which/that” grammar pass (plus minor whitespace/copyright updates) across build-logic documentation comments.

Changes:

  • Fix DependencyWriter to omit the <version> element when dependency.version is null, preventing <version>null</version> in generated POM dependency reports.
  • Add a regression test in DependencyWriterSpec to ensure version-less dependencies do not produce <version>null</version> while versioned dependencies still do.
  • Apply doc-only grammar/formatting cleanups across multiple buildSrc Kotlin sources and add an archived task note describing the work.

Reviewed changes

Copilot reviewed 36 out of 36 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyWriter.kt Omit <version> when dependency version is null while writing POM XML.
buildSrc/src/test/kotlin/io/spine/gradle/report/pom/DependencyWriterSpec.kt Add regression test covering omission of null versions in POM output.
buildSrc/src/main/kotlin/Strings.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/LicenseSettings.kt License header formatting + KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/testing/TestKitCoverage.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/RunGradle.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/report/license/ModuleDataExtensions.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/repo/Repository.kt KDoc grammar tweak + whitespace cleanup.
buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/publish/PublishingExts.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/publish/PublicationHandler.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/publish/JarDsl.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/publish/IncrementGuard.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/publish/GitHubPackages.kt KDoc grammar/copyright-year update (and touched security-relevant wording).
buildSrc/src/main/kotlin/io/spine/gradle/publish/CustomPublicationHandler.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/javascript/task/Assemble.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsExtension.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/javascript/JsEnvironment.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/javadoc/ExcludeInternalDoclet.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/java/Tasks.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/github/pages/UpdateGitHubPages.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/github/pages/TaskName.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/dart/task/IntegrationTest.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/gradle/dart/DartExtension.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/dart/DartEnvironment.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/io/spine/gradle/ConfigTester.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/dependency/lib/CommonsCli.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/io/spine/dependency/Dependency.kt KDoc grammar/copyright-year update + whitespace cleanup.
buildSrc/src/main/kotlin/io/spine/dependency/boms/BomsPlugin.kt KDoc grammar/copyright-year update.
buildSrc/src/main/kotlin/DokkaExts.kt KDoc grammar tweak.
buildSrc/src/main/kotlin/BuildExtensions.kt Comment punctuation tweak.
.agents/tasks/archive/pom-version-null.md Archived task note documenting the null-version POM fix and verification steps.

Comment thread buildSrc/src/main/kotlin/io/spine/gradle/publish/GitHubPackages.kt
@alexander-yevsyukov alexander-yevsyukov moved this to 🏗 In progress in v2.0 Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🏗 In progress

Development

Successfully merging this pull request may close these issues.

2 participants