Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .intentdefinition to sources by default #442

Merged
merged 3 commits into from
Nov 23, 2018
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 31 additions & 6 deletions Sources/XcodeGenKit/SourceGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,44 @@ 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(
destination: .productsDirectory,
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
Expand Down
2 changes: 2 additions & 0 deletions Tests/XcodeGenKitTests/SourceGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,7 @@ class SourceGeneratorTests: XCTestCase {
- file.xcassets
- file.metal
- Info.plist
- Intent.intentdefinition
"""
try createDirectories(directories)

Expand Down Expand Up @@ -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") {
Expand Down