Skip to content

Commit 9af49f6

Browse files
authored
Bump deployment to macOS 13, iOS 16 (#173)
Necessary in order to pull in swift-subprocess
1 parent f29f6ba commit 9af49f6

10 files changed

Lines changed: 70 additions & 59 deletions

File tree

Package.resolved

Lines changed: 36 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ let cSettings: [CSetting] = [
2222
let package = Package(
2323
name: "xtool",
2424
platforms: [
25-
.iOS(.v15),
26-
.macOS(.v12),
25+
.iOS(.v16),
26+
.macOS(.v13),
2727
],
2828
products: [
2929
.library(
@@ -53,7 +53,8 @@ let package = Package(
5353
.package(url: "https://github.com/apple/swift-openapi-runtime", from: "1.0.0"),
5454
.package(url: "https://github.com/apple/swift-openapi-urlsession", from: "1.0.0"),
5555
.package(url: "https://github.com/apple/swift-nio", from: "2.77.0"),
56-
.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0"),
56+
57+
.package(url: "https://github.com/swiftlang/swift-docc-plugin", from: "1.0.0"),
5758

5859
.package(url: "https://github.com/swift-server/async-http-client.git", from: "1.23.0"),
5960
.package(url: "https://github.com/swift-server/swift-openapi-async-http-client", from: "1.0.0"),

Sources/XKit/GrandSlam/Anisette/ADIDataProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public struct ADIDataProvider: AnisetteDataProvider {
174174
.acceptLanguage: "en_US",
175175
.init(AnisetteData.localUserIDKey)!: self.localUserID,
176176
]
177-
request.headerFields[.init("X-MMe-Country")!] = Locale.current.regionCode
177+
request.headerFields[.init("X-MMe-Country")!] = Locale.current.region?.identifier
178178

179179
request.headerFields[.init(DeviceInfo.clientInfoKey)!] = try await clientInfo()
180180
request.headerFields[.init(DeviceInfo.deviceIDKey)!] = self.localUserUID.uuidString

Sources/XKit/GrandSlam/Anisette/AnisetteData.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ public struct AnisetteData {
5454

5555
var dictionary: [String: String] {
5656
// GSA doesn't like "en_US@rg=..."; it has to be just "en_US".
57-
let localeIdentifier = if let language = locale.languageCode, let region = locale.regionCode {
57+
let localeIdentifier = if let language = locale.language.languageCode?.identifier,
58+
let region = locale.region?.identifier {
5859
"\(language)_\(region)"
5960
} else {
6061
"en_US"

Sources/XKit/GrandSlam/Anisette/DeviceInfo+Fetching.swift

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,14 @@ extension DeviceInfo {
5656

5757
private static func fetchHardwareModel() -> String? {
5858
var modelSize = 0
59-
guard sysctlbyname("hw.model", nil, &modelSize, nil, 0) == 0 else { return nil }
60-
guard let rawString = malloc(modelSize) else { return nil }
61-
guard sysctlbyname("hw.model", rawString, &modelSize, nil, 0) == 0 else {
62-
free(rawString)
63-
return nil
59+
guard sysctlbyname("hw.model", nil, &modelSize, nil, 0) == 0,
60+
modelSize > 0 else { return nil }
61+
return String(unsafeUninitializedCapacity: modelSize) { buf in
62+
var len = modelSize
63+
guard sysctlbyname("hw.model", buf.baseAddress, &len, nil, 0) == 0,
64+
len == modelSize else { return 0 }
65+
return len - 1 // exclude NUL
6466
}
65-
return String(bytesNoCopy: rawString, length: modelSize - 1, encoding: .utf8, freeWhenDone: true)
6667
}
6768

6869
public static func current() -> DeviceInfo? {

Sources/XKit/GrandSlam/Lookup/GrandSlamLookupManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ actor GrandSlamLookupManager {
4545
.init(AnisetteData.timeZoneKey)!: TimeZone.current.identifier,
4646
.init("X-Apple-I-TimeZone-Offset")!: "\(TimeZone.current.secondsFromGMT())"
4747
]
48-
request.headerFields[.init("X-MMe-Country")!] = Locale.current.regionCode
48+
request.headerFields[.init("X-MMe-Country")!] = Locale.current.region?.identifier
4949

5050
let (_, body) = try await httpClient.makeRequest(request)
5151

Sources/XKit/Utilities/KeyValueStorage.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,9 @@ public struct KeychainStorage: KeyValueStorage {
138138
private func makeQuery(forKey key: String, _ parameters: [CFString: Any]) -> CFDictionary {
139139
var query: [CFString: Any] = [
140140
kSecClass: kSecClassGenericPassword,
141-
kSecAttrAccount: key
141+
kSecAttrAccount: key,
142+
kSecUseDataProtectionKeychain: true,
142143
]
143-
if #available(macOS 10.15, *) {
144-
query[kSecUseDataProtectionKeychain] = true
145-
}
146144
query[kSecAttrService] = service
147145
query.merge(parameters) { _, b in b }
148146
return query as CFDictionary

macOS/Gemfile.lock

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,27 @@ GEM
1111
artifactory (3.0.17)
1212
atomos (0.1.3)
1313
aws-eventstream (1.4.0)
14-
aws-partitions (1.1118.0)
15-
aws-sdk-core (3.226.0)
14+
aws-partitions (1.1172.0)
15+
aws-sdk-core (3.233.0)
1616
aws-eventstream (~> 1, >= 1.3.0)
1717
aws-partitions (~> 1, >= 1.992.0)
1818
aws-sigv4 (~> 1.9)
1919
base64
20+
bigdecimal
2021
jmespath (~> 1, >= 1.6.1)
2122
logger
22-
aws-sdk-kms (1.105.0)
23-
aws-sdk-core (~> 3, >= 3.225.0)
23+
aws-sdk-kms (1.113.0)
24+
aws-sdk-core (~> 3, >= 3.231.0)
2425
aws-sigv4 (~> 1.5)
25-
aws-sdk-s3 (1.190.0)
26-
aws-sdk-core (~> 3, >= 3.225.0)
26+
aws-sdk-s3 (1.199.1)
27+
aws-sdk-core (~> 3, >= 3.231.0)
2728
aws-sdk-kms (~> 1)
2829
aws-sigv4 (~> 1.5)
2930
aws-sigv4 (1.12.1)
3031
aws-eventstream (~> 1, >= 1.0.2)
3132
babosa (1.0.4)
3233
base64 (0.3.0)
34+
bigdecimal (3.3.1)
3335
claide (1.1.0)
3436
colored (1.2)
3537
colored2 (3.1.2)
@@ -161,21 +163,21 @@ GEM
161163
httpclient (2.9.0)
162164
mutex_m
163165
jmespath (1.6.2)
164-
json (2.12.2)
165-
jwt (2.10.1)
166+
json (2.15.1)
167+
jwt (2.10.2)
166168
base64
167169
logger (1.7.0)
168170
mini_magick (4.13.2)
169171
mini_mime (1.1.5)
170-
multi_json (1.15.0)
172+
multi_json (1.17.0)
171173
multipart-post (2.4.1)
172174
mutex_m (0.3.0)
173175
nanaimo (0.4.0)
174176
naturally (2.3.0)
175177
nkf (0.2.0)
176178
optparse (0.6.0)
177179
os (1.1.4)
178-
ostruct (0.6.2)
180+
ostruct (0.6.3)
179181
plist (3.7.2)
180182
public_suffix (6.0.2)
181183
rake (13.3.0)
@@ -184,15 +186,15 @@ GEM
184186
trailblazer-option (>= 0.1.1, < 0.2.0)
185187
uber (< 0.2.0)
186188
retriable (3.1.2)
187-
rexml (3.4.1)
189+
rexml (3.4.4)
188190
rouge (3.28.0)
189191
ruby2_keywords (0.0.5)
190192
rubyzip (2.4.1)
191193
security (0.1.5)
192-
signet (0.20.0)
194+
signet (0.21.0)
193195
addressable (~> 2.8)
194196
faraday (>= 0.17.5, < 3.a)
195-
jwt (>= 1.5, < 3.0)
197+
jwt (>= 1.5, < 4.0)
196198
multi_json (~> 1.10)
197199
simctl (1.6.10)
198200
CFPropertyList

macOS/XToolMac/XToolMacUI.swift

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ struct XToolMacUI: App {
55
WindowGroup {
66
ContentView()
77
}
8-
.disableWindowResizingIfPossible()
8+
.windowResizability(.contentSize)
99
}
1010
}
1111

@@ -64,16 +64,6 @@ private struct StepView<Content: View>: View {
6464
}
6565
}
6666

67-
extension Scene {
68-
fileprivate func disableWindowResizingIfPossible() -> some Scene {
69-
if #available(macOS 13, *) {
70-
return self.windowResizability(.contentSize)
71-
} else {
72-
return self
73-
}
74-
}
75-
}
76-
7767
#Preview {
7868
ContentView()
7969
}

macOS/project.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ targets:
1111
XToolMac:
1212
type: application
1313
platform: macOS
14-
deploymentTarget: "12.0"
14+
deploymentTarget: "13.0"
1515
sources:
1616
- path: XToolMac
1717
- path: Resources/xtool

0 commit comments

Comments
 (0)