mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-09-20 00:58:04 +03:00
Determine relative path for top-level groups
This commit is contained in:
parent
9f6f5210f7
commit
3b15144033
@ -254,7 +254,7 @@ class SourceGenerator {
|
||||
|
||||
let groupName = name ?? path.lastComponent
|
||||
let groupPath = isTopLevelGroup ?
|
||||
path.byRemovingBase(path: project.basePath).string :
|
||||
((try? path.relativePath(from: project.basePath)) ?? path).string :
|
||||
path.lastComponent
|
||||
let group = PBXGroup(
|
||||
children: children,
|
||||
|
@ -387,7 +387,7 @@ class SourceGeneratorTests: XCTestCase {
|
||||
let pbxProj = try project.generatePbxProj()
|
||||
try pbxProj.expectFile(paths: ["Sources", "A", "b.swift"], buildPhase: .sources)
|
||||
try pbxProj.expectFile(paths: ["Sources", "F", "G", "h.swift"], buildPhase: .sources)
|
||||
try pbxProj.expectFile(paths: [(outOfRootPath + "C/D").string, "e.swift"], names: ["D", "e.swift"], buildPhase: .sources)
|
||||
try pbxProj.expectFile(paths: ["../OtherDirectory/C/D", "e.swift"], names: ["D", "e.swift"], buildPhase: .sources)
|
||||
try pbxProj.expectFile(paths: ["Sources/B", "b.swift"], names: ["B", "b.swift"], buildPhase: .sources)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user