Skip to content

Commit 26de8f1

Browse files
authored
Support relative paths for fileGroups in includes (#1534)
1 parent 9e8343b commit 26de8f1

File tree

6 files changed

+12
-2
lines changed

6 files changed

+12
-2
lines changed

Sources/ProjectSpec/Project.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,8 @@ extension Project: PathContainer {
242242
.object("schemes", Scheme.pathProperties),
243243
.object("projectReferences", ProjectReference.pathProperties),
244244
.object("packages", SwiftPackage.pathProperties),
245-
.string("localPackages")
245+
.string("localPackages"),
246+
.string("fileGroups")
246247
]
247248
}
248249
}

Tests/Fixtures/duplicated_include/duplicated_import_sut.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ include:
22
- duplicated_import_transitive.yml
33
- duplicated_import_root.yml
44
- duplicated_import_root.yml
5-
- different_path/duplicated_import_root.yml
5+
- path: different_path/duplicated_import_root.yml
6+
relativePaths: false
67
name: DuplicatedImportDependent
78
targets:
89
IncludedTarget:

Tests/Fixtures/paths_test/included_paths_test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
name: IncludedPathsTest
12
include:
23
- recursive_test/recursive_test.yml
34
- same_relative_path_test/same_relative_path_test.yml
45
- path: relative_local_package/inc.yml
56
relativePaths: true
7+
- path: relative_file_groups/inc.yml
8+
relativePaths: true
69
configFiles:
710
IncludedConfig: config
811
projectReferences:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is a test file for relative file groups
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fileGroups:
2+
- TestFile.md

Tests/ProjectSpecTests/SpecLoadingTests.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ class SpecLoadingTests: XCTestCase {
197197
try expect(project.packages) == [
198198
"LocalPackage": .local(path: "paths_test/relative_local_package/LocalPackage", group: nil, excludeFromProject: false),
199199
]
200+
201+
try expect(project.fileGroups.contains("paths_test/relative_file_groups/TestFile.md")) == true
200202
}
201203

202204
$0.it("respects directory expansion preference") {

0 commit comments

Comments
 (0)