From 2a0c308ae0797a09f9bca3894bc8ef223cbe066f Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 23 Feb 2024 10:43:27 -0800 Subject: [PATCH] feat: Update to xcode 15 macos 14.2 project.pbxproj * disabled user script sandboxing to avoid errors running perl script for markdown. * Added additional xcode settings for v15 * Updated deployment targets to 14.2 xcschemes * Updated schemas to upgradeversion 1520 for xcode 15. DiskArbitratorAppController.m * Removed calls to deprecated APIs replacing with new ones. Fix: Fixes [Issue #48](https://github.com/aburgh/Disk-Arbitrator/issues/48) --- DiskArbitrator.xcodeproj/project.pbxproj | 29 +++++++++++++++---- .../Build Disk Arbitrator DMG.xcscheme | 2 +- .../xcschemes/DiskArbitrator.xcscheme | 2 +- Source/DiskArbitratorAppController.m | 28 +++++++++--------- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/DiskArbitrator.xcodeproj/project.pbxproj b/DiskArbitrator.xcodeproj/project.pbxproj index 2176623..5e79b1a 100644 --- a/DiskArbitrator.xcodeproj/project.pbxproj +++ b/DiskArbitrator.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 52; + objectVersion = 60; objects = { /* Begin PBXAggregateTarget section */ @@ -300,10 +300,11 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1130; + BuildIndependentTargetsInParallel = YES; + LastUpgradeCheck = 1520; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "DiskArbitrator" */; - compatibilityVersion = "Xcode 11.0"; + compatibilityVersion = "Xcode 15.0"; developmentRegion = en; hasScannedForEncodings = 1; knownRegions = ( @@ -442,8 +443,10 @@ CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; + MACOSX_DEPLOYMENT_TARGET = 14.2; PRODUCT_NAME = "Disk Arbitrator.dmg"; }; name = Debug; @@ -454,7 +457,9 @@ CLANG_ENABLE_OBJC_WEAK = YES; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + MACOSX_DEPLOYMENT_TARGET = 14.2; PRODUCT_NAME = "Disk Arbitrator.dmg"; ZERO_LINK = NO; }; @@ -469,15 +474,19 @@ CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; + DEAD_CODE_STRIPPING = YES; + ENABLE_HARDENED_RUNTIME = YES; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Source/DiskArbitrator_Prefix.pch; INFOPLIST_FILE = "Resources/DiskArbitrator-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + MACOSX_DEPLOYMENT_TARGET = 14.2; PRODUCT_BUNDLE_IDENTIFIER = "us.burghardt.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "Disk Arbitrator"; PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Debug; }; @@ -489,14 +498,18 @@ CLANG_WARN_OBJC_INTERFACE_IVARS = YES_ERROR; CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; + DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_HARDENED_RUNTIME = YES; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = Source/DiskArbitrator_Prefix.pch; INFOPLIST_FILE = "Resources/DiskArbitrator-Info.plist"; INSTALL_PATH = "$(HOME)/Applications"; + MACOSX_DEPLOYMENT_TARGET = 14.2; PRODUCT_BUNDLE_IDENTIFIER = "us.burghardt.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "Disk Arbitrator"; PROVISIONING_PROFILE = ""; + PROVISIONING_PROFILE_SPECIFIER = ""; }; name = Release; }; @@ -515,13 +528,16 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEAD_CODE_STRIPPING = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -533,7 +549,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 14.2; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; }; @@ -554,12 +570,15 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + DEAD_CODE_STRIPPING = YES; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = NO; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; @@ -570,7 +589,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.12; + MACOSX_DEPLOYMENT_TARGET = 14.2; SDKROOT = macosx; }; name = Release; diff --git a/DiskArbitrator.xcodeproj/xcshareddata/xcschemes/Build Disk Arbitrator DMG.xcscheme b/DiskArbitrator.xcodeproj/xcshareddata/xcschemes/Build Disk Arbitrator DMG.xcscheme index 8d8c7db..108363c 100644 --- a/DiskArbitrator.xcodeproj/xcshareddata/xcschemes/Build Disk Arbitrator DMG.xcscheme +++ b/DiskArbitrator.xcodeproj/xcshareddata/xcschemes/Build Disk Arbitrator DMG.xcscheme @@ -1,6 +1,6 @@ ) Log(LOG_DEBUG, @"%s op: %ld info: %@", __func__, op, info); NSPasteboard* pboard = [info draggingPasteboard]; - - if (op == NSDragOperationCopy && [pboard.types containsObject:NSFilenamesPboardType]) { - - NSArray *files = [pboard propertyListForType:NSFilenamesPboardType]; + + if (op == NSDragOperationCopy && [pboard.types containsObject:NSPasteboardTypeFileURL]) + { + NSArray *files = [pboard propertyListForType:NSPasteboardTypeFileURL]; NSArray *extensions = [AttachDiskImageController diskImageFileExtensions]; - - for (NSString *file in files) { + + for (NSURL *file in files) { if ([extensions containsObject:[file pathExtension]] == NO) return NSDragOperationNone; } @@ -551,12 +551,12 @@ - (BOOL)tableView:(NSTableView *)aTableView acceptDrop:(id )info Log(LOG_DEBUG, @"%s", __func__); - if (operation == NSDragOperationCopy && [pboard.types containsObject:NSFilenamesPboardType] ) { - NSArray *files = [pboard propertyListForType:NSFilenamesPboardType]; - + if (operation == NSDragOperationCopy && [pboard.types containsObject:NSPasteboardTypeFileURL] ) { + NSArray *files = [pboard propertyListForType:NSPasteboardTypeFileURL]; + Log(LOG_DEBUG, @"files: %@", files); - for (NSString *file in files) + for (NSURL *file in files) [self performSelector:@selector(doAttachDiskImageAtPath:) withObject:file afterDelay:0.01]; } return YES;