From 939bd4b18518d9a8d67ade929af4ab91f5334a3a Mon Sep 17 00:00:00 2001 From: alekseevpg Date: Fri, 2 Apr 2021 11:39:26 +0300 Subject: [PATCH] Add "umbrella" suffix to default umbrella header name --- .../facebook/buck/apple/clang/UmbrellaHeaderModuleMap.java | 3 ++- .../buck/cxx/toolchain/HeaderSymlinkTreeWithModuleMap.java | 2 +- .../buck/features/apple/project/ProjectGenerator.java | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/com/facebook/buck/apple/clang/UmbrellaHeaderModuleMap.java b/src/com/facebook/buck/apple/clang/UmbrellaHeaderModuleMap.java index 630cfe407c5..48ae7c91ea9 100644 --- a/src/com/facebook/buck/apple/clang/UmbrellaHeaderModuleMap.java +++ b/src/com/facebook/buck/apple/clang/UmbrellaHeaderModuleMap.java @@ -40,7 +40,7 @@ public enum SwiftMode { @Nullable private String generatedModule; private static final String template = "module {\n" - + " umbrella header \".h\"\n" + + " umbrella header \".h\"\n" + "\n" + " export *\n" + " module * { export * }\n" @@ -71,6 +71,7 @@ public String render() { ST st = new ST(template) .add("module_name", moduleName) + .add("umbrella_name", moduleName + "-umbrella") .add("include_swift_header", false) .add("exclude_swift_header", false); switch (swiftMode) { diff --git a/src/com/facebook/buck/cxx/toolchain/HeaderSymlinkTreeWithModuleMap.java b/src/com/facebook/buck/cxx/toolchain/HeaderSymlinkTreeWithModuleMap.java index dfca8e2820d..4c881f52a4e 100644 --- a/src/com/facebook/buck/cxx/toolchain/HeaderSymlinkTreeWithModuleMap.java +++ b/src/com/facebook/buck/cxx/toolchain/HeaderSymlinkTreeWithModuleMap.java @@ -97,7 +97,7 @@ public ImmutableList getBuildSteps( : UmbrellaHeaderModuleMap.SwiftMode.NO_SWIFT, getLinks().keySet()))); - Path umbrellaHeaderPath = Paths.get(moduleName, moduleName + ".h"); + Path umbrellaHeaderPath = Paths.get(moduleName, moduleName + "-umbrella.h"); if (moduleMapMode.shouldGenerateMissingUmbrellaHeader() && !paths.contains(umbrellaHeaderPath)) { builder.add( diff --git a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java index 983015bd53b..ea7d10acf20 100644 --- a/src/com/facebook/buck/features/apple/project/ProjectGenerator.java +++ b/src/com/facebook/buck/features/apple/project/ProjectGenerator.java @@ -3237,8 +3237,8 @@ private void writeUmbrellaHeaderIfNeeded( .map(Path::getFileName) .map(Path::toString) .collect(ImmutableList.toImmutableList()); - if (!headerPathStrings.contains(moduleName + ".h")) { - Path umbrellaPath = headerSymlinkTreeRoot.resolve(Paths.get(moduleName, moduleName + ".h")); + if (!headerPathStrings.contains(moduleName + "-umbrella.h")) { + Path umbrellaPath = headerSymlinkTreeRoot.resolve(Paths.get(moduleName, moduleName + "-umbrella.h")); Preconditions.checkState(!projectFilesystem.exists(umbrellaPath)); projectFilesystem.writeContentsToPath( new UmbrellaHeader(moduleName, headerPathStrings).render(), umbrellaPath);