A separate Gradle project with Spine Compiler plugins that generate
MessageField,
MessageOneof,
and MessageDef
implementations for Proto messages. Also, some other useful Kotlin extensions are generated,
e.g. ValidatingBuilder.messageDef() that returns the instance of MessageDef implementation
for the current message builder.
The separate Gradle project is needed because the Spine Compiler plugins,
which generate the code, require the newer version of Gradle, 9.4.x at the moment,
and Java 17, comparing to Chords-based projects, which require Gradle version 6.9.x and Java 11.
- Java 17
- Gradle
9.4.x - Kotlin
2.4.10
The Chords Gradle plugin
should be used to apply codegen-plugins to a project.
The workspace exports only Chords *Def.kt files. Consumers generate Protobuf Java and
Kotlin DSL files with their configured Protobuf compiler.
The following files are copied to the resources/codegen-workspace folder during the build:
buildSrcfolder.- Gradle wrapper files.
These resources will be packaged into the resulting jar and then used by the Gradle plugin to create a placeholder module for code generation.
This is necessary for the following reasons:
- The Gradle plugin may not keep another copy of these files.
- There is no need to synchronize dependencies between
codegen-pluginsproject and the Gradle plugin.
- codegen-plugins — the Spine Compiler plugins generating the code.