41d73a1이 패키지를 com.hyeonworks.grpc로 바꿨다. 소유자(2026-11-08)가 개인 도메인 이름을 공용 라이브러리에 쓰지 않기로 했다. 원래 이름 dev.caskeleton.grpc로 되돌리면 템플릿 재사용 체크리스트(「dev.caskeleton을 자기 패키지로 바꾼다」)가 파생 서비스의 라이브러리 import까지 깨뜨린다 (설계 05 NS1의 단점). 그래서 개인 도메인도 템플릿 자리표시 이름도 아닌 중립 이름 cakit을 쓴다(총괄 결정, 소유자가 맡김). - Java: com.hyeonworks.grpc → dev.cakit.grpc(폴더도 옮김) - proto: package hyeonworks.grpc.common.v1 → cakit.grpc.common.v1, 생성 Java 패키지 → cakit.grpc.common.v1.generated. proto 폴더도 Buf PACKAGE_DIRECTORY_MATCH에 맞게 옮겼다 - 시험의 가짜 서비스 이름(hyeonworks.document.v1 등)과 SpotBugs 제외의 클래스 이름, AutoConfiguration.imports 생성 Java 패키지를 dev.cakit.grpc 아래로 두지 않은 이유: 「생성 코드는 손으로 쓴 루트와 겹치지 않는다」는 규칙을 GrpcContractGeneratedCodeTest가 고정한다. 이름만 바꾸는 이 커밋에서 그 규칙까지 바꾸지 않는다. 만든 법: git mv로 폴더를 옮기고 grpc·grpc-advanced·config/spotbugs의 추적 파일에서 com.hyeonworks → dev.cakit, 그 밖의 hyeonworks → cakit(Gitea 주소 git.learn.hyeonworks.com은 제외)으로 바꾼 뒤 desktop spotlessApply(rc=0)로 import 순서만 맞췄다. 위험: proto 패키지는 wire 이름이다. 아직 배포 전이라 깨질 소비자가 없다. BREAKING CHANGE: Java 패키지 com.hyeonworks.grpc.* → dev.cakit.grpc.*, proto 패키지 hyeonworks.grpc.common.v1 → cakit.grpc.common.v1. 배포한 버전이 없어 옮길 소비자는 없다. Refs: design-docs repo-structure/05-library-repos.md 6.3절(Q3·Q4 정정은 총괄)
66 lines
2.7 KiB
Groovy
66 lines
2.7 KiB
Groovy
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 is a native binary and not a Maven
|
|
// artifact, so bufLint and bufBreaking below run scripts/buf.sh (a pinned, checksum-verified
|
|
// binary), and the root `ci` stage depends on them rather than this module's `check`: the breaking
|
|
// check reads Git history and a download, which a local module check should not need. This build
|
|
// does not re-implement Buf's 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
|
|
// (`cakit.*.generated`), which is disjoint from the hand-written `dev.cakit` 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/.*'
|
|
}
|
|
|
|
def protoSources = fileTree('src/main/proto') + files('buf.yaml')
|
|
tasks.register('bufLint', Exec) {
|
|
group = 'verification'
|
|
description = 'Runs buf lint over the Stable schema (buf.yaml).'
|
|
inputs.files(protoSources)
|
|
outputs.upToDateWhen { false }
|
|
commandLine 'bash', rootProject.file('scripts/buf.sh'), 'lint'
|
|
}
|
|
tasks.register('bufBreaking', Exec) {
|
|
group = 'verification'
|
|
description = 'Refuses a breaking change to the Stable schema against the baseline commit (scripts/buf.sh).'
|
|
inputs.files(protoSources)
|
|
outputs.upToDateWhen { false }
|
|
commandLine 'bash', rootProject.file('scripts/buf.sh'), 'breaking'
|
|
}
|