build: 템플릿 밖에서 혼자 빌드·배포되는 Gradle 루트를 만든다
옮겨 온 메시징 19개 모듈은 템플릿의 src/settings.gradle·build-logic· 카탈로그·registry에 기대고 있어 이 repo만으로는 빌드되지 않는다. repo 루트를 Gradle 루트로 하는 단독 빌드를 만든다. - build-logic/: grpc-library main 2e880c7의 줄인 사본(템플릿 22df3525에서 복사, 템플릿 2959eff0까지의 변경도 같은 내용)에서 gRPC BOM 규칙(ca.grpc-platform-module)만 뺐다. 배포 플러그인 ca.library-publishing과 서명 키 해석(SigningKeys)은 그대로다. 출처·뺀 것·고친 것은 build-logic/UPSTREAM.md. - settings.gradle·build.gradle·gradle.properties: group dev.cakit.messaging, 단계 태스크 ci·mainCheck·releaseCheck와 배포(release·releaseRehearsal·verifySigningKey)는 grpc-library와 같은 모양이다. 메시징만 다른 점: Buf가 없고, 성능 lane이 없고, mainCheck와 releaseCheck가 브로커 인증 증거 게이트 (verifyMessagingCertificationEvidence)를 부른다. 템플릿은 이 게이트를 따로 messaging-certification.yml로 돌렸다. 그 workflow는 지운다. - config/: registry 19행(source_path만 messaging/<leaf>로), 메시징 클래스만 남긴 SpotBugs 제외 목록, 이미지 셋(postgres-16, kafka, toxiproxy, 모두 digest 고정), checkstyle 사본. - gradle/libs.versions.toml: 메시징이 쓰는 항목만(avro, cloudevents, protobuf 4.33.2, toxiproxy, jmh)과 kafka-clients가 끌고 오는 취약 버전을 덮는 pinned-lz4-java·pinned-snappy-java. - 저장소 계약 테스트: MessagingPublicSurfaceContractTest(템플릿 app-bootstrap에서 이력째 옮김)와 새 MessagingSettingsOwnerContractTest (app.messaging 주인은 starter 하나)를 messaging-testkit의 repositoryContractTest lane에 둔다. check에 들어가 PR 단계에서 돈다. - messaging-kafka: 인증 manifest 경로를 새 배치로 고친다. 버린 대안: 계약 테스트를 build-logic 테스트로 두는 안. 빌드 플러그인 시험과 모듈 계약이 섞이고, 소스·build.gradle을 입력으로 선언하는 기존 lane 장치를 쓸 수 없다. 위험: 이 커밋 단독으로는 lockfile을 다시 쓰지 않았다(뒤 커밋에서 desktop에서 쓴다). 패키지는 아직 dev.caskeleton.messaging이다. 검증: desktop ./gradlew projects rc=0(19개 모듈 포함). Refs: design-docs repo-structure/05-library-repos.md 4·10.3·13.1절
This commit is contained in:
+209
@@ -0,0 +1,209 @@
|
||||
package dev.caskeleton.buildlogic.strictlane;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import org.gradle.api.Action;
|
||||
import org.gradle.api.Named;
|
||||
import org.gradle.api.tasks.testing.Test;
|
||||
|
||||
public class StrictTestLaneSpec implements Named {
|
||||
private final String name;
|
||||
private String tag;
|
||||
private String description;
|
||||
private String group;
|
||||
private String sourceSet = "test";
|
||||
private String maxHeapSize;
|
||||
private boolean rejectSkipped;
|
||||
private boolean mainStage;
|
||||
private String explicitOnlyReason;
|
||||
private TestLaneCategory category = TestLaneCategory.TEST;
|
||||
private final List<String> requiredTests = new ArrayList<>();
|
||||
private final List<String> jvmArgs = new ArrayList<>();
|
||||
private final List<String> shouldRunAfter = new ArrayList<>();
|
||||
private final List<String> dependsOn = new ArrayList<>();
|
||||
private final List<File> inputDirectories = new ArrayList<>();
|
||||
private final Map<String, String> systemProperties = new LinkedHashMap<>();
|
||||
private Action<? super Test> customize;
|
||||
|
||||
public StrictTestLaneSpec(String name) {
|
||||
this.name = Objects.requireNonNull(name, "name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public String getGroup() {
|
||||
return group;
|
||||
}
|
||||
|
||||
public void setGroup(String group) {
|
||||
this.group = group;
|
||||
}
|
||||
|
||||
public String getSourceSet() {
|
||||
return sourceSet;
|
||||
}
|
||||
|
||||
public void setSourceSet(String sourceSet) {
|
||||
this.sourceSet = sourceSet;
|
||||
}
|
||||
|
||||
public String getMaxHeapSize() {
|
||||
return maxHeapSize;
|
||||
}
|
||||
|
||||
public void setMaxHeapSize(String maxHeapSize) {
|
||||
this.maxHeapSize = maxHeapSize;
|
||||
}
|
||||
|
||||
public boolean isRejectSkipped() {
|
||||
return rejectSkipped;
|
||||
}
|
||||
|
||||
public void setRejectSkipped(boolean rejectSkipped) {
|
||||
this.rejectSkipped = rejectSkipped;
|
||||
}
|
||||
|
||||
public boolean isMainStage() {
|
||||
return mainStage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs this lane in the leaf's {@code mainCheck} instead of its {@code test}: the lane's tag is
|
||||
* excluded from {@code test}. For checks that compare a leaf with documents or registries, which
|
||||
* are not worth a pull request's wait (review 2026-09-24 BUILD-계획-B4-27).
|
||||
*/
|
||||
public void mainStage() {
|
||||
mainStage = true;
|
||||
}
|
||||
|
||||
public String getExplicitOnlyReason() {
|
||||
return explicitOnlyReason;
|
||||
}
|
||||
|
||||
/**
|
||||
* Keeps this lane out of every aggregate ({@code strictTestLaneCheck}, {@code
|
||||
* integrationTestLaneCheck}, ...): it runs only when named. For a lane that cannot pass without
|
||||
* an input the aggregate's caller does not have — protected credentials, an external topology —
|
||||
* so that the aggregate states the gap instead of failing on it (review NEW-16).
|
||||
*/
|
||||
public void explicitOnly(String reason) {
|
||||
explicitOnlyReason = Objects.requireNonNull(reason, "reason");
|
||||
}
|
||||
|
||||
public TestLaneCategory getCategory() {
|
||||
return category;
|
||||
}
|
||||
|
||||
public void setCategory(TestLaneCategory category) {
|
||||
this.category = Objects.requireNonNull(category, "category");
|
||||
}
|
||||
|
||||
public void test() {
|
||||
category = TestLaneCategory.TEST;
|
||||
}
|
||||
|
||||
public void integration() {
|
||||
category = TestLaneCategory.INTEGRATION;
|
||||
}
|
||||
|
||||
public void system() {
|
||||
category = TestLaneCategory.SYSTEM;
|
||||
}
|
||||
|
||||
public void architecture() {
|
||||
category = TestLaneCategory.ARCHITECTURE;
|
||||
}
|
||||
|
||||
/**
|
||||
* A lane whose tests are resource or latency bounds. Besides rerunning every time and taking the
|
||||
* build-wide real-server slot, it rejects skipped tests and always runs with its bounds asserted:
|
||||
* the convention sets {@code performance.assertions.enabled=true}, and a build or lane that sets
|
||||
* it to anything else fails before a test runs.
|
||||
*/
|
||||
public void performance() {
|
||||
category = TestLaneCategory.PERFORMANCE;
|
||||
}
|
||||
|
||||
public List<String> getRequiredTests() {
|
||||
return List.copyOf(requiredTests);
|
||||
}
|
||||
|
||||
public void requires(String... selectors) {
|
||||
requiredTests.addAll(List.of(selectors));
|
||||
}
|
||||
|
||||
public List<String> getJvmArgs() {
|
||||
return List.copyOf(jvmArgs);
|
||||
}
|
||||
|
||||
public void jvmArgs(String... arguments) {
|
||||
jvmArgs.addAll(List.of(arguments));
|
||||
}
|
||||
|
||||
public List<String> getShouldRunAfter() {
|
||||
return List.copyOf(shouldRunAfter);
|
||||
}
|
||||
|
||||
public void shouldRunAfter(String... taskNames) {
|
||||
shouldRunAfter.addAll(List.of(taskNames));
|
||||
}
|
||||
|
||||
public List<String> getDependsOn() {
|
||||
return List.copyOf(dependsOn);
|
||||
}
|
||||
|
||||
public void dependsOn(String... taskNames) {
|
||||
dependsOn.addAll(List.of(taskNames));
|
||||
}
|
||||
|
||||
public Map<String, String> getSystemProperties() {
|
||||
return Map.copyOf(systemProperties);
|
||||
}
|
||||
|
||||
public void systemProperty(String name, String value) {
|
||||
systemProperties.put(Objects.requireNonNull(name, "name"), Objects.requireNonNull(value, "value"));
|
||||
}
|
||||
|
||||
public List<File> getInputDirectories() {
|
||||
return List.copyOf(inputDirectories);
|
||||
}
|
||||
|
||||
public void inputDirectory(File directory) {
|
||||
inputDirectories.add(Objects.requireNonNull(directory, "directory"));
|
||||
}
|
||||
|
||||
public Action<? super Test> getCustomize() {
|
||||
return customize;
|
||||
}
|
||||
|
||||
public void setCustomize(Action<? super Test> customize) {
|
||||
this.customize = customize;
|
||||
}
|
||||
|
||||
public void customize(Action<? super Test> customize) {
|
||||
this.customize = customize;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user