Uh oh!
There was an error while loading. Please reload this page.
Migrate off the retired tool-base artifact - #86
Conversation
Floats the shared `config` and `.agents/shared` submodules and re-applies the config-distributed files. `PalantirJavaFormat` is kept at `2.97.0`: `config` still ships `2.91.0`, and the pull would otherwise roll this repository's deliberate bump back.
`tool-base` PR #189 split the monolithic `tool-base` module into focused modules and stopped publishing `io.spine.tools:tool-base`. Source: * `io.spine.tools.code.proto.CodeGeneratorRequestWriter` moved to `io.spine.tools.proto.code`. Dependencies — `ToolBase.lib` replaced by the modules each project uses: * `api` — `code`, `kotlinCode` * `backend` — `code` * `gradle-plugin` — `code`, `fs` * `jvm` — `javaCode`, which it previously received transitively * `protoc-plugin` — `protoCode` The version-forcing blocks in `module.gradle.kts`, `tests`, and `tests/compiler-extension` list the same modules. The `spine-tool-base` substitution in `tests/compiler-extension` is dropped: the module it substituted no longer exists.
`config` ships `2.0.0-SNAPSHOT.420`. This repository deliberately moves ahead of it: `.421` is the first `tool-base` build this migration targets.
* `:jvm` exposes `java-code` via `api`. The `ReplaceWith` clauses in `JavaLangExts` point consumers at `io.spine.tools.java` declarations, so those must stay on the consumer compile classpath. `implementation` would have demoted them to runtime scope in the published POM, and neither the build nor Dokka can catch that. * `tests/compiler-extension` uses the imported `ToolBase` and `Validation` names instead of repeating the package prefix nine times, and the comment no longer credits `force` with the job `dependencySubstitution` used to do.
There was a problem hiding this comment.
Pull request overview
This PR migrates the build and source code off the retired io.spine.tools:tool-base artifact onto the split-out tool-base modules, and updates the dependency-reporting (generated pom.xml) logic to report versions actually selected by Gradle resolution in multi-project builds.
Changes:
- Replace
ToolBase.libusages with the appropriate focused modules (code,fs,java-code,kotlin-code,proto-code) across subprojects and version-forcing rules. - Update
protoc-pluginsource import to the newCodeGeneratorRequestWriterpackage and adjust dependencies accordingly. - Rework the dependency report generator to collect resolved versions per-project via dedicated tasks; add TestKit coverage and refresh generated dependency docs.
Reviewed changes
Copilot reviewed 25 out of 27 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| version.gradle.kts | Bumps published compiler version constant. |
| tests/compiler-extension/build.gradle.kts | Removes legacy substitution and forces the split ToolBase modules + validation artifacts. |
| tests/build.gradle.kts | Forces split ToolBase modules instead of the retired monolith. |
| protoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.kt | Migrates CodeGeneratorRequestWriter import to the new module/package. |
| protoc-plugin/build.gradle.kts | Depends on ToolBase.protoCode instead of ToolBase.lib. |
| jvm/build.gradle.kts | Adds explicit api(ToolBase.javaCode) dependency for consumer compile classpath needs. |
| gradle/wrapper/gradle-wrapper.properties | Updates Gradle wrapper distribution version. |
| gradle-plugin/build.gradle.kts | Splits ToolBase.lib into ToolBase.code + ToolBase.fs dependencies. |
| docs/dependencies/pom.xml | Regenerates dependency POM reflecting split ToolBase modules and updated versions. |
| docs/dependencies/dependencies.md | Regenerates dependency/license report reflecting current resolved dependency set. |
| buildSrc/src/test/kotlin/io/spine/gradle/report/pom/PomGeneratorIgTest.kt | Adds TestKit integration test for generatePom behavior in a real multi-project build. |
| buildSrc/src/test/kotlin/io/spine/gradle/report/pom/DependencyWriterSpec.kt | Updates unit tests to supply resolved versions via the new collection pathway. |
| buildSrc/src/main/kotlin/module.gradle.kts | Updates forced dependency set to the split ToolBase modules. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ResolvedVersions.kt | Introduces per-project resolved-version collection and persistence for stable reports. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomXmlWriter.kt | Threads per-project resolved-versions lookup into POM writing. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt | Registers per-project collectors and makes generatePom depend on them. |
| buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyWriter.kt | Switches dependency version selection to an injected resolved-versions provider; exposes moduleKey. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt | Bumps Validation dependency version constant. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt | Defines split ToolBase module coordinates and deprecates the retired monolith. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt | Bumps Core JVM compiler version constants. |
| buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt | Bumps compiler fallback versions used by build tooling. |
| buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.kt | Aligns Jackson “moneta” module coordinate with shared infix. |
| buildSrc/build.gradle.kts | Adds TestKit dependency and configures tests to pass buildSrc classpath to TestKit builds. |
| backend/build.gradle.kts | Replaces ToolBase.lib with ToolBase.code. |
| api/build.gradle.kts | Replaces ToolBase.lib with ToolBase.code + ToolBase.kotlinCode. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Uh oh!
There was an error while loading. Please reload this page.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@## master #86 +/- ##
=========================================
Coverage 76.89% 76.89% Complexity 688 688 =========================================
Files 205 205 Lines 4025 4025 Branches 402 402 =========================================
Hits 3095 3095 Misses 800 800 Partials 130 130 🚀 New features to boost your workflow:
|
Migrates this repository off the retired
io.spine.tools:tool-baseartifact ontothe focused modules that replaced it, per
tool-base#189.
Imports migrated
io.spine.tools.code.proto.CodeGeneratorRequestWriterio.spine.tools.proto.code.CodeGeneratorRequestWriterprotoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.ktThat is the only source edit. The repository was re-scanned for every other
breaking change listed in the split —
io.spine.tools.OsFamily,io.spine.tools.{div, resolve, toAbsoluteFile, isProtoSource},io.spine.tools.StandardTypes,io.spine.tools.type,Method(MethodSpec),the
io.spine.tools.java.code.{classSpec, constructorSpec, methodSpec, codeBlock}move to
.poet, and the droppedSourceSetNameparameter onGenerated.dir/SourceRoot.subDir— and none of them occur here. No code callsMoreKnownTypes, so the Base2.0.0-SNAPSHOT.441runtime guard does not apply.Dependency constants
ToolBase.libis replaced everywhere by the modules each project actually uses:apicode,kotlinCodebackendcodegradle-plugincode,fsjvmjavaCodeprotoc-pluginprotoCode:jvmdid not previously declarejava-codeat all — it received ittransitively through
api(ToolBase.lib)in:api. It is now declaredexplicitly, and as
apirather thanimplementation: theReplaceWithclauses in
JavaLangExtsdirect consumers atio.spine.tools.javadeclarations, so those must remain on the consumer compile classpath.
The version-forcing blocks list the same modules:
buildSrc/src/main/kotlin/module.gradle.kts,tests/build.gradle.kts, andtests/compiler-extension/build.gradle.kts. Thespine-tool-basedependencySubstitutionrule intests/compiler-extensionis dropped — itssubstitution target no longer exists, and nothing on the classpath requests the
legacy coordinates.
Two deliberate divergences from
configBoth are intentional; please do not "fix" them by re-running
./config/pull.ToolBase.versionis2.0.0-SNAPSHOT.421, whileconfigships.420..421is the firsttool-basebuild this migration targets. It is publishedremotely, so CI resolves it normally.
dogfoodingVersionis untouched at.410—jvm-tool-plugins-allis unaffected by the split.PalantirJavaFormatstays at2.97.0.configstill ships2.91.0, so./config/pullrolled this repository's deliberate bump (17bca07) backward.The newer value was restored.
Verification
./gradlew clean, then./gradlew build dokkaGenerate— BUILD SUCCESSFUL,including
:integrationTestand:gradle-plugin:functionalTest.grep -rn "ToolBase\.lib\|io\.spine\.tools:tool-base"over*.kt,*.kts,*.gradle— zero matches. This mattered: a stale pre-splittool-base:2.0.0-SNAPSHOT.420sits in the local Maven repository, so asurviving reference would have resolved locally and only failed on CI.
io.spine.tools:tool-baseno longer appears indocs/dependencies/pom.xmlordependencies.md; the five replacement modules resolve at2.0.0-SNAPSHOT.421, withjava-codeatcompilescope.spine-code-review,kotlin-engineer,dependency-audit, andreview-docs. The Kotlin reviewer's finding on:jvm's dependency scope isfixed in 264981c.
🤖 Generated with Claude Code