use context

This commit is contained in:
Yonas Kolb 2018-10-16 21:35:31 +11:00
parent c8ce6a52a5
commit 0fcb3dcc78
3 changed files with 6 additions and 9 deletions

View File

@ -69,7 +69,7 @@
"repositoryURL": "https://github.com/tuist/xcodeproj.git",
"state": {
"branch": "id_conflicts",
"revision": "7f382d029fcf01bfd62ec1658f0fdf1d9aafcbb1",
"revision": "7b71bda001e28790e82c61c65f9b2e32e632d625",
"version": null
}
},

View File

@ -32,8 +32,9 @@ public class PBXProjGenerator {
}
}
func addObject<T: PBXObject>(_ object: T) -> T {
func addObject<T: PBXObject>(_ object: T, context: String? = nil) -> T {
pbxProj.add(object: object)
object.context = context
return object
}
@ -131,9 +132,9 @@ public class PBXProjGenerator {
lastKnownFileType: lastKnownFileType,
path: target.filename,
includeInIndex: false
),
context: target.name
)
)
fileReference.identifier = target.name
targetFileReferences[target.name] = fileReference
}
@ -377,7 +378,7 @@ public class PBXProjGenerator {
if child1.nameOrPath != child2.nameOrPath {
return child1.nameOrPath.localizedStandardCompare(child2.nameOrPath) == .orderedAscending
} else {
return child1.identifier ?? "" < child2.identifier ?? ""
return child1.context ?? "" < child2.context ?? ""
}
}
}
@ -389,8 +390,6 @@ public class PBXProjGenerator {
}
func generateTarget(_ target: Target) throws {
sourceGenerator.targetName = target.name
let carthageDependencies = getAllCarthageDependencies(target: target)
let sourceFiles = try sourceGenerator.getAllSourceFiles(targetType: target.type, sources: target.sources)

View File

@ -24,8 +24,6 @@ class SourceGenerator {
".DS_Store",
]
var targetName: String = ""
private(set) var knownRegions: Set<String> = []
init(project: Project, addObjectClosure: @escaping (PBXObject) -> Void) {