build-logic 사본의 ModuleRegistry는 행마다 `build` 칸을 읽었다(템플릿의 두 번째 빌드용). 이 repo에는 빌드가 하나라, main이 아닌 값(오타 포함)을 적은 모듈은 settings가 include하지 않고 방향 검사도 보지 않는데 ci는 초록으로 남는다. 템플릿 구조 리뷰가 같은 구멍을 템플릿 쪽에서 찾았다. 칸이 있으면 read에서 실패한다. 시험은 칸이 없으면 main, 칸이 있으면 (빈 값 포함) 그 모듈 id와 'build'를 이름 대고 거절함을 본다. UPSTREAM.md 「고친 것」에 적었다. 검증: 템플릿에서 같은 시험이 고치기 전 실패(RED), 고친 뒤 통과(GREEN)를 desktop에서 봤다. 이 repo에서는 desktop ci(buildLogicTest 포함).
This commit is contained in:
@@ -108,7 +108,16 @@ public record ModuleRegistry(List<Module> 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<String> allowedDependencies =
|
||||
requireStringList(module.get("allowed_dependencies"), id, "allowed_dependencies");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user