Skip to content

Migrate off the retired tool-base artifact - #86

Merged
alexander-yevsyukov merged 6 commits into
masterfrom
toolbase-split-migration
Aug 19, 2026
Merged

Migrate off the retired tool-base artifact#86
alexander-yevsyukov merged 6 commits into
masterfrom
toolbase-split-migration

Conversation

@alexander-yevsyukov

Copy link
Copy Markdown
Contributor

Migrates this repository off the retired io.spine.tools:tool-base artifact onto
the focused modules that replaced it, per
tool-base#189.

Imports migrated

FromToFile
io.spine.tools.code.proto.CodeGeneratorRequestWriterio.spine.tools.proto.code.CodeGeneratorRequestWriterprotoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.kt

That 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 dropped SourceSetName parameter on Generated.dir /
SourceRoot.subDir — and none of them occur here. No code calls
MoreKnownTypes, so the Base 2.0.0-SNAPSHOT.441 runtime guard does not apply.

Dependency constants

ToolBase.lib is replaced everywhere by the modules each project actually uses:

ProjectConstants
apicode, kotlinCode
backendcode
gradle-plugincode, fs
jvmjavaCode
protoc-pluginprotoCode

:jvm did not previously declare java-code at all — it received it
transitively through api(ToolBase.lib) in :api. It is now declared
explicitly, and as api rather than implementation: the ReplaceWith
clauses in JavaLangExts direct consumers at io.spine.tools.java
declarations, 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, and
tests/compiler-extension/build.gradle.kts. The spine-tool-base
dependencySubstitution rule in tests/compiler-extension is dropped — its
substitution target no longer exists, and nothing on the classpath requests the
legacy coordinates.

Two deliberate divergences from config

Both are intentional; please do not "fix" them by re-running ./config/pull.

  1. ToolBase.version is 2.0.0-SNAPSHOT.421, while config ships .420.
    .421 is the first tool-base build this migration targets. It is published
    remotely, so CI resolves it normally. dogfoodingVersion is untouched at
    .410jvm-tool-plugins-all is unaffected by the split.
  2. PalantirJavaFormat stays at 2.97.0.config still ships 2.91.0, so
    ./config/pull rolled this repository's deliberate bump (17bca07) backward.
    The newer value was restored.

Verification

  • ./gradlew clean, then ./gradlew build dokkaGenerateBUILD SUCCESSFUL,
    including :integrationTest and :gradle-plugin:functionalTest.
  • grep -rn "ToolBase\.lib\|io\.spine\.tools:tool-base" over *.kt, *.kts,
    *.gradlezero matches. This mattered: a stale pre-split
    tool-base:2.0.0-SNAPSHOT.420 sits in the local Maven repository, so a
    surviving reference would have resolved locally and only failed on CI.
  • io.spine.tools:tool-base no longer appears in docs/dependencies/pom.xml or
    dependencies.md; the five replacement modules resolve at
    2.0.0-SNAPSHOT.421, with java-code at compile scope.
  • Reviewed by spine-code-review, kotlin-engineer, dependency-audit, and
    review-docs. The Kotlin reviewer's finding on :jvm's dependency scope is
    fixed in 264981c.

🤖 Generated with Claude Code

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.
CopilotAI lite review requested due to automatic review settings August 19, 2026 18:06

CopilotAI 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 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.lib usages with the appropriate focused modules (code, fs, java-code, kotlin-code, proto-code) across subprojects and version-forcing rules.
  • Update protoc-plugin source import to the new CodeGeneratorRequestWriter package 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
FileDescription
version.gradle.ktsBumps published compiler version constant.
tests/compiler-extension/build.gradle.ktsRemoves legacy substitution and forces the split ToolBase modules + validation artifacts.
tests/build.gradle.ktsForces split ToolBase modules instead of the retired monolith.
protoc-plugin/src/main/kotlin/io/spine/tools/compiler/protoc/Plugin.ktMigrates CodeGeneratorRequestWriter import to the new module/package.
protoc-plugin/build.gradle.ktsDepends on ToolBase.protoCode instead of ToolBase.lib.
jvm/build.gradle.ktsAdds explicit api(ToolBase.javaCode) dependency for consumer compile classpath needs.
gradle/wrapper/gradle-wrapper.propertiesUpdates Gradle wrapper distribution version.
gradle-plugin/build.gradle.ktsSplits ToolBase.lib into ToolBase.code + ToolBase.fs dependencies.
docs/dependencies/pom.xmlRegenerates dependency POM reflecting split ToolBase modules and updated versions.
docs/dependencies/dependencies.mdRegenerates dependency/license report reflecting current resolved dependency set.
buildSrc/src/test/kotlin/io/spine/gradle/report/pom/PomGeneratorIgTest.ktAdds TestKit integration test for generatePom behavior in a real multi-project build.
buildSrc/src/test/kotlin/io/spine/gradle/report/pom/DependencyWriterSpec.ktUpdates unit tests to supply resolved versions via the new collection pathway.
buildSrc/src/main/kotlin/module.gradle.ktsUpdates forced dependency set to the split ToolBase modules.
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/ResolvedVersions.ktIntroduces per-project resolved-version collection and persistence for stable reports.
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomXmlWriter.ktThreads per-project resolved-versions lookup into POM writing.
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.ktRegisters per-project collectors and makes generatePom depend on them.
buildSrc/src/main/kotlin/io/spine/gradle/report/pom/DependencyWriter.ktSwitches dependency version selection to an injected resolved-versions provider; exposes moduleKey.
buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.ktBumps Validation dependency version constant.
buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.ktDefines split ToolBase module coordinates and deprecates the retired monolith.
buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.ktBumps Core JVM compiler version constants.
buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.ktBumps compiler fallback versions used by build tooling.
buildSrc/src/main/kotlin/io/spine/dependency/lib/Jackson.ktAligns Jackson “moneta” module coordinate with shared infix.
buildSrc/build.gradle.ktsAdds TestKit dependency and configures tests to pass buildSrc classpath to TestKit builds.
backend/build.gradle.ktsReplaces ToolBase.lib with ToolBase.code.
api/build.gradle.ktsReplaces 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.

Comment threadbuildSrc/build.gradle.kts
@codecov

codecovBot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.89%. Comparing base (1e6d1c2) to head (264981c).

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:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@alexander-yevsyukovalexander-yevsyukov moved this to 🏗 In progress in v2.0Aug 19, 2026
@alexander-yevsyukovalexander-yevsyukov moved this from 🏗 In progress to In Review in v2.0Aug 19, 2026
@alexander-yevsyukov
alexander-yevsyukov merged commit 85302f2 into masterAug 19, 2026
11 checks passed
@alexander-yevsyukov
alexander-yevsyukov deleted the toolbase-split-migration branch August 19, 2026 19:19
@github-project-automationgithub-project-automationBot moved this from In Review to ✅ Done in v2.0Aug 19, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants

@alexander-yevsyukov@armiol