Skip to content

Commit da2add4

Browse files
authored
Support group path in XCWorkspace (#34)
* Add group with project to ExampleWorkspace * Support group path in XCWorkspace
1 parent f4b83ad commit da2add4

File tree

6 files changed

+415
-1
lines changed

6 files changed

+415
-1
lines changed

Sources/Workspace/XCWorkspace+Projects.swift

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,24 @@ extension XCWorkspace {
5656
}
5757

5858
case let .group(element):
59-
try projects.append(contentsOf: XCWorkspace.allProjects(from: element.children, basePath: basePath))
59+
let groupBasePath = switch element.location {
60+
case let .absolute(path):
61+
Path(path)
62+
63+
case let .group(path),
64+
let .current(path):
65+
basePath + path
66+
67+
case .container:
68+
basePath
69+
70+
case let .developer(path):
71+
throw "Developer path not supported: \(path)"
72+
73+
case let .other(_, path):
74+
throw "Other path not supported \(path)"
75+
}
76+
try projects.append(contentsOf: XCWorkspace.allProjects(from: element.children, basePath: groupBasePath))
6077
}
6178
}
6279

Tests/SelectiveTestingTests/ExampleProject/ExampleWorkspace.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)