From 32b3d8c362000ab0a506fb125645683435c50bc4 Mon Sep 17 00:00:00 2001 From: yonaskolb Date: Sun, 17 Mar 2019 19:38:36 +1100 Subject: [PATCH] fix relative paths in included target templates --- CHANGELOG.md | 1 + Sources/ProjectSpec/Project.swift | 1 + Tests/Fixtures/paths_test.yml | 1 + Tests/Fixtures/paths_test/included_paths_test.yml | 4 ++++ Tests/XcodeGenKitTests/SpecLoadingTests.swift | 5 ++++- 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5149de6..1f7660c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - Sources outside a project spec's directory will be correctly referenced as relative paths in the project file. [#524](https://github.com/yonaskolb/XcodeGen/pull/524) - Fixed error when `optional` path is missing [#527](https://github.com/yonaskolb/XcodeGen/pull/527) @yonaskolb - Fixed excludes within included spec [#535](https://github.com/yonaskolb/XcodeGen/pull/535) @yonaskolb +- Fixed paths in target templates within included files not being relative [#537](https://github.com/yonaskolb/XcodeGen/pull/537) @yonaskolb ## 2.2.0 diff --git a/Sources/ProjectSpec/Project.swift b/Sources/ProjectSpec/Project.swift index 85885d76..d445f706 100644 --- a/Sources/ProjectSpec/Project.swift +++ b/Sources/ProjectSpec/Project.swift @@ -184,6 +184,7 @@ extension Project: PathContainer { .string("configFiles"), .object("options", SpecOptions.pathProperties), .object("targets", Target.pathProperties), + .object("targetTemplates", Target.pathProperties), .object("aggregateTargets", AggregateTarget.pathProperties), ] } diff --git a/Tests/Fixtures/paths_test.yml b/Tests/Fixtures/paths_test.yml index 2cc63148..7e2da2e0 100644 --- a/Tests/Fixtures/paths_test.yml +++ b/Tests/Fixtures/paths_test.yml @@ -6,6 +6,7 @@ targets: NewTarget: type: application platform: iOS + templates: [Template1] configFiles: Config: config sources: diff --git a/Tests/Fixtures/paths_test/included_paths_test.yml b/Tests/Fixtures/paths_test/included_paths_test.yml index a1e8b435..fb858e77 100644 --- a/Tests/Fixtures/paths_test/included_paths_test.yml +++ b/Tests/Fixtures/paths_test/included_paths_test.yml @@ -30,3 +30,7 @@ aggregateTargets: Config: config buildScripts: - path: buildScript +targetTemplates: + Template1: + sources: + - template_source diff --git a/Tests/XcodeGenKitTests/SpecLoadingTests.swift b/Tests/XcodeGenKitTests/SpecLoadingTests.swift index 607f3ce6..d5594de2 100644 --- a/Tests/XcodeGenKitTests/SpecLoadingTests.swift +++ b/Tests/XcodeGenKitTests/SpecLoadingTests.swift @@ -81,7 +81,10 @@ class SpecLoadingTests: XCTestCase { type: .application, platform: .iOS, configFiles: ["Config": "config"], - sources: ["source"], + sources: [ + "paths_test/template_source", + "source", + ], dependencies: [Dependency(type: .framework, reference: "Framework")], info: Plist(path: "info"), entitlements: Plist(path: "entitlements"),