plugins { id 'ca.platform-module' alias(libs.plugins.protobuf) } // The Stable schema: the `.proto` sources under src/main/proto and the Java that protoc generates // from them. // // protoc, not a hand-written parser, decides whether the schema is valid, and Buf (buf.yaml next to // this file) owns lint and breaking-change policy. Buf runs in CI — `.github/workflows/ // ci-quality-gates.yml` job `grpc-proto-buf` — because it is a native binary and not a Maven // artifact; this build does not re-implement its rules. Until 2026-09-28 this leaf was // grpc-proto-contract + grpc-codegen, which did both with regular expressions (owner decision 18). // // Generated code lands under build/, in the package each file's `java_package` names // (`caskeleton.*.generated`), which is disjoint from the hand-written `dev.caskeleton` root. // Messages only: the schema declares no service yet, so there is no grpc-java stub to generate. dependencies { // api: every generated message extends com.google.protobuf.GeneratedMessageV3. api libs.protobuf.java.grpc } protobuf { protoc { artifact = libs.protoc.get().toString() } } // The plugin resolves protoc through a configuration it creates when generateProto runs, after // resolveAndLockAll has taken its snapshot. The coordinate is an exact catalog version (libs.protoc), // so a lock entry would restate it; locking is switched off for that tool locator only. configurations.matching { it.name.startsWith('protobufToolsLocator_') }.configureEach { resolutionStrategy.deactivateDependencyLocking() } // Generated sources answer to protoc, not to the repository's formatter, lint or bug patterns. spotless { java { target 'src/*/java/**/*.java' } } tasks.named('checkstyleMain') { exclude '**/generated/**' } tasks.withType(JavaCompile).configureEach { options.errorprone.excludedPaths = '.*/build/generated/.*' }