mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-11-10 06:14:38 +03:00
Conform TargetReference to CustomStringConvertible
This commit is contained in:
parent
55613785da
commit
e0dfc72f85
@ -387,11 +387,11 @@ extension Scheme.Test.TestTarget: JSONEncodable {
|
||||
public func toJSONValue() -> Any {
|
||||
if randomExecutionOrder == Scheme.Test.TestTarget.randomExecutionOrderDefault,
|
||||
parallelizable == Scheme.Test.TestTarget.parallelizableDefault {
|
||||
return targetReference.toString()
|
||||
return targetReference.reference
|
||||
}
|
||||
|
||||
var dict: JSONDictionary = [
|
||||
"name": targetReference.toString(),
|
||||
"name": targetReference.reference,
|
||||
]
|
||||
|
||||
if randomExecutionOrder != Scheme.Test.TestTarget.randomExecutionOrderDefault {
|
||||
@ -532,7 +532,7 @@ extension Scheme.Build: JSONObjectConvertible {
|
||||
|
||||
extension Scheme.Build: JSONEncodable {
|
||||
public func toJSONValue() -> Any {
|
||||
let targetPairs = targets.map { ($0.target.toString(), $0.buildTypes.map { $0.toJSONValue() }) }
|
||||
let targetPairs = targets.map { ($0.target.reference, $0.buildTypes.map { $0.toJSONValue() }) }
|
||||
|
||||
var dict: JSONDictionary = [
|
||||
"targets": Dictionary(uniqueKeysWithValues: targetPairs),
|
||||
|
@ -41,12 +41,16 @@ extension TargetReference {
|
||||
}
|
||||
}
|
||||
|
||||
extension TargetReference {
|
||||
public func toString() -> String {
|
||||
extension TargetReference: CustomStringConvertible {
|
||||
public var reference: String {
|
||||
switch location {
|
||||
case .local: return name
|
||||
case .project(let projectPath):
|
||||
return "\(projectPath)/\(name)"
|
||||
}
|
||||
}
|
||||
|
||||
public var description: String {
|
||||
return reference
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user