Skip to content
Open
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 @@ -18,6 +18,7 @@
- Fix nested target attributes (e.g. `attributes.SystemCapabilities`) being serialized as a stringified Swift `Dictionary` description instead of a proper nested plist dictionary, which also caused non-deterministic key ordering in generated `project.pbxproj` files across runs #1639 @imadaan @sergeyospanov
- Fix `.DS_Store` and `.orig` files causing projects to be regenerated when using `--use-cache` #1622 @kimjune01
- Fix generated "Copy Bundle Resources" phases missing `dstPath`, which caused Xcode 27.2 project conversion to fail #1654 @Ckitakishi
- Fix `xcodegen generate` hanging when `createIntermediateGroups` is enabled and a source's only common ancestor with the project is the file system root, such as an absolute path like `/usr/bin/xcrun` #1659 @ybai08

### Internal
- Use a dedicated local package in the SPM fixture so generated fixtures don't depend on the checkout directory name, such as when running tests from a git worktree @yonaskolb
Expand Down
4 changes: 2 additions & 2 deletions Sources/XcodeGenKit/SourceGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -856,8 +856,8 @@ class SourceGenerator {
private func createIntermediaGroups(for fileElement: PBXFileElement, at path: Path) {

let parentPath = path.parent()
guard parentPath != project.basePath else {
// we've reached the top
guard parentPath != project.basePath, parentPath != path else {
// we've reached the top, or the root of the file system
return
}

Expand Down
20 changes: 20 additions & 0 deletions Tests/XcodeGenKitTests/SourceGeneratorTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,26 @@ class SourceGeneratorTests: XCTestCase {
try pbxProj.expectFile(paths: ["Sources/B", "b.swift"], names: ["B", "b.swift"], buildPhase: .sources)
}

$0.it("generates intermediate groups up to the file system root") {
try createDirectories("""
Sources:
- a.swift
""")

let target = Target(name: "Test", type: .application, platform: .iOS, sources: [
"Sources",
"/usr/bin/env",
])
let options = SpecOptions(createIntermediateGroups: true)
let basePath = directoryPath.absolute()
let project = Project(basePath: basePath, name: "Test", targets: [target], options: options)

let pbxProj = try project.generatePbxProj()
let rootPath = try Path("/").relativePath(from: basePath).string
try pbxProj.expectFile(paths: ["Sources", "a.swift"], buildPhase: .sources)
try pbxProj.expectFile(paths: [rootPath, "usr", "bin", "env"], names: ["/", "usr", "bin", "env"])
}

$0.it("generates intermediate groups with different projectDirectory") {

let directories = """
Expand Down
Loading