diff --git a/Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift b/Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift index 2239072df56..803f0fe779a 100644 --- a/Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift +++ b/Sources/SwiftBuildSupport/PackagePIFProjectBuilder.swift @@ -334,6 +334,13 @@ struct PackagePIFProjectBuilder { self.log(.debug, indent: 2, "Added asset catalog as source file '\(resourcePath)'") } + // String Catalogs can also generate symbols. + if SwiftBuild.SwiftBuildFileType.xcstrings.fileTypes.contains(resourcePath.pathExtension) { + self.project[keyPath: sourceModuleTargetKeyPath].addSourceFile { id in + BuildFile(id: id, fileRef: ref) + } + } + self.log(.debug, indent: 2, "Added resource file '\(resourcePath)'") } diff --git a/Sources/XCBuildSupport/PIF.swift b/Sources/XCBuildSupport/PIF.swift index fcd30ea9b50..d418da1f15c 100644 --- a/Sources/XCBuildSupport/PIF.swift +++ b/Sources/XCBuildSupport/PIF.swift @@ -1124,6 +1124,11 @@ public struct XCBuildFileType: CaseIterable { fileTypeIdentifier: "folder.abstractassetcatalog" ) + public static let xcstrings: XCBuildFileType = XCBuildFileType( + fileType: "xcstrings", + fileTypeIdentifier: "text.json.xcstrings" + ) + public static let xcdatamodeld: XCBuildFileType = XCBuildFileType( fileType: "xcdatamodeld", fileTypeIdentifier: "wrapper.xcdatamodeld" @@ -1140,6 +1145,8 @@ public struct XCBuildFileType: CaseIterable { ) public static let allCases: [XCBuildFileType] = [ + .xcassets, + .xcstrings, .xcdatamodeld, .xcdatamodel, .xcmappingmodel, diff --git a/Sources/XCBuildSupport/PIFBuilder.swift b/Sources/XCBuildSupport/PIFBuilder.swift index 283379fedd1..1b231f68592 100644 --- a/Sources/XCBuildSupport/PIFBuilder.swift +++ b/Sources/XCBuildSupport/PIFBuilder.swift @@ -946,6 +946,11 @@ final class PackagePIFProjectBuilder: PIFProjectBuilder { pifTarget.addSourceFile(resourceFile) } + // String Catalogs can also generate symbols. + if XCBuildFileType.xcstrings.fileTypes.contains(resource.path.extension ?? "") { + pifTarget.addSourceFile(resourceFile) + } + resourcesTarget.addResourceFile(resourceFile) }