mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
fix #87
This commit is contained in:
@@ -67,7 +67,7 @@ public class PBXProjGenerator {
|
||||
let buildSettings = spec.getProjectBuildSettings(config: config)
|
||||
var baseConfigurationReference: String?
|
||||
if let configPath = spec.configFiles[config.name] {
|
||||
baseConfigurationReference = sourceGenerator.getFileReference(path: spec.basePath + configPath, inPath: spec.basePath)
|
||||
baseConfigurationReference = sourceGenerator.getContainedFileReference(path: spec.basePath + configPath)
|
||||
}
|
||||
return XCBuildConfiguration(reference: referenceGenerator.generate(XCBuildConfiguration.self, config.name), name: config.name, baseConfigurationReference: baseConfigurationReference, buildSettings: buildSettings)
|
||||
}
|
||||
@@ -225,7 +225,7 @@ public class PBXProjGenerator {
|
||||
|
||||
var baseConfigurationReference: String?
|
||||
if let configPath = target.configFiles[config.name] {
|
||||
baseConfigurationReference = sourceGenerator.getFileReference(path: spec.basePath + configPath, inPath: spec.basePath)
|
||||
baseConfigurationReference = sourceGenerator.getContainedFileReference(path: spec.basePath + configPath)
|
||||
}
|
||||
return XCBuildConfiguration(reference: referenceGenerator.generate(XCBuildConfiguration.self, config.name + target.name), name: config.name, baseConfigurationReference: baseConfigurationReference, buildSettings: buildSettings)
|
||||
}
|
||||
|
||||
@@ -65,6 +65,19 @@ class SourceGenerator {
|
||||
return SourceFile(path: path, fileReference: fileReference, buildFile: buildFile, buildPhase: buildPhase)
|
||||
}
|
||||
|
||||
func getContainedFileReference(path: Path) -> String {
|
||||
let createIntermediateGroups = spec.options.createIntermediateGroups
|
||||
|
||||
let parentPath = path.parent()
|
||||
let fileReference = getFileReference(path: path, inPath: parentPath)
|
||||
let parentGroup = getGroup(path: parentPath, mergingChildren: [fileReference], createIntermediateGroups: createIntermediateGroups, isBaseGroup: true)
|
||||
|
||||
if createIntermediateGroups {
|
||||
createIntermediaGroups(for: parentGroup.reference, at: parentPath)
|
||||
}
|
||||
return fileReference
|
||||
}
|
||||
|
||||
func getFileReference(path: Path, inPath: Path, name: String? = nil, sourceTree: PBXSourceTree = .group) -> String {
|
||||
if let fileReference = fileReferencesByPath[path] {
|
||||
return fileReference
|
||||
|
||||
Reference in New Issue
Block a user