Merge pull request #442 from yonaskolb/intent_definition

Add .intentdefinition to sources by default
This commit is contained in:
Yonas Kolb 2018-11-23 12:02:29 +11:00 committed by GitHub
commit d1313ef0d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

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