mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Fixed issue on localPackage when specified as absolute path and when using -p
This commit is contained in:
@@ -57,8 +57,7 @@ public class PBXProjGenerator {
|
||||
}
|
||||
|
||||
for (_, package) in project.localPackages {
|
||||
let path = project.basePath + Path(package.path).normalize()
|
||||
try sourceGenerator.createLocalPackage(path: path)
|
||||
try sourceGenerator.createLocalPackage(path: Path(package.path))
|
||||
}
|
||||
|
||||
let buildConfigs: [XCBuildConfiguration] = project.configs.map { config in
|
||||
|
||||
@@ -60,12 +60,18 @@ class SourceGenerator {
|
||||
localPackageGroup = addObject(PBXGroup(sourceTree: .sourceRoot, name: groupName))
|
||||
rootGroups.insert(localPackageGroup!)
|
||||
}
|
||||
|
||||
let absolutePath = path.isAbsolute ? path : project.basePath + path.normalize()
|
||||
|
||||
// Get local pakcage's relative path from generating project's root
|
||||
let fileReferencePath = try? absolutePath.relativePath(from: projectDirectory ?? project.basePath).string
|
||||
|
||||
let fileReference = addObject(
|
||||
PBXFileReference(
|
||||
sourceTree: .sourceRoot,
|
||||
sourceTree: .group,
|
||||
name: path.lastComponent,
|
||||
lastKnownFileType: "folder",
|
||||
path: try path.relativePath(from: project.basePath).string
|
||||
path: fileReferencePath
|
||||
)
|
||||
)
|
||||
localPackageGroup!.children.append(fileReference)
|
||||
|
||||
Reference in New Issue
Block a user