Cross-platform Xcode replacement. Build and deploy iOS apps with SwiftPM on Linux, Windows, macOS.
Bump deployment to macOS 13, iOS 16 (#173)
Kabir Oberai9af49f6f087e
diff --git a/Package.resolved b/Package.resolvedindex a3710bb..44148f3 100644--- a/Package.resolved+++ b/Package.resolved@@ -1,5 +1,5 @@{- "originHash" : "de0ee1f4006f7db9e9d699d71226e89e1a5004a7a72dc088c0d3967f0c8ae38c",+ "originHash" : "516b5e980db8502fa572d65f5259860fbc63321c9baf2198154bc77168a041cc","pins" : [{"identity" : "aexml",@@ -15,8 +15,8 @@"kind" : "remoteSourceControl","location" : "https://github.com/swift-server/async-http-client.git","state" : {- "revision" : "7dc119c7edf3c23f52638faadb89182861dee853",- "version" : "1.28.0"+ "revision" : "8430dd49d4e2b417f472141805c9691ec2923cb8",+ "version" : "1.29.0"}},{@@ -96,8 +96,8 @@"kind" : "remoteSourceControl","location" : "https://github.com/apple/swift-argument-parser","state" : {- "revision" : "309a47b2b1d9b5e991f36961c983ecec72275be3",- "version" : "1.6.1"+ "revision" : "cdd0ef3755280949551dc26dee5de9ddeda89f54",+ "version" : "1.6.2"}},{@@ -150,8 +150,8 @@"kind" : "remoteSourceControl","location" : "https://github.com/apple/swift-collections","state" : {- "revision" : "8c0c0a8b49e080e54e5e328cc552821ff07cd341",- "version" : "1.2.1"+ "revision" : "7b847a3b7008b2dc2f47ca3110d8c782fb2e5c7e",+ "version" : "1.3.0"}},{@@ -181,10 +181,19 @@"version" : "1.10.0"}},+ {+ "identity" : "swift-distributed-tracing",+ "kind" : "remoteSourceControl",+ "location" : "https://github.com/apple/swift-distributed-tracing.git",+ "state" : {+ "revision" : "baa932c1336f7894145cbaafcd34ce2dd0b77c97",+ "version" : "1.3.1"+ }+ },{"identity" : "swift-docc-plugin","kind" : "remoteSourceControl",- "location" : "https://github.com/apple/swift-docc-plugin",+ "location" : "https://github.com/swiftlang/swift-docc-plugin","state" : {"revision" : "3e4f133a77e644a5812911a0513aeb7288b07d06","version" : "1.4.5"@@ -267,8 +276,8 @@"kind" : "remoteSourceControl","location" : "https://github.com/apple/swift-nio-transport-services.git","state" : {- "revision" : "e645014baea2ec1c2db564410c51a656cf47c923",- "version" : "1.25.1"+ "revision" : "df6c28355051c72c884574a6c858bc54f7311ff9",+ "version" : "1.25.2"}},{@@ -312,8 +321,17 @@"kind" : "remoteSourceControl","location" : "https://github.com/apple/swift-openapi-urlsession","state" : {- "revision" : "6fac6f7c428d5feea2639b5f5c8b06ddfb79434b",- "version" : "1.1.0"+ "revision" : "279aa6b77be6aa842a4bf3c45fa79fa15edf3e07",+ "version" : "1.2.0"+ }+ },+ {+ "identity" : "swift-service-context",+ "kind" : "remoteSourceControl",+ "location" : "https://github.com/apple/swift-service-context.git",+ "state" : {+ "revision" : "1983448fefc717a2bc2ebde5490fe99873c5b8a6",+ "version" : "1.2.1"}},{@@ -321,8 +339,8 @@"kind" : "remoteSourceControl","location" : "https://github.com/swift-server/swift-service-lifecycle.git","state" : {- "revision" : "e7187309187695115033536e8fc9b2eb87fd956d",- "version" : "2.8.0"+ "revision" : "0fcc4c9c2d58dd98504c06f7308c86de775396ff",+ "version" : "2.9.0"}},{@@ -339,8 +357,8 @@"kind" : "remoteSourceControl","location" : "https://github.com/apple/swift-system","state" : {- "revision" : "395a77f0aa927f0ff73941d7ac35f2b46d47c9db",- "version" : "1.6.3"+ "revision" : "61e4ca4b81b9e09e2ec863b00c340eb13497dac6",+ "version" : "1.5.0"}},{@@ -411,8 +429,8 @@"kind" : "remoteSourceControl","location" : "https://github.com/pointfreeco/xctest-dynamic-overlay","state" : {- "revision" : "b2ed9eabefe56202ee4939dd9fc46b6241c88317",- "version" : "1.6.1"+ "revision" : "4c27acf5394b645b70d8ba19dc249c0472d5f618",+ "version" : "1.7.0"}},{diff --git a/Package.swift b/Package.swiftindex a1e26ff..546a73d 100644--- a/Package.swift+++ b/Package.swift@@ -22,8 +22,8 @@ let cSettings: [CSetting] = [let package = Package(name: "xtool",platforms: [- .iOS(.v15),- .macOS(.v12),+ .iOS(.v16),+ .macOS(.v13),],products: [.library(@@ -53,7 +53,8 @@ let package = Package(.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.0.0"),.package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0"),.package(url: "https://github.com/apple/swift-nio", from: "2.77.0"),- .package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),++ .package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.23.0"),.package(url: "https://github.com/swift-server/swift-openapi-async-http-client", from: "1.0.0"),diff --git a/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift b/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swiftindex 88658fc..4cee00a 100644--- a/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift+++ b/Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift@@ -174,7 +174,7 @@ public struct ADIDataProvider: AnisetteDataProvider {.acceptLanguage: "en_US",.init(AnisetteData.localUserIDKey)!: self.localUserID,]- request.headerFields[.init("X-MMe-Country")!] = Locale.current.regionCode+ request.headerFields[.init("X-MMe-Country")!] = Locale.current.region?.identifierrequest.headerFields[.init(DeviceInfo.clientInfoKey)!] = try await clientInfo()request.headerFields[.init(DeviceInfo.deviceIDKey)!] = self.localUserUID.uuidStringdiff --git a/Sources/XKit/GrandSlam/Anisette/AnisetteData.swift b/Sources/XKit/GrandSlam/Anisette/AnisetteData.swiftindex 4d93d31..810a48a 100644--- a/Sources/XKit/GrandSlam/Anisette/AnisetteData.swift+++ b/Sources/XKit/GrandSlam/Anisette/AnisetteData.swift@@ -54,7 +54,8 @@ public struct AnisetteData {var dictionary: [String: String] {// GSA doesn't like "en_US@rg=..."; it has to be just "en_US".- let localeIdentifier = if let language = locale.languageCode, let region = locale.regionCode {+ let localeIdentifier = if let language = locale.language.languageCode?.identifier,+ let region = locale.region?.identifier {"\(language)_\(region)"} else {"en_US"diff --git a/Sources/XKit/GrandSlam/Anisette/DeviceInfo+Fetching.swift b/Sources/XKit/GrandSlam/Anisette/DeviceInfo+Fetching.swiftindex 72e9bbd..ab0ad0b 100644--- a/Sources/XKit/GrandSlam/Anisette/DeviceInfo+Fetching.swift+++ b/Sources/XKit/GrandSlam/Anisette/DeviceInfo+Fetching.swift@@ -56,13 +56,14 @@ extension DeviceInfo {private static func fetchHardwareModel() -> String? {var modelSize = 0- guard sysctlbyname("hw.model", nil, &modelSize, nil, 0) == 0 else { return nil }- guard let rawString = malloc(modelSize) else { return nil }- guard sysctlbyname("hw.model", rawString, &modelSize, nil, 0) == 0 else {- free(rawString)- return nil+ guard sysctlbyname("hw.model", nil, &modelSize, nil, 0) == 0,+ modelSize > 0 else { return nil }+ return String(unsafeUninitializedCapacity: modelSize) { buf in+ var len = modelSize+ guard sysctlbyname("hw.model", buf.baseAddress, &len, nil, 0) == 0,+ len == modelSize else { return 0 }+ return len - 1 // exclude NUL}- return String(bytesNoCopy: rawString, length: modelSize - 1, encoding: .utf8, freeWhenDone: true)}public static func current() -> DeviceInfo? {diff --git a/Sources/XKit/GrandSlam/Lookup/GrandSlamLookupManager.swift b/Sources/XKit/GrandSlam/Lookup/GrandSlamLookupManager.swiftindex 3cabcb7..d734ba3 100644--- a/Sources/XKit/GrandSlam/Lookup/GrandSlamLookupManager.swift+++ b/Sources/XKit/GrandSlam/Lookup/GrandSlamLookupManager.swift@@ -45,7 +45,7 @@ actor GrandSlamLookupManager {.init(AnisetteData.timeZoneKey)!: TimeZone.current.identifier,.init("X-Apple-I-TimeZone-Offset")!: "\(TimeZone.current.secondsFromGMT())"]- request.headerFields[.init("X-MMe-Country")!] = Locale.current.regionCode+ request.headerFields[.init("X-MMe-Country")!] = Locale.current.region?.identifierlet (_, body) = try await httpClient.makeRequest(request)diff --git a/Sources/XKit/Utilities/KeyValueStorage.swift b/Sources/XKit/Utilities/KeyValueStorage.swiftindex 607c442..ff2801e 100644--- a/Sources/XKit/Utilities/KeyValueStorage.swift+++ b/Sources/XKit/Utilities/KeyValueStorage.swift@@ -138,11 +138,9 @@ public struct KeychainStorage: KeyValueStorage {private func makeQuery(forKey key: String, _ parameters: [CFString: Any]) -> CFDictionary {var query: [CFString: Any] = [kSecClass: kSecClassGenericPassword,- kSecAttrAccount: key+ kSecAttrAccount: key,+ kSecUseDataProtectionKeychain: true,]- if #available(macOS 10.15, *) {- query[kSecUseDataProtectionKeychain] = true- }query[kSecAttrService] = servicequery.merge(parameters) { _, b in b }return query as CFDictionarydiff --git a/macOS/Gemfile.lock b/macOS/Gemfile.lockindex e00837a..be31548 100644--- a/macOS/Gemfile.lock+++ b/macOS/Gemfile.lock@@ -11,25 +11,27 @@ GEMartifactory (3.0.17)atomos (0.1.3)aws-eventstream (1.4.0)- aws-partitions (1.1118.0)- aws-sdk-core (3.226.0)+ aws-partitions (1.1172.0)+ aws-sdk-core (3.233.0)aws-eventstream (~> 1, >= 1.3.0)aws-partitions (~> 1, >= 1.992.0)aws-sigv4 (~> 1.9)base64+ bigdecimaljmespath (~> 1, >= 1.6.1)logger- aws-sdk-kms (1.105.0)- aws-sdk-core (~> 3, >= 3.225.0)+ aws-sdk-kms (1.113.0)+ aws-sdk-core (~> 3, >= 3.231.0)aws-sigv4 (~> 1.5)- aws-sdk-s3 (1.190.0)- aws-sdk-core (~> 3, >= 3.225.0)+ aws-sdk-s3 (1.199.1)+ aws-sdk-core (~> 3, >= 3.231.0)aws-sdk-kms (~> 1)aws-sigv4 (~> 1.5)aws-sigv4 (1.12.1)aws-eventstream (~> 1, >= 1.0.2)babosa (1.0.4)base64 (0.3.0)+ bigdecimal (3.3.1)claide (1.1.0)colored (1.2)colored2 (3.1.2)@@ -161,13 +163,13 @@ GEMhttpclient (2.9.0)mutex_mjmespath (1.6.2)- json (2.12.2)- jwt (2.10.1)+ json (2.15.1)+ jwt (2.10.2)base64logger (1.7.0)mini_magick (4.13.2)mini_mime (1.1.5)- multi_json (1.15.0)+ multi_json (1.17.0)multipart-post (2.4.1)mutex_m (0.3.0)nanaimo (0.4.0)@@ -175,7 +177,7 @@ GEMnkf (0.2.0)optparse (0.6.0)os (1.1.4)- ostruct (0.6.2)+ ostruct (0.6.3)plist (3.7.2)public_suffix (6.0.2)rake (13.3.0)@@ -184,15 +186,15 @@ GEMtrailblazer-option (>= 0.1.1, < 0.2.0)uber (< 0.2.0)retriable (3.1.2)- rexml (3.4.1)+ rexml (3.4.4)rouge (3.28.0)ruby2_keywords (0.0.5)rubyzip (2.4.1)security (0.1.5)- signet (0.20.0)+ signet (0.21.0)addressable (~> 2.8)faraday (>= 0.17.5, < 3.a)- jwt (>= 1.5, < 3.0)+ jwt (>= 1.5, < 4.0)multi_json (~> 1.10)simctl (1.6.10)CFPropertyListdiff --git a/macOS/XToolMac/XToolMacUI.swift b/macOS/XToolMac/XToolMacUI.swiftindex 3dfa29f..59b0918 100644--- a/macOS/XToolMac/XToolMacUI.swift+++ b/macOS/XToolMac/XToolMacUI.swift@@ -5,7 +5,7 @@ struct XToolMacUI: App {WindowGroup {ContentView()}- .disableWindowResizingIfPossible()+ .windowResizability(.contentSize)}}@@ -64,16 +64,6 @@ private struct StepView<Content: View>: View {}}-extension Scene {- fileprivate func disableWindowResizingIfPossible() -> some Scene {- if #available(macOS 13, *) {- return self.windowResizability(.contentSize)- } else {- return self- }- }-}-#Preview {ContentView()}diff --git a/macOS/project.yml b/macOS/project.ymlindex 454f350..0bb70ca 100644--- a/macOS/project.yml+++ b/macOS/project.yml@@ -11,7 +11,7 @@ targets:XToolMac:type: applicationplatform: macOS- deploymentTarget: "12.0"+ deploymentTarget: "13.0"sources:- path: XToolMac- path: Resources/xtool