diff --git a/Sources/XcodeProject/Archiving/PBXPListArchiver.swift b/Sources/XcodeProject/Archiving/PBXPListArchiver.swift index bc3eb28..b17a7d3 100644 --- a/Sources/XcodeProject/Archiving/PBXPListArchiver.swift +++ b/Sources/XcodeProject/Archiving/PBXPListArchiver.swift @@ -131,8 +131,8 @@ public final class PBXPListArchiver { } final class ObjectVisitor { - private var objectMap: [PBXObject.ID: PBXObject] = [:] - private var visited = Set() + private var objectMap: [PBXGlobalID: PBXObject] = [:] + private var visited = Set() func visit(object: PBXObject?, where predicate: @escaping (_ object: PBXObject) -> Bool = { _ in return true}) { guard let object = object else { return } diff --git a/Sources/XcodeProject/Archiving/PBXPListUnarchiver.swift b/Sources/XcodeProject/Archiving/PBXPListUnarchiver.swift index cb9ff63..af1b319 100644 --- a/Sources/XcodeProject/Archiving/PBXPListUnarchiver.swift +++ b/Sources/XcodeProject/Archiving/PBXPListUnarchiver.swift @@ -19,14 +19,14 @@ class ObjectCache { self.types = types } - internal var objects: [PBXObject.ID: PBXObject] = [:] + internal var objects: [PBXGlobalID: PBXObject] = [:] - func object(for globalID: PBXObject.ID?) -> T? { + func object(for globalID: PBXGlobalID?) -> T? { guard let globalID = globalID else { return nil } return cached(globalID: globalID, create: true) as? T } - private func cached(globalID: PBXObject.ID, create: Bool = false) -> PBXObject? { + private func cached(globalID: PBXGlobalID, create: Bool = false) -> PBXObject? { if let existing = objects[globalID] { return existing } else if create { @@ -35,7 +35,7 @@ class ObjectCache { return nil } - private func createObject(globalID: PBXObject.ID) -> PBXObject? { + private func createObject(globalID: PBXGlobalID) -> PBXObject? { guard let objectPlist = plist[globalID.rawValue] as? [String: Any] else { return nil } guard let isa = objectPlist["isa"] as? String else { fatalError() } @@ -51,7 +51,7 @@ class ObjectCache { return object } - private func setCached(object: PBXObject?, for globalID: PBXObject.ID) { + private func setCached(object: PBXObject?, for globalID: PBXGlobalID) { guard let object = object else { return } diff --git a/Sources/XcodeProject/Objects+Extensions/PBXGroup+FolderSync.swift b/Sources/XcodeProject/Objects+Extensions/PBXGroup+FolderSync.swift index ab37471..95d7911 100644 --- a/Sources/XcodeProject/Objects+Extensions/PBXGroup+FolderSync.swift +++ b/Sources/XcodeProject/Objects+Extensions/PBXGroup+FolderSync.swift @@ -27,14 +27,14 @@ public extension PBXGroup { currentGroup = currentGroup.addGroup(pathComponent: $0) } } - let fileReference = PBXFileReference(globalID: PBXObject.ID(), path: filePathComponents.last) + let fileReference = PBXFileReference(globalID: PBXGlobalID(), path: filePathComponents.last) currentGroup.add(child: fileReference) return fileReference } @discardableResult func addGroup(pathComponent: String) -> PBXGroup { - let group = PBXGroup(globalID: PBXObject.ID(), name: nil, path: pathComponent, sourceTree: .group) + let group = PBXGroup(globalID: PBXGlobalID(), name: nil, path: pathComponent, sourceTree: .group) children.append(group) return group } diff --git a/Sources/XcodeProject/Objects+Extensions/PBXProject+Helpers.swift b/Sources/XcodeProject/Objects+Extensions/PBXProject+Helpers.swift index 57da328..985e281 100644 --- a/Sources/XcodeProject/Objects+Extensions/PBXProject+Helpers.swift +++ b/Sources/XcodeProject/Objects+Extensions/PBXProject+Helpers.swift @@ -7,10 +7,10 @@ // public extension PBXProject { - func generateGlobalId() -> PBXObject.ID { - var objectId = PBXObject.ID() + func generateGlobalId() -> PBXGlobalID { + var objectId = PBXGlobalID() while objects[objectId] != nil { - objectId = PBXObject.ID() + objectId = PBXGlobalID() } return objectId } diff --git a/Sources/XcodeProject/Objects/Build Phases/PBXBuildPhase.swift b/Sources/XcodeProject/Objects/Build Phases/PBXBuildPhase.swift index 02cd9f4..7b65f88 100644 --- a/Sources/XcodeProject/Objects/Build Phases/PBXBuildPhase.swift +++ b/Sources/XcodeProject/Objects/Build Phases/PBXBuildPhase.swift @@ -59,7 +59,7 @@ public class PBXBuildPhase: PBXObject { } self._name = plist["name"]?.string self.files = files.compactMap { - let file: PBXBuildFile? = objectCache.object(for: PBXObject.ID(rawValue: $0)) + let file: PBXBuildFile? = objectCache.object(for: PBXGlobalID(rawValue: $0)) return file } diff --git a/Sources/XcodeProject/Objects/PBXBuildFile.swift b/Sources/XcodeProject/Objects/PBXBuildFile.swift index 628d35e..b0e2620 100644 --- a/Sources/XcodeProject/Objects/PBXBuildFile.swift +++ b/Sources/XcodeProject/Objects/PBXBuildFile.swift @@ -20,14 +20,14 @@ public final class PBXBuildFile: PBXObject { } var settings: [String: Any]? - public convenience init(globalID: PBXObject.ID, fileReference: PBXReference) { + public convenience init(globalID: PBXGlobalID, fileReference: PBXReference) { self.init(globalID: globalID) fileRef = fileReference } override func update(with plist: PropertyList, objectCache: ObjectCache) { super.update(with: plist, objectCache: objectCache) - self.fileRef = objectCache.object(for: PBXObject.ID(rawValue: plist["fileRef"]?.string)) + self.fileRef = objectCache.object(for: PBXGlobalID(rawValue: plist["fileRef"]?.string)) self.settings = plist["settings"]?.dictionary } diff --git a/Sources/XcodeProject/Objects/PBXContainerItemProxy.swift b/Sources/XcodeProject/Objects/PBXContainerItemProxy.swift index 35195cb..4689956 100644 --- a/Sources/XcodeProject/Objects/PBXContainerItemProxy.swift +++ b/Sources/XcodeProject/Objects/PBXContainerItemProxy.swift @@ -26,7 +26,7 @@ final class PBXContainerItemProxy: PBXObject { super.update(with: plist, objectCache: objectCache) guard - let containerPortal = objectCache.object(for: PBXObject.ID(rawValue: plist["containerPortal"]?.string)), + let containerPortal = objectCache.object(for: PBXGlobalID(rawValue: plist["containerPortal"]?.string)), let proxyType = ProxyType(string: plist["proxyType"]?.string), let remoteGlobalIDString = plist["remoteGlobalIDString"]?.string, let remoteInfo = plist["remoteInfo"]?.string diff --git a/Sources/XcodeProject/Objects/PBXGlobalID+Generator.swift b/Sources/XcodeProject/Objects/PBXGlobalID+Generator.swift new file mode 100644 index 0000000..b09a52b --- /dev/null +++ b/Sources/XcodeProject/Objects/PBXGlobalID+Generator.swift @@ -0,0 +1,124 @@ +// +// PBXGlobalID+Generator.swift +// XcodeProject +// +// Created by Geoffrey Foster on 2018-12-02. +// + +import Foundation + +extension PBXGlobalID { + struct Generator { + private struct GlobalIdentifier: CustomStringConvertible { + let userHash: UInt8 + let pidByte: UInt8 + var random: UInt16 + var time: UInt32 + let zero: UInt8 = 0 + let hostShift: UInt8 + let hostHigh: UInt8 + let hostLow: UInt8 + + var description: String { + let components = [ + userHash.hexRepresentation, + pidByte.hexRepresentation, + random.hexRepresentation, + time.hexRepresentation, + zero.hexRepresentation, + hostShift.hexRepresentation, + hostHigh.hexRepresentation, + hostLow.hexRepresentation, + ] + return components.joined() + } + } + + private var gid: GlobalIdentifier + + private var randomSequence: UInt16 = 0 + private let referenceDateGenerator: () -> Date + + private var lastTime: UInt32 = 0 + private var firstSequence: UInt16 = 0 + + init(userName: String = NSUserName(), processId: pid_t = getpid(), random: inout RandomNumberGenerator, referenceDateGenerator: @escaping () -> Date = Generator.referenceDate) { + self.referenceDateGenerator = referenceDateGenerator + + var hostId: UInt32 = UInt32(gethostid()) + if hostId == 0 { + hostId = random.next() + } + self.gid = GlobalIdentifier( + userHash: Generator.userHash(userName: userName), + pidByte: UInt8(truncatingIfNeeded: processId), + random: random.next(), + time: 0, + hostShift: UInt8(truncatingIfNeeded: (hostId >> 0x10) & 0xff), + hostHigh: UInt8(truncatingIfNeeded: (hostId & 0xff00) >> 0x8), + hostLow: UInt8(truncatingIfNeeded: hostId & 0xff) + ) + } + + mutating func next() -> String { + let randomValue = gid.random + 1 + + let time = UInt32(referenceDateGenerator().timeIntervalSinceReferenceDate) + if time > lastTime { + firstSequence = randomValue + lastTime = time + } else if firstSequence == randomValue { + lastTime += 1 + } + + gid.random = randomValue + gid.time = lastTime + + return gid.description + } + + static func referenceDate() -> Date { + return Date() + } + + static func userHash(userName: String) -> UInt8 { + func hash(character: UnicodeScalar) -> UInt32 { + let uppercaseA: UnicodeScalar = "A" + let uppercaseZ: UnicodeScalar = "Z" + let lowercaseA: UnicodeScalar = "a" + let zero: UnicodeScalar = "0" + switch character { + case "A"..."Z": + return character.value - uppercaseA.value + case "a"..."z": + return character.value - lowercaseA.value + case "0"..."9": + return uppercaseZ.value - uppercaseA.value + 1 + (UInt32(character.value - zero.value) % 5) + default: + return 31 + } + } + + var userHash: UInt32 = 0 + var hashValue: UInt32 = 0 + userName.unicodeScalars.map { hash(character: $0) }.forEach { + var h = $0 + if h != 0 { + h = ((h << hashValue) >> 8) | (h << hashValue) + } + hashValue = (hashValue + 5) & 7 + userHash = userHash ^ h + } + return UInt8(truncatingIfNeeded: userHash) + } + } +} + +extension BinaryInteger { + var hexRepresentation: String { + let hex = String(self, radix: 16, uppercase: true) + let byteCount = bitWidth / 4 + let padding = max(byteCount - hex.count, 0) + return String(repeating: "0", count: padding) + hex + } +} diff --git a/Sources/XcodeProject/Objects/PBXGlobalID.swift b/Sources/XcodeProject/Objects/PBXGlobalID.swift new file mode 100644 index 0000000..e60be67 --- /dev/null +++ b/Sources/XcodeProject/Objects/PBXGlobalID.swift @@ -0,0 +1,54 @@ +// +// PBXGlobalID.swift +// XcodeProject +// +// Created by Geoffrey Foster on 2018-12-02. +// + +import Foundation + +public struct PBXGlobalID: RawRepresentable { + public let rawValue: String + + public init(rawValue: String) { + self.rawValue = rawValue + } + + public init?(rawValue: String?) { + guard let rawValue = rawValue else { return nil } + self.init(rawValue: rawValue) + } + + public init() { + self.rawValue = PBXGlobalID.generator.next() + } + + static func ids(from strings: [String]?) -> [PBXGlobalID]? { + return strings?.compactMap { return PBXGlobalID(rawValue: $0) } + } + + private static var randomNumberGenerator: RandomNumberGenerator = SystemRandomNumberGenerator() + private static var generator: PBXGlobalID.Generator = PBXGlobalID.Generator(random: &randomNumberGenerator) +} + +extension PBXGlobalID: Hashable { + public var hashValue: Int { + return rawValue.hashValue + } + + public static func ==(lhs: PBXGlobalID, rhs: PBXGlobalID) -> Bool { + return lhs.rawValue == rhs.rawValue + } +} + +extension PBXGlobalID: Comparable { + public static func <(lhs: PBXGlobalID, rhs: PBXGlobalID) -> Bool { + return lhs.rawValue < rhs.rawValue + } +} + +extension PropertyList { + var globalID: PBXGlobalID? { + return PBXGlobalID(rawValue: self.string) + } +} diff --git a/Sources/XcodeProject/Objects/PBXObject+ID.swift b/Sources/XcodeProject/Objects/PBXObject+ID.swift deleted file mode 100644 index 35afac9..0000000 --- a/Sources/XcodeProject/Objects/PBXObject+ID.swift +++ /dev/null @@ -1,168 +0,0 @@ -// -// PBXObject.ID.swift -// XcodeProject -// -// Created by Geoffrey Foster on 2016-11-16. -// Copyright © 2017 Geoffrey Foster. All rights reserved. -// - -import Foundation -import GameplayKit - -extension PBXObject { - public struct ID: RawRepresentable { - public let rawValue: String - - public init(rawValue: String) { - self.rawValue = rawValue - } - - public init?(rawValue: String?) { - guard let rawValue = rawValue else { return nil } - self.init(rawValue: rawValue) - } - - public init() { - self.rawValue = PBXObject.ID.generator.next() - } - - static func ids(from strings: [String]?) -> [PBXObject.ID]? { - return strings?.compactMap { return PBXObject.ID(rawValue: $0) } - } - - private static var generator: IDGenerator = IDGenerator() - struct IDGenerator { - let userHash: UInt8 - let pidByte: UInt8 - let referenceDateFunc: () -> UInt32 - - private var initialSequence: UInt32 = 0 - private var randomSequence: UInt32 = 0 - private var lastTime: UInt32 = 0 - - private var randomConst: UInt32 = 0 - - init(userName: String = NSUserName(), processId: pid_t = getpid(), referenceDateFunc: @escaping () -> UInt32 = IDGenerator.referenceDate) { - self.userHash = IDGenerator.userHash(userName: userName) - self.pidByte = UInt8(truncatingIfNeeded: processId) - self.referenceDateFunc = referenceDateFunc - - let seed = UInt32(processId) << 16 | UInt32(gethostid()) ^ referenceDateFunc() - let source = GKLinearCongruentialRandomSource(seed: UInt64(seed)) - let random = GKRandomDistribution(randomSource: source, lowestValue: 0, highestValue: Int(Int32.max)) - - self.randomConst = UInt32(random.nextInt(upperBound: 0xff_ff_ff)) - self.randomSequence = UInt32(random.nextInt(upperBound: 0xff_ff)) - } - - mutating func next() -> String { - var refDate = referenceDateFunc() - randomSequence += 1 - if refDate > lastTime { - initialSequence = randomSequence - lastTime = refDate - } else { - if randomSequence == initialSequence { - lastTime += 1 - } - refDate = lastTime - } - - let components = [ - userHash.hexString, - pidByte.hexString, - randomSequence.hexString(size: 2), - refDate.hexString(size: 4), - randomConst.hexString(size: 4), - ] - return components.joined() - } - - static func referenceDate() -> UInt32 { - let timeInterval = Date().timeIntervalSinceReferenceDate - return UInt32(timeInterval) - } - - static func userHash(userName: String) -> UInt8 { - func hash(character: UnicodeScalar) -> Int32 { - switch character { - case "A"..."Z": - return character.ordinal - "A".ordinal - case "a"..."z": - return character.ordinal - "a".ordinal - case "0"..."9": - return "Z".ordinal - "A".ordinal + 1 + (Int32(character.ordinal - "0".ordinal) % 5) - default: - return 31 - } - } - - var userHash: Int32 = 0 - var hashValue: Int32 = 0 - - for character in userName.unicodeScalars { - var h = hash(character: character) - if h != 0 { - h = ((h << hashValue) >> 8) | (h << hashValue) - } - hashValue = (hashValue + 5) & 7 - userHash = userHash ^ h - } - return UInt8(truncatingIfNeeded: userHash) - } - } - } -} - -extension PBXObject.ID: Hashable { - public var hashValue: Int { - return rawValue.hashValue - } - - public static func ==(lhs: PBXObject.ID, rhs: PBXObject.ID) -> Bool { - return lhs.rawValue == rhs.rawValue - } -} - -extension PBXObject.ID: Comparable { - public static func <(lhs: PBXObject.ID, rhs: PBXObject.ID) -> Bool { - return lhs.rawValue < rhs.rawValue - } -} - -extension PropertyList { - var globalID: PBXObject.ID? { - return PBXObject.ID(rawValue: self.string) - } -} - -private extension String { - var ordinal: Int32 { - return Int32(UnicodeScalar(self)!.value) - } -} - -private extension UnicodeScalar { - var ordinal: Int32 { - return Int32(value) - } -} - -private extension UInt8 { - var hexString: String { - return String(format: "%02X", self) - } -} - -private extension UInt32 { - func hexString(size: UInt) -> String { - var value = self - var result: [String] = [] - for _ in 0..> 8 - } - result.reverse() - return result.joined() - } -} diff --git a/Sources/XcodeProject/Objects/PBXObject.swift b/Sources/XcodeProject/Objects/PBXObject.swift index df4a044..fb5c8ae 100644 --- a/Sources/XcodeProject/Objects/PBXObject.swift +++ b/Sources/XcodeProject/Objects/PBXObject.swift @@ -7,7 +7,7 @@ // public class PBXObject { - public let globalID: PBXObject.ID + public let globalID: PBXGlobalID public internal(set) weak var parent: PBXObject? { willSet { willMove(from: parent) @@ -17,7 +17,7 @@ public class PBXObject { } } - public required init(globalID: PBXObject.ID) { + public required init(globalID: PBXGlobalID) { self.globalID = globalID } diff --git a/Sources/XcodeProject/Objects/PBXProject.swift b/Sources/XcodeProject/Objects/PBXProject.swift index 7fe3c56..2a1fd19 100644 --- a/Sources/XcodeProject/Objects/PBXProject.swift +++ b/Sources/XcodeProject/Objects/PBXProject.swift @@ -21,6 +21,7 @@ public final class PBXProject: PBXObject, PBXContainer { case xcode6_3 = "Xcode 6.3" case xcode8_0 = "Xcode 8.0" case xcode9_3 = "Xcode 9.3" + case xcode_10 = "Xcode 10.0" } var compatibilityVersion: CompatibilityVersion = .xcode8_0 var developmentRegion: String = "English" @@ -48,12 +49,12 @@ public final class PBXProject: PBXObject, PBXContainer { return URL(fileURLWithPath: (path as NSString).deletingLastPathComponent) } - public internal(set) var objects: [PBXObject.ID: PBXObject] = [:] + public internal(set) var objects: [PBXGlobalID: PBXObject] = [:] - public required init(globalID: PBXObject.ID) { + public required init(globalID: PBXGlobalID) { self.buildConfigurationList = XCConfigurationList() - self.mainGroup = PBXGroup(globalID: PBXObject.ID()) - self.productRefGroup = PBXGroup(globalID: PBXObject.ID(), name: "Products") + self.mainGroup = PBXGroup(globalID: PBXGlobalID()) + self.productRefGroup = PBXGroup(globalID: PBXGlobalID(), name: "Products") super.init(globalID: globalID) self.buildConfigurationList.parent = self @@ -64,7 +65,7 @@ public final class PBXProject: PBXObject, PBXContainer { } public convenience init() { - self.init(globalID: PBXObject.ID()) + self.init(globalID: PBXGlobalID()) } override func update(with plist: PropertyList, objectCache: ObjectCache) { @@ -72,14 +73,14 @@ public final class PBXProject: PBXObject, PBXContainer { guard let attributes = plist["attributes"]?.dictionary, - let buildConfigurationListID = PBXObject.ID(rawValue: plist["buildConfigurationList"]?.string), + let buildConfigurationListID = PBXGlobalID(rawValue: plist["buildConfigurationList"]?.string), let buildConfigurationList = objectCache.object(for: buildConfigurationListID) as? XCConfigurationList, let compatibilityVersion = CompatibilityVersion(rawValue: plist["compatibilityVersion"]?.string ?? ""), let developmentRegion = plist["developmentRegion"]?.string, let hasScannedForEncodings = plist["hasScannedForEncodings"]?.string, let knownRegions = plist["knownRegions"]?.array, - let mainGroup = objectCache.object(for: PBXObject.ID(rawValue: plist["mainGroup"]?.string)) as? PBXGroup, - let productRefGroup = objectCache.object(for: PBXObject.ID(rawValue: plist["productRefGroup"]?.string)) as? PBXGroup, + let mainGroup = objectCache.object(for: PBXGlobalID(rawValue: plist["mainGroup"]?.string)) as? PBXGroup, + let productRefGroup = objectCache.object(for: PBXGlobalID(rawValue: plist["productRefGroup"]?.string)) as? PBXGroup, let projectDirPath = plist["projectDirPath"]?.string, let projectRoot = plist["projectRoot"]?.string, let targets = plist["targets"]?.array @@ -100,10 +101,10 @@ public final class PBXProject: PBXObject, PBXContainer { if let projectReferences = plist["projectReferences"]?.object as? [[String: String]] { self.projectReferences = projectReferences.compactMap { projectReference in guard - let projectRefId = PBXObject.ID(rawValue: projectReference["ProjectRef"]), + let projectRefId = PBXGlobalID(rawValue: projectReference["ProjectRef"]), let projectRef = objectCache.object(for: projectRefId) as? PBXFileReference, - let productGroupId = PBXObject.ID(rawValue: projectReference["ProductGroup"]), + let productGroupId = PBXGlobalID(rawValue: projectReference["ProductGroup"]), let productGroup = objectCache.object(for: productGroupId) else { return nil @@ -114,7 +115,7 @@ public final class PBXProject: PBXObject, PBXContainer { self.projectRoot = projectRoot self.targets = targets.compactMap { - let target: PBXTarget? = objectCache.object(for: PBXObject.ID(rawValue: $0)) + let target: PBXTarget? = objectCache.object(for: PBXGlobalID(rawValue: $0)) return target } diff --git a/Sources/XcodeProject/Objects/References/PBXFileReference.swift b/Sources/XcodeProject/Objects/References/PBXFileReference.swift index d2fc384..45d5441 100644 --- a/Sources/XcodeProject/Objects/References/PBXFileReference.swift +++ b/Sources/XcodeProject/Objects/References/PBXFileReference.swift @@ -41,12 +41,12 @@ public final class PBXFileReference: PBXReference { public private(set) var fileType: FileType = .unknown public internal(set) var xcLanguageSpecificationIdentifier: String? // TODO: this should be a PBXFileType (xcode.lang.swift) - public required init(globalID: PBXObject.ID) { + public required init(globalID: PBXGlobalID) { super.init(globalID: globalID) } - public required init(globalID: PBXObject.ID, name: String? = nil, path: String? = nil, sourceTree: SourceTree? = .group) { - super.init(globalID: PBXObject.ID(), name: name, path: path, sourceTree: sourceTree) + public required init(globalID: PBXGlobalID, name: String? = nil, path: String? = nil, sourceTree: SourceTree? = .group) { + super.init(globalID: PBXGlobalID(), name: name, path: path, sourceTree: sourceTree) if let path = path, let xcodeType = PBXFileType.fileType(filePath: path)?.xcodeType { self.fileType = .lastKnown(xcodeType) do { diff --git a/Sources/XcodeProject/Objects/References/PBXGroup.swift b/Sources/XcodeProject/Objects/References/PBXGroup.swift index 006b3f8..6b41b77 100644 --- a/Sources/XcodeProject/Objects/References/PBXGroup.swift +++ b/Sources/XcodeProject/Objects/References/PBXGroup.swift @@ -31,7 +31,7 @@ public class PBXGroup: PBXReference { override func update(with plist: PropertyList, objectCache: ObjectCache) { super.update(with: plist, objectCache: objectCache) - self.children = plist["children"]?.array?.map { return PBXObject.ID(rawValue: $0) }.compactMap { objectCache.object(for: $0) as? PBXReference } ?? [] + self.children = plist["children"]?.array?.map { return PBXGlobalID(rawValue: $0) }.compactMap { objectCache.object(for: $0) as? PBXReference } ?? [] } override func visit(_ visitor: ObjectVisitor) { diff --git a/Sources/XcodeProject/Objects/References/PBXReference.swift b/Sources/XcodeProject/Objects/References/PBXReference.swift index 064ce63..e71917b 100644 --- a/Sources/XcodeProject/Objects/References/PBXReference.swift +++ b/Sources/XcodeProject/Objects/References/PBXReference.swift @@ -24,9 +24,9 @@ public class PBXReference: PBXObject { case crlf = 2 } - var path: String? - var name: String? - var sourceTree: SourceTree? + public internal(set) var path: String? + public internal(set) var name: String? + public internal(set) var sourceTree: SourceTree? var usesTabs: Bool? var tabWidth: Int? var lineEnding: LineEnding? @@ -52,11 +52,11 @@ public class PBXReference: PBXObject { return "" } - public required init(globalID: PBXObject.ID) { + public required init(globalID: PBXGlobalID) { super.init(globalID: globalID) } - public required init(globalID: PBXObject.ID, name: String? = nil, path: String? = nil, sourceTree: SourceTree? = .group) { + public required init(globalID: PBXGlobalID, name: String? = nil, path: String? = nil, sourceTree: SourceTree? = .group) { super.init(globalID: globalID) self.name = name self.path = path diff --git a/Sources/XcodeProject/Objects/References/PBXReferenceProxy.swift b/Sources/XcodeProject/Objects/References/PBXReferenceProxy.swift index 68f30cc..65bc785 100644 --- a/Sources/XcodeProject/Objects/References/PBXReferenceProxy.swift +++ b/Sources/XcodeProject/Objects/References/PBXReferenceProxy.swift @@ -27,7 +27,7 @@ public final class PBXReferenceProxy: PBXReference { override func update(with plist: PropertyList, objectCache: ObjectCache) { super.update(with: plist, objectCache: objectCache) self.fileType = plist["fileType"]?.string - self.remoteRef = objectCache.object(for: PBXObject.ID(rawValue: plist["remoteRef"]?.string)) as? PBXContainerItemProxy + self.remoteRef = objectCache.object(for: PBXGlobalID(rawValue: plist["remoteRef"]?.string)) as? PBXContainerItemProxy self.sourceTree = sourceTree } diff --git a/Sources/XcodeProject/Objects/References/XCVersionGroup.swift b/Sources/XcodeProject/Objects/References/XCVersionGroup.swift index 9bb7e65..bf4e40f 100644 --- a/Sources/XcodeProject/Objects/References/XCVersionGroup.swift +++ b/Sources/XcodeProject/Objects/References/XCVersionGroup.swift @@ -28,7 +28,7 @@ public final class XCVersionGroup: PBXGroup { super.update(with: plist, objectCache: objectCache) guard - let currentVersion = objectCache.object(for: PBXObject.ID(rawValue: plist["currentVersion"]?.string)) as? PBXFileReference, + let currentVersion = objectCache.object(for: PBXGlobalID(rawValue: plist["currentVersion"]?.string)) as? PBXFileReference, let versionGroupType = plist["versionGroupType"]?.string else { fatalError() diff --git a/Sources/XcodeProject/Objects/Targets/PBXAggregateTarget.swift b/Sources/XcodeProject/Objects/Targets/PBXAggregateTarget.swift index 18eb189..467be58 100644 --- a/Sources/XcodeProject/Objects/Targets/PBXAggregateTarget.swift +++ b/Sources/XcodeProject/Objects/Targets/PBXAggregateTarget.swift @@ -9,7 +9,7 @@ public final class PBXAggregateTarget: PBXTarget { public override func addBuildPhase() -> T? { if T.self == PBXCopyFilesBuildPhase.self || T.self == PBXShellScriptBuildPhase.self { - return T(globalID: PBXObject.ID()) + return T(globalID: PBXGlobalID()) } return nil } diff --git a/Sources/XcodeProject/Objects/Targets/PBXNativeTarget.swift b/Sources/XcodeProject/Objects/Targets/PBXNativeTarget.swift index 7284eae..f2bbbdc 100644 --- a/Sources/XcodeProject/Objects/Targets/PBXNativeTarget.swift +++ b/Sources/XcodeProject/Objects/Targets/PBXNativeTarget.swift @@ -51,7 +51,7 @@ public final class PBXNativeTarget: PBXTarget { public override func addBuildPhase() -> T? { var phase: T? if T.self == PBXCopyFilesBuildPhase.self || T.self == PBXShellScriptBuildPhase.self { - phase = T(globalID: PBXObject.ID()) + phase = T(globalID: PBXGlobalID()) } let acceptablePhases: [PBXBuildPhase.Type] = [ @@ -62,7 +62,7 @@ public final class PBXNativeTarget: PBXTarget { ] if acceptablePhases.contains(where: { return T.self == $0 }) && !buildPhases.contains(where: { type(of: $0) == T.self }) { - phase = T(globalID: PBXObject.ID()) + phase = T(globalID: PBXGlobalID()) } if let phase = phase { diff --git a/Sources/XcodeProject/Objects/Targets/PBXTarget.swift b/Sources/XcodeProject/Objects/Targets/PBXTarget.swift index e18e01c..a36c0ef 100644 --- a/Sources/XcodeProject/Objects/Targets/PBXTarget.swift +++ b/Sources/XcodeProject/Objects/Targets/PBXTarget.swift @@ -66,7 +66,7 @@ public class PBXTarget: PBXObject, PBXContainer { super.update(with: plist, objectCache: objectCache) guard - let buildConfigurationListID = PBXObject.ID(rawValue: plist["buildConfigurationList"]?.string), + let buildConfigurationListID = PBXGlobalID(rawValue: plist["buildConfigurationList"]?.string), let buildConfigurationList = objectCache.object(for: buildConfigurationListID) as? XCConfigurationList, let buildPhases = plist["buildPhases"]?.array, let dependencies = plist["dependencies"]?.array, @@ -77,16 +77,16 @@ public class PBXTarget: PBXObject, PBXContainer { } self.name = name self.productName = productName - self.productReference = objectCache.object(for: PBXObject.ID(rawValue: plist["productReference"]?.string)) as? PBXFileReference + self.productReference = objectCache.object(for: PBXGlobalID(rawValue: plist["productReference"]?.string)) as? PBXFileReference self.buildConfigurationList = buildConfigurationList self.buildPhases = buildPhases.compactMap { - return objectCache.object(for: PBXObject.ID(rawValue: $0)) as? PBXBuildPhase + return objectCache.object(for: PBXGlobalID(rawValue: $0)) as? PBXBuildPhase } self.buildRules = plist["buildRules"]?.array?.compactMap { - return objectCache.object(for: PBXObject.ID(rawValue: $0)) as? PBXBuildRule + return objectCache.object(for: PBXGlobalID(rawValue: $0)) as? PBXBuildRule } self.dependencies = dependencies.compactMap { - return objectCache.object(for: PBXObject.ID(rawValue: $0)) as? PBXTargetDependency + return objectCache.object(for: PBXGlobalID(rawValue: $0)) as? PBXTargetDependency } } @@ -118,3 +118,13 @@ public class PBXTarget: PBXObject, PBXContainer { return plist } } + +extension PBXTarget { + public var resourcesBuildPhase: PBXResourcesBuildPhase? { + return buildPhases(type: PBXResourcesBuildPhase.self).first + } + + private func buildPhases(type: T.Type) -> [T] { + return buildPhases.compactMap { $0 as? T } + } +} diff --git a/Sources/XcodeProject/Objects/XCBuildConfiguration.swift b/Sources/XcodeProject/Objects/XCBuildConfiguration.swift index d5df739..924efa2 100644 --- a/Sources/XcodeProject/Objects/XCBuildConfiguration.swift +++ b/Sources/XcodeProject/Objects/XCBuildConfiguration.swift @@ -14,7 +14,7 @@ final class XCBuildConfiguration: PBXObject { var baseConfigurationReference: PBXFileReference? public convenience init(name: String, buildSettings: BuildSettings) { - self.init(globalID: PBXObject.ID()) + self.init(globalID: PBXGlobalID()) self.name = name self.buildSettings = buildSettings diff --git a/Sources/XcodeProject/Objects/XCConfigurationList.swift b/Sources/XcodeProject/Objects/XCConfigurationList.swift index 7b6441f..cc2bc4d 100644 --- a/Sources/XcodeProject/Objects/XCConfigurationList.swift +++ b/Sources/XcodeProject/Objects/XCConfigurationList.swift @@ -16,7 +16,7 @@ final class XCConfigurationList: PBXObject { var defaultConfigurationName: String? public convenience init() { - self.init(globalID: PBXObject.ID()) + self.init(globalID: PBXGlobalID()) self.buildConfigurations = [ XCBuildConfiguration(name: "Debug", buildSettings: BuildSettings([:])), @@ -39,7 +39,7 @@ final class XCConfigurationList: PBXObject { super.update(with: plist, objectCache: objectCache) guard - let buildConfigurations = PBXObject.ID.ids(from: plist["buildConfigurations"]?.array), + let buildConfigurations = PBXGlobalID.ids(from: plist["buildConfigurations"]?.array), let defaultConfigurationIsVisibleString = plist["defaultConfigurationIsVisible"]?.string else { fatalError() diff --git a/Sources/XcodeProject/ProjectFile.swift b/Sources/XcodeProject/ProjectFile.swift index 7708b89..3480ff7 100644 --- a/Sources/XcodeProject/ProjectFile.swift +++ b/Sources/XcodeProject/ProjectFile.swift @@ -28,12 +28,13 @@ public final class ProjectFile { case xcode63 = 47 case xcode8 = 48 case xcode93 = 50 + case xcode10 = 51 } var archiveVersion: UInt = 1 var objectVersion: ObjectVersion = .xcode8 var classes: [AnyHashable: Any] = [:] - var rootObject: PBXObject.ID + var rootObject: PBXGlobalID /// The root project structure public private(set) var project: PBXProject @@ -65,7 +66,7 @@ public final class ProjectFile { guard let archiveVersionString = plist[RootKey.archiveVersion] as? String, let archiveVersion = UInt(archiveVersionString), let objectVersionString = plist[RootKey.objectVersion] as? String, let objectVersionInt = UInt(objectVersionString), let objectVersion = ObjectVersion(rawValue: objectVersionInt), - let rootObject = PBXObject.ID(rawValue: plist[RootKey.rootObject] as? String), + let rootObject = PBXGlobalID(rawValue: plist[RootKey.rootObject] as? String), let classes = plist[RootKey.classes] as? [AnyHashable: Any], classes.isEmpty else { throw Error.invalidPlist diff --git a/Tests/XcodeProjectTests/PBXGlobalIDTests.swift b/Tests/XcodeProjectTests/PBXGlobalIDTests.swift new file mode 100644 index 0000000..45c6685 --- /dev/null +++ b/Tests/XcodeProjectTests/PBXGlobalIDTests.swift @@ -0,0 +1,36 @@ +// +// PBXGlobalIDTests.swift +// XcodeProject +// +// Created by Geoffrey Foster on 2016-12-22. +// Copyright © 2017 Geoffrey Foster. All rights reserved. +// + +import XCTest +@testable import XcodeProject + +class PBXGlobalIDTests: XCTestCase { + struct FakeRandomGenerator: RandomNumberGenerator { + private var value: UInt64 = 1234567890 + mutating func next() -> UInt64 { + defer { value += 1 } + return value + } + } + + func mockDateGenerator() -> Date { + let components = DateComponents(timeZone: TimeZone(secondsFromGMT: 0), year: 2014, month: 07, day: 29, hour: 17, minute: 04, second: 20) + let date = Calendar(identifier: .gregorian).date(from: components) + return date! + } + + func testIDGeneration() { + let processId: pid_t = 50_000 + var randomNumberGenerator: RandomNumberGenerator = FakeRandomGenerator() + var generator = PBXGlobalID.Generator(userName: "XcodeProject", processId: processId, random: &randomNumberGenerator, referenceDateGenerator: mockDateGenerator) + XCTAssertEqual("8C5002D419880B94009602D2", generator.next()) + XCTAssertEqual("8C5002D519880B94009602D2", generator.next()) + XCTAssertEqual("8C5002D619880B94009602D2", generator.next()) + XCTAssertEqual("8C5002D719880B94009602D2", generator.next()) + } +} diff --git a/Tests/XcodeProjectTests/PBXObjectIDTests.swift b/Tests/XcodeProjectTests/PBXObjectIDTests.swift deleted file mode 100644 index db280db..0000000 --- a/Tests/XcodeProjectTests/PBXObjectIDTests.swift +++ /dev/null @@ -1,21 +0,0 @@ -// -// PBXObjectIDTests.swift -// XcodeProject -// -// Created by Geoffrey Foster on 2016-12-22. -// Copyright © 2017 Geoffrey Foster. All rights reserved. -// - -import XCTest -@testable import XcodeProject - -class PBXObjectIDTests: XCTestCase { - - func testIDGeneration() { - var generator = PBXObject.ID.IDGenerator(userName: "XcodeProject", processId: 50_000, referenceDateFunc: { () -> UInt32 in - return 0 - }) - let id = generator.next() - XCTAssertEqual("8C50563000000000008D092D", id) - } -} diff --git a/XcodeProject.xcodeproj/project.pbxproj b/XcodeProject.xcodeproj/project.pbxproj index 0658468..58a5dbe 100644 --- a/XcodeProject.xcodeproj/project.pbxproj +++ b/XcodeProject.xcodeproj/project.pbxproj @@ -13,7 +13,7 @@ 6C26440A1E11C80A0057CFA4 /* PBXPListUnarchiver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643E61E11C80A0057CFA4 /* PBXPListUnarchiver.swift */; }; 6C26440B1E11C80A0057CFA4 /* PListArchivable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643E71E11C80A0057CFA4 /* PListArchivable.swift */; }; 6C26440C1E11C80A0057CFA4 /* PropertyList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643E81E11C80A0057CFA4 /* PropertyList.swift */; }; - 6C26440D1E11C80A0057CFA4 /* PBXObject+ID.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643EA1E11C80A0057CFA4 /* PBXObject+ID.swift */; }; + 6C26440D1E11C80A0057CFA4 /* PBXGlobalID.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643EA1E11C80A0057CFA4 /* PBXGlobalID.swift */; }; 6C26440E1E11C80A0057CFA4 /* PBXAggregateTarget.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643EC1E11C80A0057CFA4 /* PBXAggregateTarget.swift */; }; 6C26440F1E11C80A0057CFA4 /* PBXBuildFile.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643ED1E11C80A0057CFA4 /* PBXBuildFile.swift */; }; 6C2644101E11C80A0057CFA4 /* PBXBuildPhase.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C2643EE1E11C80A0057CFA4 /* PBXBuildPhase.swift */; }; @@ -44,12 +44,13 @@ 6C82B6841FFC03180040FD50 /* Workspace.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C82B6831FFC03180040FD50 /* Workspace.swift */; }; 6CD2228D1DDD5C180058C7CD /* XcodeProject.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6CD222831DDD5C180058C7CD /* XcodeProject.framework */; }; 6CD222921DDD5C180058C7CD /* XcodeProjectTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CD222911DDD5C180058C7CD /* XcodeProjectTests.swift */; }; - 6CE0F78A1E0C69FC001DF692 /* PBXObjectIDTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE0F7891E0C69FC001DF692 /* PBXObjectIDTests.swift */; }; + 6CE0F78A1E0C69FC001DF692 /* PBXGlobalIDTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE0F7891E0C69FC001DF692 /* PBXGlobalIDTests.swift */; }; 6CE346AD1FE9B2E400EFF588 /* PBXGroup+Sorting.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE346AC1FE9B2E400EFF588 /* PBXGroup+Sorting.swift */; }; 6CE346AF1FE9B45E00EFF588 /* PBXGroup+FolderSync.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE346AE1FE9B45E00EFF588 /* PBXGroup+FolderSync.swift */; }; 6CE346B11FE9B4F600EFF588 /* PBXReference+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE346B01FE9B4F600EFF588 /* PBXReference+Extensions.swift */; }; 6CE346CC1FECA29100EFF588 /* PBXTarget+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE346CB1FECA29100EFF588 /* PBXTarget+Extensions.swift */; }; 6CE346CE1FECAF7C00EFF588 /* PBXFileType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE346CD1FECAF7C00EFF588 /* PBXFileType.swift */; }; + 6CE3A46E21B782E500C4C039 /* PBXGlobalID+Generator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE3A46D21B782E500C4C039 /* PBXGlobalID+Generator.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -69,7 +70,7 @@ 6C2643E61E11C80A0057CFA4 /* PBXPListUnarchiver.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PBXPListUnarchiver.swift; sourceTree = ""; }; 6C2643E71E11C80A0057CFA4 /* PListArchivable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PListArchivable.swift; sourceTree = ""; }; 6C2643E81E11C80A0057CFA4 /* PropertyList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PropertyList.swift; sourceTree = ""; }; - 6C2643EA1E11C80A0057CFA4 /* PBXObject+ID.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PBXObject+ID.swift"; sourceTree = ""; }; + 6C2643EA1E11C80A0057CFA4 /* PBXGlobalID.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PBXGlobalID.swift; sourceTree = ""; }; 6C2643EC1E11C80A0057CFA4 /* PBXAggregateTarget.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PBXAggregateTarget.swift; sourceTree = ""; }; 6C2643ED1E11C80A0057CFA4 /* PBXBuildFile.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PBXBuildFile.swift; sourceTree = ""; }; 6C2643EE1E11C80A0057CFA4 /* PBXBuildPhase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PBXBuildPhase.swift; sourceTree = ""; }; @@ -102,12 +103,13 @@ 6CD222831DDD5C180058C7CD /* XcodeProject.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = XcodeProject.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 6CD2228C1DDD5C180058C7CD /* XcodeProjectTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = XcodeProjectTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 6CD222911DDD5C180058C7CD /* XcodeProjectTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = XcodeProjectTests.swift; sourceTree = ""; }; - 6CE0F7891E0C69FC001DF692 /* PBXObjectIDTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PBXObjectIDTests.swift; sourceTree = ""; }; + 6CE0F7891E0C69FC001DF692 /* PBXGlobalIDTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PBXGlobalIDTests.swift; sourceTree = ""; }; 6CE346AC1FE9B2E400EFF588 /* PBXGroup+Sorting.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PBXGroup+Sorting.swift"; sourceTree = ""; }; 6CE346AE1FE9B45E00EFF588 /* PBXGroup+FolderSync.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PBXGroup+FolderSync.swift"; sourceTree = ""; }; 6CE346B01FE9B4F600EFF588 /* PBXReference+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PBXReference+Extensions.swift"; sourceTree = ""; }; 6CE346CB1FECA29100EFF588 /* PBXTarget+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "PBXTarget+Extensions.swift"; sourceTree = ""; }; 6CE346CD1FECAF7C00EFF588 /* PBXFileType.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PBXFileType.swift; sourceTree = ""; }; + 6CE3A46D21B782E500C4C039 /* PBXGlobalID+Generator.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "PBXGlobalID+Generator.swift"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -168,12 +170,13 @@ 6C2643EB1E11C80A0057CFA4 /* Objects */ = { isa = PBXGroup; children = ( + 6CE3A46D21B782E500C4C039 /* PBXGlobalID+Generator.swift */, 6C2643ED1E11C80A0057CFA4 /* PBXBuildFile.swift */, 6C2643EF1E11C80A0057CFA4 /* PBXBuildRule.swift */, 6C2643F01E11C80A0057CFA4 /* PBXContainerItemProxy.swift */, 6CE346CD1FECAF7C00EFF588 /* PBXFileType.swift */, 6C2643F81E11C80A0057CFA4 /* PBXObject.swift */, - 6C2643EA1E11C80A0057CFA4 /* PBXObject+ID.swift */, + 6C2643EA1E11C80A0057CFA4 /* PBXGlobalID.swift */, 6C2643FA1E11C80A0057CFA4 /* PBXProject.swift */, 6C2644011E11C80A0057CFA4 /* PBXTargetDependency.swift */, 6C2644031E11C80A0057CFA4 /* XCBuildConfiguration.swift */, @@ -254,7 +257,7 @@ 6CD222901DDD5C180058C7CD /* XcodeProjectTests */ = { isa = PBXGroup; children = ( - 6CE0F7891E0C69FC001DF692 /* PBXObjectIDTests.swift */, + 6CE0F7891E0C69FC001DF692 /* PBXGlobalIDTests.swift */, 6CD222911DDD5C180058C7CD /* XcodeProjectTests.swift */, ); name = XcodeProjectTests; @@ -334,11 +337,12 @@ TargetAttributes = { 6CD222821DDD5C170058C7CD = { CreatedOnToolsVersion = 8.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 1010; ProvisioningStyle = Automatic; }; 6CD2228B1DDD5C180058C7CD = { CreatedOnToolsVersion = 8.1; + LastSwiftMigration = 1010; ProvisioningStyle = Automatic; }; }; @@ -395,7 +399,7 @@ 6C82B6841FFC03180040FD50 /* Workspace.swift in Sources */, 6CE346CC1FECA29100EFF588 /* PBXTarget+Extensions.swift in Sources */, 6C26440A1E11C80A0057CFA4 /* PBXPListUnarchiver.swift in Sources */, - 6C26440D1E11C80A0057CFA4 /* PBXObject+ID.swift in Sources */, + 6C26440D1E11C80A0057CFA4 /* PBXGlobalID.swift in Sources */, 6CE346AD1FE9B2E400EFF588 /* PBXGroup+Sorting.swift in Sources */, 6C2644181E11C80A0057CFA4 /* PBXLegacyTarget.swift in Sources */, 6C2644251E11C80A0057CFA4 /* XCBuildConfiguration.swift in Sources */, @@ -414,6 +418,7 @@ 6C2644131E11C80A0057CFA4 /* PBXCopyFilesBuildPhase.swift in Sources */, 6C2644271E11C80A0057CFA4 /* XCVersionGroup.swift in Sources */, 6CE346CE1FECAF7C00EFF588 /* PBXFileType.swift in Sources */, + 6CE3A46E21B782E500C4C039 /* PBXGlobalID+Generator.swift in Sources */, 6C2644161E11C80A0057CFA4 /* PBXGroup.swift in Sources */, 6C2644241E11C80A0057CFA4 /* PBXVariantGroup.swift in Sources */, 6C26441E1E11C80A0057CFA4 /* PBXReferenceProxy.swift in Sources */, @@ -429,7 +434,7 @@ buildActionMask = 2147483647; files = ( 6CD222921DDD5C180058C7CD /* XcodeProjectTests.swift in Sources */, - 6CE0F78A1E0C69FC001DF692 /* PBXObjectIDTests.swift in Sources */, + 6CE0F78A1E0C69FC001DF692 /* PBXGlobalIDTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -576,7 +581,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -597,7 +602,7 @@ PRODUCT_BUNDLE_IDENTIFIER = "net.g-Off.XcodeProject"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; }; @@ -609,7 +614,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.g-Off.XcodeProjectTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Debug; }; @@ -621,7 +626,7 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "net.g-Off.XcodeProjectTests"; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 4.0; + SWIFT_VERSION = 4.2; }; name = Release; };