Skip to content

Commit 78f36bf

Browse files
committed
fix(macOS): Drop macOS 12 Support
- Raised required macOS version to 13 for Swift packages. - Removed fallback code switches for macOS and file provider framework releases before macOS 13. - Consolidated Xcode project build settings into single declaration in build settings file. Signed-off-by: Iva Horn <iva.horn@nextcloud.com>
1 parent bac1d9e commit 78f36bf

File tree

25 files changed

+81
-205
lines changed

25 files changed

+81
-205
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ cmake_policy(SET CMP0071 NEW) # Enable use of QtQuick compiler/generated code
77
project(client)
88

99
if(APPLE)
10-
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0" CACHE STRING "Minimum OSX deployment version")
10+
set(CMAKE_OSX_DEPLOYMENT_TARGET "13.0" CACHE STRING "Minimum OSX deployment version")
1111
endif()
1212

1313
set(CMAKE_CXX_STANDARD 20)

admin/osx/mac-crafter/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import PackageDescription
1111
let package = Package(
1212
name: "mac-crafter",
1313
platforms: [
14-
.macOS(.v12),
14+
.macOS(.v13),
1515
],
1616
dependencies: [
1717
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.4.0")

cmake/modules/MacOSXBundleInfo.plist.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<key>NSPrincipalClass</key>
66
<string>NSApplication</string>
77
<key>LSMinimumSystemVersion</key>
8-
<string>12.0</string>
8+
<string>13.0</string>
99
<key>LSUIElement</key>
1010
<true/>
1111
<key>CFBundleDevelopmentRegion</key>

craftmaster.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CreateCache = False
1818
# Category is case sensitive
1919
[GeneralSettings]
2020

21-
General/MacDeploymentTarget = 12.0
21+
General/MacDeploymentTarget = 13.0
2222

2323
Compile/BuildType = RelWithDebInfo
2424

shell_integration/MacOSX/NextcloudFileProviderKit/Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let package = Package(
77
name: "NextcloudFileProviderKit",
88
platforms: [
99
.iOS(.v16),
10-
.macOS(.v12),
10+
.macOS(.v13),
1111
.visionOS(.v1)
1212
],
1313
products: [

shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Database/FilesDatabaseManager+KeepDownloaded.swift

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@ import RealmSwift
66

77
public extension FilesDatabaseManager {
88
func set(keepDownloaded: Bool, for metadata: SendableItemMetadata) throws -> SendableItemMetadata? {
9-
guard #available(macOS 13.0, iOS 16.0, visionOS 1.0, *) else {
10-
let error = "Could not update keepDownloaded status for item because the system does not support this state."
11-
logger.error(error, [.item: metadata.ocId, .name: metadata.fileName])
12-
13-
throw NSError(
14-
domain: Self.errorDomain,
15-
code: NSFeatureUnsupportedError,
16-
userInfo: [NSLocalizedDescriptionKey: error]
17-
)
18-
}
19-
209
guard let result = itemMetadatas.where({ $0.ocId == metadata.ocId }).first else {
2110
let error = "Did not update keepDownloaded for item metadata as it was not found."
2211
logger.error(error, [.item: metadata.ocId, .name: metadata.fileName])

shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+Fetch.swift

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,9 @@ public extension Item {
117117

118118
if let domain, let localUrl = await localUrlForContents(domain: domain) {
119119
return (localUrl, self, nil)
120-
} else if #available(macOS 13.0, *) {
121-
logger.error("Could not get local contents URL for lock file, erroring.")
122-
return (nil, self, NSFileProviderError(.excludedFromSync))
123120
} else {
124-
logger.error("Could not get local contents URL for lock file, nilling.")
125-
return (nil, self, nil)
121+
logger.error("Could not get local content URL for lock file.")
122+
return (nil, self, NSFileProviderError(.excludedFromSync))
126123
}
127124
}
128125

shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+Ignored.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,6 @@ extension Item {
6767
log: log
6868
)
6969

70-
if #available(macOS 13.0, *) {
71-
return (item, NSFileProviderError(.excludedFromSync))
72-
} else {
73-
return (item, nil)
74-
}
70+
return (item, NSFileProviderError(.excludedFromSync))
7571
}
7672
}

shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+KeepDownloaded.swift

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,10 @@ public extension Item {
2424
}
2525
}
2626

27-
if #available(macOS 13.0, iOS 16.0, visionOS 1.0, *) {
28-
if keepDownloaded, !isDownloaded {
29-
try await manager.requestDownloadForItem(withIdentifier: itemIdentifier)
30-
} else {
31-
try await manager.requestModification(
32-
of: [.lastUsedDate], forItemWithIdentifier: itemIdentifier
33-
)
34-
}
27+
if keepDownloaded, !isDownloaded {
28+
try await manager.requestDownloadForItem(withIdentifier: itemIdentifier)
3529
} else {
36-
try await manager.signalEnumerator(for: .workingSet)
30+
try await manager.requestModification(of: [.lastUsedDate], forItemWithIdentifier: itemIdentifier)
3731
}
3832
}
3933
}

shell_integration/MacOSX/NextcloudFileProviderKit/Sources/NextcloudFileProviderKit/Item/Item+LockFile.swift

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,14 @@ extension Item {
7474

7575
guard await assertRequiredCapabilities(domain: domain, itemIdentifier: itemTemplate.itemIdentifier, account: account, remoteInterface: remoteInterface, logger: logger) else {
7676
logger.debug("Excluding lock file from synchronizing due to lack of server-side locking capability.", [.item: itemTemplate.itemIdentifier, .name: itemTemplate.filename])
77-
78-
let error = if #available(macOS 13.0, *) {
79-
NSFileProviderError(.excludedFromSync)
80-
} else {
81-
NSFileProviderError(.cannotSynchronize)
82-
}
83-
84-
return (nil, error)
77+
return (nil, NSFileProviderError(.excludedFromSync))
8578
}
8679

8780
logger.info("Item to create is a lock file. Will attempt to lock the associated file on the server.", [.name: itemTemplate.filename])
8881

8982
guard let targetFileName = originalFileName(fromLockFileName: itemTemplate.filename, dbManager: dbManager) else {
9083
logger.error("Will not lock the target file because it could not be determined based on the lock file name.", [.name: itemTemplate.filename])
91-
92-
if #available(macOS 13.0, *) {
93-
return (nil, NSFileProviderError(.excludedFromSync))
94-
} else {
95-
return (nil, NSFileProviderError(.cannotSynchronize))
96-
}
84+
return (nil, NSFileProviderError(.excludedFromSync))
9785
}
9886

9987
logger.debug("Derived target file name for lock file.", [.name: targetFileName])

0 commit comments

Comments
 (0)