Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

[apple] Add "umbrella" suffix to default umbrella header name #2605

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public enum SwiftMode {
@Nullable private String generatedModule;
private static final String template =
"module <module_name> {\n"
+ " umbrella header \"<module_name>.h\"\n"
+ " umbrella header \"<umbrella_name>.h\"\n"
+ "\n"
+ " export *\n"
+ " module * { export * }\n"
Expand Down Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public ImmutableList<Step> 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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down