Tool Chain

Gradle Wire

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.

What It Is

It compiles and validates the protobuf contract module, then produces the generated output needed by downstream modules.

Why It Matters

wire is the point where the contract becomes buildable project metadata. If the proto layer is wrong, everything downstream is wrong.

How It Fits

Basic plugin setup

Groovy
plugins {
  id "java-library"
  alias(libs.plugins.hopeWire)
}

hopeWire {
  keepProto = false
  verbose = false
}

Typical hopeWire options

OptionPurpose
verboseprint detailed execution logs
keepProtopackage compiled proto artifacts with output
generatedVersionadd plugin version to @Generated metadata
generatedTimeadd generation time to @Generated metadata
restrictcontrol implicit conversion behavior

Key hope-wire.json fields

FieldPurpose
packageNameJava package root for the module
nameproto module name
applicationmatching application module
moduleruntime service locator key
domaindomain identifier
persistence.identifyTypeidentity field strategy
persistence.tenantTypetenant field strategy
authority.enumClasspermission enum used by the module
authority.codePrefixpermission code range prefix

Run It

Build everything:

Terminal
gradlew clean build -x test -x wireTest -x stubTest

Build one proto module:

Terminal
gradlew {YOUR_MODULE}:clean wire build -x test -x wireTest

Next Step

After wire succeeds, move to Gradle Stub to generate the application-side scaffolding.

Copyright © 2026 ApiHug·AI-native Enterprise Architecture Factory