Skip to content

Commit

Permalink
Use sanitizedModuleName for umbrella header (#6042)
Browse files Browse the repository at this point in the history
  • Loading branch information
fortmarek committed Mar 7, 2024
1 parent ace3fc0 commit fc18623
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
Expand Up @@ -51,9 +51,10 @@ public final class SwiftPackageManagerModuleMapGenerator: SwiftPackageManagerMod
moduleName: String,
publicHeadersPath: AbsolutePath
) throws -> ModuleMap {
let umbrellaHeaderPath = publicHeadersPath.appending(component: moduleName + ".h")
let nestedUmbrellaHeaderPath = publicHeadersPath.appending(component: moduleName).appending(component: moduleName + ".h")
let sanitizedModuleName = moduleName.replacingOccurrences(of: "-", with: "_")
let umbrellaHeaderPath = publicHeadersPath.appending(component: sanitizedModuleName + ".h")
let nestedUmbrellaHeaderPath = publicHeadersPath
.appending(components: sanitizedModuleName, moduleName + ".h")
let customModuleMapPath = try Self.customModuleMapPath(publicHeadersPath: publicHeadersPath)
let generatedModuleMapPath: AbsolutePath

Expand Down
1 change: 1 addition & 0 deletions fixtures/app_with_spm_dependencies/App/Project.swift
Expand Up @@ -42,6 +42,7 @@ let project = Project(
.external(name: "NYTPhotoViewer"),
.external(name: "SVProgressHUD"),
.external(name: "AirshipPreferenceCenter"),
.external(name: "MarkdownUI"),
],
settings: .targetSettings
),
Expand Down
Expand Up @@ -7,6 +7,7 @@ import ComposableArchitecture
import CrashReporter
import GoogleSignIn
import libzstd
import MarkdownUI
import NYTPhotoViewer
import Realm
import RealmSwift
Expand Down Expand Up @@ -52,6 +53,9 @@ public enum AppKit {

// Use SVProgressHUD
SVProgressHUD.show()

// Use MarkdownUI
_ = BulletedList(of: [""])
}
}

Expand Down
18 changes: 18 additions & 0 deletions fixtures/app_with_spm_dependencies/Tuist/Package.resolved
Expand Up @@ -99,6 +99,15 @@
"version" : "17.7.3"
}
},
{
"identity" : "networkimage",
"kind" : "remoteSourceControl",
"location" : "https://github.com/gonzalezreal/NetworkImage",
"state" : {
"revision" : "7aff8d1b31148d32c5933d75557d42f6323ee3d1",
"version" : "6.0.0"
}
},
{
"identity" : "nimble",
"kind" : "remoteSourceControl",
Expand Down Expand Up @@ -252,6 +261,15 @@
"version" : "1.5.4"
}
},
{
"identity" : "swift-markdown-ui",
"kind" : "remoteSourceControl",
"location" : "https://github.com/gonzalezreal/swift-markdown-ui",
"state" : {
"revision" : "ae799d015a5374708f7b4c85f3294c05f2a564e2",
"version" : "2.3.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
Expand Down
2 changes: 2 additions & 0 deletions fixtures/app_with_spm_dependencies/Tuist/Package.swift
Expand Up @@ -34,6 +34,8 @@ let package = Package(
.package(url: "https://github.com/SVProgressHUD/SVProgressHUD", exact: "2.3.1"),
// Has missing resources and its own resource bundle accessors
.package(url: "https://github.com/urbanairship/ios-library.git", .exact("17.7.3")),
// Has an umbrella header where moduleName must be sanitized
.package(url: "https://github.com/gonzalezreal/swift-markdown-ui", from: "2.2.0"),
.package(path: "../LocalSwiftPackage"),
.package(path: "../StringifyMacro"),
]
Expand Down

0 comments on commit fc18623

Please sign in to comment.