Move CodeGeneratorRequestWriter to ToolBase#944
Merged
Conversation
The class is protoc-plugin tooling, not runtime API: its only consumers are the protoc-plugin entry points of the Compiler and ProtoTap. It moves to the `tool-base` module of ToolBase as `io.spine.tools.code.proto.CodeGeneratorRequestWriter`. `CodeGeneratorRequestParsingSpec` and `CodeGeneratorRequestsJavaSpec` stay because they test the `io.spine.type` parsing API, which remains in `base`. See #938
The enum encodes a code-generation file-naming convention (`commands.proto`, `events.proto`, `rejections.proto`) and its only consumer across the organisation is `CoreJvmCompilerSettings` in CoreJvmCompiler, where it now lives as `io.spine.tools.core.jvm.MessageFile`. The usages internal to `base` are refactored to do without the enum: - `FileName` now checks the conventional suffixes directly. - `FieldDeclaration.isCommandsFile()` uses `FileName.isCommands()`. The unit test moves to CoreJvmCompiler along with the enum, so `MessageFileTest` and its test-only proto file are removed here. See #941. https://claude.ai/code/session_01RoCv4qxE8c32kPMLWVKw9M
No dependency changed in this branch; the project version strings in the reports are brought in line with `2.0.0-SNAPSHOT.405`. https://claude.ai/code/session_01RoCv4qxE8c32kPMLWVKw9M
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #944 +/- ##
==========================================
- Coverage 94.06% 94.04% -0.03%
==========================================
Files 193 192 -1
Lines 4164 4149 -15
Branches 339 339
==========================================
- Hits 3917 3902 -15
Misses 147 147
Partials 100 100 🚀 New features to boost your workflow:
|
…laude/cool-lamport-rnwzpu # Conflicts: # docs/dependencies/dependencies.md # docs/dependencies/pom.xml # version.gradle.kts
MessageFile to CoreJvmCompilerMessageFile to CoreJvmCompiler and CodeGeneratorRequestWriter to ToolBase
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes compile-time/protoc-plugin tooling from the runtime base artifact by relocating MessageFile to CoreJvmCompiler and CodeGeneratorRequestWriter to ToolBase, and updates the snapshot version accordingly to reflect breaking public API removals.
Changes:
- Remove
io.spine.base.MessageFilefrombaseand refactor internal suffix checks to useFileNamedirectly. - Remove
io.spine.code.proto.CodeGeneratorRequestWriter(and its spec) frombase, as it’s protoc-plugin tooling now hosted in ToolBase. - Bump project version to
2.0.0-SNAPSHOT.410and align dependency report version strings.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
version.gradle.kts |
Bumps published snapshot version to 2.0.0-SNAPSHOT.410 (breaking change). |
docs/dependencies/pom.xml |
Aligns generated dependency POM version with the new snapshot version. |
docs/dependencies/dependencies.md |
Updates dependency report headers to the new snapshot version. |
base/src/main/java/io/spine/code/proto/FileName.java |
Removes dependency on MessageFile and inlines conventional *.proto suffix constants. |
base/src/main/java/io/spine/code/proto/FieldDeclaration.java |
Replaces MessageFile usage with FileName.from(file).isCommands(). |
base/src/main/java/io/spine/base/MessageFile.java |
Removed from runtime base API surface. |
base/src/test/java/io/spine/base/MessageFileTest.java |
Removed (test migrated to the new owning repo per PR description). |
base/src/test/proto/spine/test/base/message_file_test_events.proto |
Removed (only used by the removed MessageFileTest). |
base/src/main/kotlin/io/spine/code/proto/CodeGeneratorRequestWriter.kt |
Removed from base (moved to ToolBase per PR description). |
base/src/test/kotlin/io/spine/code/proto/CodeGeneratorRequestWriterSpec.kt |
Removed along with the moved writer. |
.agents/tasks/move-message-file-to-core-jvm-compiler.md |
Adds agent task tracking documentation for the work. |
.agents/tasks/938-move-codegen-request-writer.md |
Adds agent task tracking documentation for the work. |
This reverts commit 5201e70.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
MessageFile to CoreJvmCompiler and CodeGeneratorRequestWriter to ToolBaseCodeGeneratorRequestWriter to ToolBase
armiol
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #938.
io.spine.code.proto.CodeGeneratorRequestWriteris protoc-plugin tooling, not runtime API: its only consumers are the protoc-plugin entry points of the Compiler and ProtoTap. It moves to thetool-basemodule of ToolBase asio.spine.tools.code.proto.CodeGeneratorRequestWritervia SpineEventEngine/tool-base#181.Changes
CodeGeneratorRequestWriterand its spec frombase.2.0.0-SNAPSHOT.410(next multiple of 10 — removing public API is a breaking change).FileName.nameWithExtension()doc.Notes
CodeGeneratorRequestParsingSpecandCodeGeneratorRequestsJavaSpecstay: they test theio.spine.typeparsing API, which remains inbase, and the Java spec still uses theconstructRequesthelper declared in the Kotlin parsing spec.io.spine.code.protostays inbase(KnownTypesloads descriptor sets through it at application startup).CodeGeneratorRequestWriterfrom Base; fix plugins to work with Gradle cache; fixArtifactMetaPluginworking directory tool-base#181 first, then this PR; consumers then migrate by switching the import.History
This PR briefly also carried the
MessageFile→ CoreJvmCompiler move (#941, originally #944's own scope, with #943 merged in). That move has been reverted on this branch;io.spine.base.MessageFile, its test, and theFileName/FieldDeclarationinternals are back to theirmasterstate. The adoption in CoreJvmCompiler (SpineEventEngine/core-jvm-compiler#92) is being reverted separately.🤖 Generated with Claude Code