Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Xcode 16 #1009

Merged
merged 3 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions ZShare/ZShare-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#import "NSDecimalNumber+Rounding.h"
37 changes: 26 additions & 11 deletions Zotero.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
objects = {

/* Begin PBXBuildFile section */
61099E6E2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m in Sources */ = {isa = PBXBuildFile; fileRef = 61099E6D2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m */; };
61099E6F2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m in Sources */ = {isa = PBXBuildFile; fileRef = 61099E6D2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m */; };
6135EF9A2C2ABCD7008DA17B /* SquareAnnotationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6135EF992C2ABCD7008DA17B /* SquareAnnotationView.swift */; };
6135EF9C2C2ABDD1008DA17B /* AnnotationManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6135EF9B2C2ABDD1008DA17B /* AnnotationManager.swift */; };
61391B7E2B3C6ED9003B314A /* CopyBibliographyAction.swift in Sources */ = {isa = PBXBuildFile; fileRef = 61391B7D2B3C6ED9003B314A /* CopyBibliographyAction.swift */; };
Expand Down Expand Up @@ -1272,6 +1274,10 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
61099E6A2C91BAF300EDD92C /* Zotero-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Zotero-Bridging-Header.h"; sourceTree = "<group>"; };
61099E6B2C91BAF300EDD92C /* ZShare-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ZShare-Bridging-Header.h"; sourceTree = "<group>"; };
61099E6C2C91BAF300EDD92C /* NSDecimalNumber+Rounding.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "NSDecimalNumber+Rounding.h"; sourceTree = "<group>"; };
61099E6D2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "NSDecimalNumber+Rounding.m"; sourceTree = "<group>"; };
611486502A9CD511002EEBEF /* ci_post_xcodebuild.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = ci_post_xcodebuild.sh; sourceTree = "<group>"; };
6135EF992C2ABCD7008DA17B /* SquareAnnotationView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SquareAnnotationView.swift; sourceTree = "<group>"; };
6135EF9B2C2ABDD1008DA17B /* AnnotationManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AnnotationManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2620,6 +2626,8 @@
B3DEAAA628AD01CA00F72D90 /* URLSession+Extensions.swift */,
B305650C23FC051E003304F2 /* UserDefault+Extensions.swift */,
B3B78C45266FAF8500E91D02 /* WKWebView+Extensions.swift */,
61099E6C2C91BAF300EDD92C /* NSDecimalNumber+Rounding.h */,
61099E6D2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m */,
);
path = Extensions;
sourceTree = "<group>";
Expand Down Expand Up @@ -2840,6 +2848,7 @@
B39EE32A223A5E3500302E29 /* TestAppDelegate.swift */,
B3F3A6A922F97D4300E3A09C /* Zotero.entitlements */,
618D83E62BAAC88C00E7966B /* PrivacyInfo.xcprivacy */,
61099E6A2C91BAF300EDD92C /* Zotero-Bridging-Header.h */,
);
path = Zotero;
sourceTree = "<group>";
Expand Down Expand Up @@ -2898,6 +2907,7 @@
B311B3232386A39800BCF592 /* Info.plist */,
B311B3202386A39800BCF592 /* MainInterface.storyboard */,
B3B8166723880DC900529605 /* ZShare.entitlements */,
61099E6B2C91BAF300EDD92C /* ZShare-Bridging-Header.h */,
);
path = ZShare;
sourceTree = "<group>";
Expand Down Expand Up @@ -4351,12 +4361,12 @@
attributes = {
BuildIndependentTargetsInParallel = YES;
LastSwiftUpdateCheck = 1120;
LastUpgradeCheck = 1500;
LastUpgradeCheck = 1610;
ORGANIZATIONNAME = "Corporation for Digital Scholarship";
TargetAttributes = {
B30D59542206F60400884C4A = {
CreatedOnToolsVersion = 10.1;
LastSwiftMigration = 1120;
LastSwiftMigration = 1610;
SystemCapabilities = {
com.apple.Keychain = {
enabled = 0;
Expand All @@ -4378,6 +4388,7 @@
};
B311B31B2386A39800BCF592 = {
CreatedOnToolsVersion = 11.2.1;
LastSwiftMigration = 1610;
};
};
};
Expand Down Expand Up @@ -5069,6 +5080,7 @@
61E24DCC2ABB385E00D75F50 /* OpenItemsController.swift in Sources */,
B305679023FC1D9B003304F2 /* CollectionDifference+Separated.swift in Sources */,
B3F6AA3A2AB30663005BC22E /* AnnotationTool.swift in Sources */,
61099E6F2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m in Sources */,
B34ACC7A2514EAAB00040C17 /* AnnotationColorGenerator.swift in Sources */,
B3ADAE4F2833BEDC00D46271 /* LookupState.swift in Sources */,
B3FC7431272181E500F55531 /* WebDavWriteRequest.swift in Sources */,
Expand Down Expand Up @@ -5648,6 +5660,7 @@
B305672F23FC091F003304F2 /* StoreVersionSyncAction.swift in Sources */,
B33E8A4D27B6AAE600CBC7DE /* CollectionCellContentView.swift in Sources */,
B3D58D7025EE43E700D8FA31 /* CircularProgressView.swift in Sources */,
61099E6E2C91BAF300EDD92C /* NSDecimalNumber+Rounding.m in Sources */,
B36459E3264411F300A0C2C0 /* TagColorGenerator.swift in Sources */,
B3DF9AD32747AAD9007933CB /* ApiRequest.swift in Sources */,
B305673023FC0921003304F2 /* SubmitDeletionSyncAction.swift in Sources */,
Expand Down Expand Up @@ -6006,7 +6019,6 @@
B30D59802206F60500884C4A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Zotero/Zotero.entitlements;
Expand Down Expand Up @@ -6034,6 +6046,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) MAINAPP";
SWIFT_OBJC_BRIDGING_HEADER = "Zotero/Zotero-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_PRECOMPILE_BRIDGING_HEADER = YES;
SWIFT_VERSION = 5.0;
Expand All @@ -6044,7 +6057,6 @@
B30D59812206F60500884C4A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Zotero/Zotero.entitlements;
Expand All @@ -6071,6 +6083,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) MAINAPP";
SWIFT_OBJC_BRIDGING_HEADER = "Zotero/Zotero-Bridging-Header.h";
SWIFT_PRECOMPILE_BRIDGING_HEADER = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -6080,7 +6093,6 @@
B30D59832206F60500884C4A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
Expand Down Expand Up @@ -6112,7 +6124,6 @@
B30D59842206F60500884C4A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
Expand All @@ -6139,7 +6150,6 @@
B30D59862206F60500884C4A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -6165,7 +6175,6 @@
B30D59872206F60500884C4A /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -6191,6 +6200,7 @@
B311B3282386A39800BCF592 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ZShare/ZShare.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -6214,6 +6224,8 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_OBJC_BRIDGING_HEADER = "ZShare/ZShare-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand All @@ -6222,6 +6234,7 @@
B311B32A2386A39800BCF592 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ZShare/ZShare.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -6245,6 +6258,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_OBJC_BRIDGING_HEADER = "ZShare/ZShare-Bridging-Header.h";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down Expand Up @@ -6318,7 +6332,6 @@
B3B74F862B9086B800D966EC /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Zotero/Zotero.entitlements;
Expand Down Expand Up @@ -6346,6 +6359,7 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SUPPORTS_MACCATALYST = NO;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "$(inherited) MAINAPP TESTING";
SWIFT_OBJC_BRIDGING_HEADER = "Zotero/Zotero-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_PRECOMPILE_BRIDGING_HEADER = YES;
SWIFT_VERSION = 5.0;
Expand All @@ -6356,7 +6370,6 @@
B3B74F872B9086B800D966EC /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
BUNDLE_LOADER = "$(TEST_HOST)";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
Expand Down Expand Up @@ -6388,7 +6401,6 @@
B3B74F882B9086B800D966EC /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -6414,6 +6426,7 @@
B3B74F892B9086B800D966EC /* Test */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = ZShare/ZShare.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand All @@ -6437,6 +6450,8 @@
PROVISIONING_PROFILE_SPECIFIER = "";
SKIP_INSTALL = YES;
SUPPORTS_MACCATALYST = NO;
SWIFT_OBJC_BRIDGING_HEADER = "ZShare/ZShare-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
Expand Down
2 changes: 1 addition & 1 deletion Zotero.xcodeproj/xcshareddata/xcschemes/ZShare.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1610"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
Expand Down
2 changes: 1 addition & 1 deletion Zotero.xcodeproj/xcshareddata/xcschemes/Zotero.xcscheme
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1500"
LastUpgradeVersion = "1610"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions Zotero/Assets/Assets.xcassets/AppIcon.appiconset/Contents.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,30 @@
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "dark"
}
],
"filename" : "1024x1024-Dark.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
},
{
"appearances" : [
{
"appearance" : "luminosity",
"value" : "tinted"
}
],
"filename" : "1024x1024-Tinted.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
Expand Down
16 changes: 16 additions & 0 deletions Zotero/Extensions/NSDecimalNumber+Rounding.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//
// NSDecimalNumber+Rounding.h
// Zotero
//
// Created by Miltiadis Vasilakis on 11/9/24.
// Copyright © 2024 Corporation for Digital Scholarship. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface NSDecimalNumber (Rounding)

+ (NSDecimal)roundedDecimal:(NSDecimal)decimal toPlaces:(NSInteger)places mode:(NSRoundingMode)mode;

@end
19 changes: 19 additions & 0 deletions Zotero/Extensions/NSDecimalNumber+Rounding.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// NSDecimalNumber+Rounding.m
// Zotero
//
// Created by Miltiadis Vasilakis on 11/9/24.
// Copyright © 2024 Corporation for Digital Scholarship. All rights reserved.
//

#import "NSDecimalNumber+Rounding.h"

@implementation NSDecimalNumber (Rounding)

+ (NSDecimal)roundedDecimal:(NSDecimal)decimal toPlaces:(NSInteger)places mode:(NSRoundingMode)mode {
NSDecimal result = decimal;
NSDecimalRound(&result, &decimal, places, mode);
return result;
}

@end
12 changes: 8 additions & 4 deletions Zotero/Extensions/Rounding+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@ extension Decimal {
func rounded(to places: Int, mode: NSDecimalNumber.RoundingMode = .bankers) -> Decimal {
guard self.isFinite else { return Decimal(0) }

var original = self
var result: Decimal = 0
NSDecimalRound(&result, &original, places, mode)
return result
// TODO: Remove Objective-C bridging when issue is fixed
// https://forums.developer.apple.com/forums/thread/762711
// https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes#Foundation
// var original = self
// var result: Decimal = 0
// NSDecimalRound(&result, &original, places, mode)
// return result
return NSDecimalNumber.roundedDecimal(self, toPlaces: places, mode: mode)
}
}
5 changes: 5 additions & 0 deletions Zotero/Zotero-Bridging-Header.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//

#import "NSDecimalNumber+Rounding.h"