diff --git a/CHANGELOG.md b/CHANGELOG.md index b5d968753..e6e868051 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ #### Fixed - Fixed XPC Service package type [#435](https://github.com/yonaskolb/XcodeGen/pull/435) @alvarhansen - Fixed phase ordering for modulemap and static libary header Copy File phases. [402](https://github.com/yonaskolb/XcodeGen/pull/402) @brentleyjones +- Add `.intentdefinition` files to sources build phase instead of resources [#442](https://github.com/yonaskolb/XcodeGen/pull/442) @yonaskolb #### Changed - Changed spelling of build phases to **preBuildPhase** and **postBuildPhase**. [402](https://github.com/yonaskolb/XcodeGen/pull/402) @brentleyjones diff --git a/Sources/XcodeGenKit/SourceGenerator.swift b/Sources/XcodeGenKit/SourceGenerator.swift index 5ee4ac9d6..129e1653f 100644 --- a/Sources/XcodeGenKit/SourceGenerator.swift +++ b/Sources/XcodeGenKit/SourceGenerator.swift @@ -183,8 +183,25 @@ class SourceGenerator { } if let fileExtension = path.extension { switch fileExtension { - case "swift", "m", "mm", "cpp", "c", "cc", "S", "xcdatamodeld", "metal": return .sources - case "h", "hh", "hpp", "ipp", "tpp", "hxx", "def": return .headers + case "swift", + "m", + "mm", + "cpp", + "c", + "cc", + "S", + "xcdatamodeld", + "intentdefinition", + "metal": + return .sources + case "h", + "hh", + "hpp", + "ipp", + "tpp", + "hxx", + "def": + return .headers case "modulemap": guard targetType == .staticLibrary else { return nil } return .copyFiles(TargetSource.BuildPhase.CopyFilesSettings( @@ -192,10 +209,18 @@ class SourceGenerator { subpath: "include/$(PRODUCT_NAME)", phaseOrder: .preCompile )) - case "framework": return .frameworks - case "xpc": return .copyFiles(.xpcServices) - case "xcconfig", "entitlements", "gpx", "lproj", "apns": return nil - default: return .resources + case "framework": + return .frameworks + case "xpc": + return .copyFiles(.xpcServices) + case "xcconfig", + "entitlements", + "gpx", + "lproj", + "apns": + return nil + default: + return .resources } } return nil diff --git a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift index 69c152cc0..5054dde86 100644 --- a/Tests/XcodeGenKitTests/SourceGeneratorTests.swift +++ b/Tests/XcodeGenKitTests/SourceGeneratorTests.swift @@ -436,6 +436,7 @@ class SourceGeneratorTests: XCTestCase { - file.xcassets - file.metal - Info.plist + - Intent.intentdefinition """ try createDirectories(directories) @@ -483,6 +484,7 @@ class SourceGeneratorTests: XCTestCase { try pbxProj.expectFile(paths: ["C", "file.123"], buildPhase: .resources) try pbxProj.expectFile(paths: ["C", "Info.plist"], buildPhase: .none) try pbxProj.expectFile(paths: ["C", "file.metal"], buildPhase: .sources) + try pbxProj.expectFile(paths: ["C", "Intent.intentdefinition"], buildPhase: .sources) } $0.it("duplicate TargetSource is included once in sources build phase") {