Tool Chain/Wire
Tool Chain
Use the ApiHug wire task to validate proto modules and generate neutral contract output.
wire is the proto-side generation task in the ApiHug Gradle toolchain.
It compiles and validates the protobuf contract module, then produces the generated output needed by downstream modules.
wire is the point where the contract becomes buildable project metadata. If the proto layer is wrong, everything downstream is wrong.
plugins {
id "java-library"
alias(libs.plugins.hopeWire)
}
hopeWire {
keepProto = false
verbose = false
}
hopeWire options| Option | Purpose |
|---|---|
verbose | print detailed execution logs |
keepProto | package compiled proto artifacts with output |
generatedVersion | add plugin version to @Generated metadata |
generatedTime | add generation time to @Generated metadata |
restrict | control implicit conversion behavior |
hope-wire.json fields| Field | Purpose |
|---|---|
packageName | Java package root for the module |
name | proto module name |
application | matching application module |
module | runtime service locator key |
domain | domain identifier |
persistence.identifyType | identity field strategy |
persistence.tenantType | tenant field strategy |
authority.enumClass | permission enum used by the module |
authority.codePrefix | permission code range prefix |
Build everything:
gradlew clean build -x test -x wireTest -x stubTest
Build one proto module:
gradlew {YOUR_MODULE}:clean wire build -x test -x wireTest
After wire succeeds, move to Gradle Stub to generate the application-side scaffolding.