diff --git a/build-logic/UPSTREAM.md b/build-logic/UPSTREAM.md index 1dbe611..011e6b5 100644 --- a/build-logic/UPSTREAM.md +++ b/build-logic/UPSTREAM.md @@ -25,6 +25,7 @@ | `java/JavaConventionsPlugin` | `group`을 `gradle.properties`의 `libraryGroup`에서 읽는다(템플릿은 `dev.caskeleton` 고정). 버전은 `RELEASE_TAG`/`-PreleaseTag`(`vX.Y.Z`)에서도 읽는다. 이미지 목록·도구 설정은 루트의 `config/`만 본다 | | `quality/QualityConventionsPlugin` | 도구 설정은 루트의 `config/`만 본다 | | `convention/PlatformModuleConventionPlugin` | `ca.library-publishing`을 함께 켠다 | +| `ModuleRegistry` | registry 행의 `build` 칸을 거절한다. main이 아닌 값(오타 포함)이면 그 모듈이 조용히 빌드에서 빠졌다. 템플릿 `91804ec1` 뒤 브랜치 `claude/x2-grpc-library-43dd09`에 같은 수정이 있다 | | `strictlane/StrictLaneStagesPlugin` | 단계의 계획을 따라갈 때 included build 태스크(`ci`가 부르는 build-logic `test`)는 묻지 않는다. 템플릿 `ci`에는 그런 의존이 없어 드러나지 않았다. 템플릿에도 옮길 만한 수정이다 | | 새 `publishing/LibraryPublishingPlugin`(`ca.library-publishing`) | 모듈마다 Maven publication(sources·javadoc jar, 해석된 버전), 저장소 `gitea`·`staging`, `SIGNING_KEY`가 있으면 PGP 서명 | | 테스트 fixture | `source_path`를 Gradle 루트 기준으로, `PlatformModuleConventionTest`에 `libraryGroup` | diff --git a/build-logic/src/main/java/dev/caskeleton/buildlogic/ModuleRegistry.java b/build-logic/src/main/java/dev/caskeleton/buildlogic/ModuleRegistry.java index a917abb..4c292bf 100644 --- a/build-logic/src/main/java/dev/caskeleton/buildlogic/ModuleRegistry.java +++ b/build-logic/src/main/java/dev/caskeleton/buildlogic/ModuleRegistry.java @@ -108,7 +108,16 @@ public record ModuleRegistry(List modules, File source) { String id = requireNonBlankText(module, "id", index); String gradlePath = requireNonBlankText(module, "gradle_path", index); String sourcePath = requireNonBlankText(module, "source_path", index); - String buildName = module.has("build") ? requireNonBlankText(module, "build", id) : "main"; + // Every module belongs to the one build. A row naming any other build (a typo included) would + // be included by no settings and checked by no direction gate while ci stays green, so the + // field is refused rather than read (the template's optional build, which used it, is gone). + if (module.has("build")) { + throw new IllegalStateException( + "Module registry entry '" + + id + + "' has a 'build' field; every module belongs to the main build, so remove it."); + } + String buildName = "main"; List allowedDependencies = requireStringList(module.get("allowed_dependencies"), id, "allowed_dependencies"); diff --git a/build-logic/src/test/java/dev/caskeleton/buildlogic/ModuleRegistryTest.java b/build-logic/src/test/java/dev/caskeleton/buildlogic/ModuleRegistryTest.java index a91b360..861152d 100644 --- a/build-logic/src/test/java/dev/caskeleton/buildlogic/ModuleRegistryTest.java +++ b/build-logic/src/test/java/dev/caskeleton/buildlogic/ModuleRegistryTest.java @@ -87,7 +87,17 @@ class ModuleRegistryTest { } @Test - void buildOwnershipDefaultsToMainAndCanSelectOptionalModules() throws Exception { + void everyModuleBelongsToTheMainBuild() throws Exception { + ModuleRegistry parsed = read(registry(entry("app-bootstrap", ":app-bootstrap", "src/alpha"))); + assertEquals("main", parsed.byId("app-bootstrap").buildName()); + assertEquals(List.of("app-bootstrap"), parsed.modulesForBuild("main").stream().map(ModuleRegistry.Module::id).toList()); + } + + @Test + void aBuildFieldIsRejectedBecauseNoOtherBuildIncludesOrChecksTheModule() throws Exception { + // The optional gRPC build was the only other build; it moved to its own repository on + // 2026-11-08. A row naming any other build (a typo included) would be included by no settings + // and checked by no direction gate, while ci stays green. Files.createDirectories(root.resolve("src/grpc/grpc-client")); String json = registry( @@ -96,15 +106,13 @@ class ModuleRegistryTest { {"id":"grpc-client","gradle_path":":grpc:grpc-client","source_path":"src/grpc/grpc-client", "allowed_dependencies":[],"build":"optional-grpc"} """); - ModuleRegistry parsed = read(json); - assertEquals("main", parsed.byId("app-bootstrap").buildName()); - assertEquals("optional-grpc", parsed.byId("grpc-client").buildName()); - assertEquals(List.of("app-bootstrap"), parsed.modulesForBuild("main").stream().map(ModuleRegistry.Module::id).toList()); - assertEquals(List.of("grpc-client"), parsed.modulesForBuild("optional-grpc").stream().map(ModuleRegistry.Module::id).toList()); + IllegalStateException failure = assertThrows(IllegalStateException.class, () -> read(json)); + assertTrue(failure.getMessage().contains("'grpc-client'"), failure.getMessage()); + assertTrue(failure.getMessage().contains("'build'"), failure.getMessage()); } @Test - void blankBuildOwnershipIsRefused() { + void aBlankBuildFieldIsRefusedToo() { String json = """ {"modules":[ @@ -112,7 +120,7 @@ class ModuleRegistryTest { "allowed_dependencies":[],"build":" "}]} """; IllegalStateException failure = assertThrows(IllegalStateException.class, () -> read(json)); - assertTrue(failure.getMessage().contains("nonblank string 'build'"), failure.getMessage()); + assertTrue(failure.getMessage().contains("'build' field"), failure.getMessage()); } @Test