From b5ff5a1792538e825921219c18b93604fe87affd Mon Sep 17 00:00:00 2001 From: Igor Arsenkin Date: Wed, 19 Jun 2019 10:29:24 +0300 Subject: [PATCH] Adopt project to macOS Mojave. --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++ .../ThemeEngine.xcodeproj/project.pbxproj | 39 +++++++++++++++---- .../Controllers/TEExportController.m | 6 +-- .../Controllers/TEInspectorDetailController.m | 4 +- .../Controllers/TERenditionsController.m | 3 ++ .../Pasteboard/TKGradientStop+Pasteboard.h | 2 +- .../ThemeEngine/Views/TEAnimationView.h | 2 +- .../ThemeEngine/Views/TEAnimationView.m | 2 +- .../ThemeEngine/Views/TEGradientEditor.m | 2 +- .../ThemeEngine/Views/TESliceImageView.m | 4 +- ThemeKit/ThemeKit.xcodeproj/project.pbxproj | 34 ++++++++++++++-- .../ThemeKit/Classes/Renditions/TKElement.h | 2 +- ThemeKit/ThemeKit/Info.plist | 2 +- 13 files changed, 85 insertions(+), 25 deletions(-) create mode 100644 ThemeEngine.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/ThemeEngine.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ThemeEngine.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/ThemeEngine.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ThemeEngine/ThemeEngine.xcodeproj/project.pbxproj b/ThemeEngine/ThemeEngine.xcodeproj/project.pbxproj index 4b2f9fe..66ba1d4 100644 --- a/ThemeEngine/ThemeEngine.xcodeproj/project.pbxproj +++ b/ThemeEngine/ThemeEngine.xcodeproj/project.pbxproj @@ -489,18 +489,19 @@ FA606C011B2C1D2000F24960 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0700; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Alex Zielenski"; TargetAttributes = { FA606C081B2C1D2100F24960 = { CreatedOnToolsVersion = 7.0; + DevelopmentTeam = PVJYV742FV; ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = FA606C041B2C1D2000F24960 /* Build configuration list for PBXProject "ThemeEngine" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, @@ -624,20 +625,31 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + 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; - CODE_SIGN_IDENTITY = "Developer ID Application: Alexander Zielenski (3GD8ABJ22W)"; + CODE_SIGN_IDENTITY = "Mac Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 105; DEBUG_INFORMATION_FORMAT = dwarf; @@ -672,20 +684,31 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + 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; - CODE_SIGN_IDENTITY = "Developer ID Application: Alexander Zielenski (3GD8ABJ22W)"; + CODE_SIGN_IDENTITY = "Mac Developer"; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 105; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; @@ -715,10 +738,10 @@ ALWAYS_SEARCH_USER_PATHS = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_USE_OPTIMIZATION_PROFILE = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Mac Developer"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = PVJYV742FV; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", @@ -744,10 +767,10 @@ ALWAYS_SEARCH_USER_PATHS = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_USE_OPTIMIZATION_PROFILE = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Mac Developer"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = ""; + DEVELOPMENT_TEAM = PVJYV742FV; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", "$(SYSTEM_LIBRARY_DIR)/PrivateFrameworks", diff --git a/ThemeEngine/ThemeEngine/Controllers/TEExportController.m b/ThemeEngine/ThemeEngine/Controllers/TEExportController.m index 80a92e1..931ff4b 100644 --- a/ThemeEngine/ThemeEngine/Controllers/TEExportController.m +++ b/ThemeEngine/ThemeEngine/Controllers/TEExportController.m @@ -116,9 +116,9 @@ - (void)importRenditions:(NSArray *)renditions { NSURL *dst = [[tmpURL URLByAppendingPathComponent:[[NSUUID UUID] UUIDString]] URLByAppendingPathExtension:@"tiff"]; //!TODO Do something with the rtn error - NSString *rtn = [script executeFunction:TEAppleScriptExportFunctionName - withArguments:@[ dst.path ] - error:nil]; +// NSString *rtn = [script executeFunction:TEAppleScriptExportFunctionName +// withArguments:@[ dst.path ] +// error:nil]; NSString *documentName = [script executeFunction:TEAppleScriptGetFileFunctionName withArguments:nil diff --git a/ThemeEngine/ThemeEngine/Controllers/TEInspectorDetailController.m b/ThemeEngine/ThemeEngine/Controllers/TEInspectorDetailController.m index a0729cc..91285be 100644 --- a/ThemeEngine/ThemeEngine/Controllers/TEInspectorDetailController.m +++ b/ThemeEngine/ThemeEngine/Controllers/TEInspectorDetailController.m @@ -51,7 +51,7 @@ - (void)toggleHide:(NSButton *)sender { self.collapseConstraint.animator.constant = 0; sender.title = @"Show"; } completionHandler:^{ - _collapsed = YES; + self->_collapsed = YES; }]; } else { [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context) { @@ -62,7 +62,7 @@ - (void)toggleHide:(NSButton *)sender { } completionHandler:^{ // The constraint is no longer needed, we can remove it. [self.view removeConstraint:self.collapseConstraint]; - _collapsed = NO; + self->_collapsed = NO; }]; } } diff --git a/ThemeEngine/ThemeEngine/Controllers/TERenditionsController.m b/ThemeEngine/ThemeEngine/Controllers/TERenditionsController.m index fc853eb..aca74bf 100644 --- a/ThemeEngine/ThemeEngine/Controllers/TERenditionsController.m +++ b/ThemeEngine/ThemeEngine/Controllers/TERenditionsController.m @@ -151,6 +151,9 @@ - (IBAction)sendToEditor:(id)sender { [[TEExportController sharedExportController] exportRenditions:[self.renditionsArrayController selectedObjects]]; } +- (IBAction)addRendition:(id)sender { + +} - (void)setCurrentGroup:(NSInteger)currentGroup { // Use this so we can observe arranged objects and regroup everytime it changes diff --git a/ThemeEngine/ThemeEngine/Pasteboard/TKGradientStop+Pasteboard.h b/ThemeEngine/ThemeEngine/Pasteboard/TKGradientStop+Pasteboard.h index 6439f29..71bca2a 100644 --- a/ThemeEngine/ThemeEngine/Pasteboard/TKGradientStop+Pasteboard.h +++ b/ThemeEngine/ThemeEngine/Pasteboard/TKGradientStop+Pasteboard.h @@ -11,7 +11,7 @@ // Don't call initWithPropertyList:ofType: // Call gradientStopWithPropertyList:ofType: // It will choose the correct stop class for you -extern __nonnull NSString *const TEGradientStopPBoardType; +extern NSString * _Nonnull const TEGradientStopPBoardType; @interface TKGradientStop (Pasteboard) + (nullable instancetype)gradientStopWithPropertyList:(nonnull NSDictionary *)list ofType:(nonnull NSString *)type; diff --git a/ThemeEngine/ThemeEngine/Views/TEAnimationView.h b/ThemeEngine/ThemeEngine/Views/TEAnimationView.h index 82dd1b0..da59b85 100644 --- a/ThemeEngine/ThemeEngine/Views/TEAnimationView.h +++ b/ThemeEngine/ThemeEngine/Views/TEAnimationView.h @@ -8,7 +8,7 @@ #import -@interface TEAnimationView : NSView +@interface TEAnimationView: NSView @property (strong) NSBitmapImageRep *image; @property CGFloat frameWidth; @property NSUInteger framesPerSecond; diff --git a/ThemeEngine/ThemeEngine/Views/TEAnimationView.m b/ThemeEngine/ThemeEngine/Views/TEAnimationView.m index e70ba2d..b19090e 100644 --- a/ThemeEngine/ThemeEngine/Views/TEAnimationView.m +++ b/ThemeEngine/ThemeEngine/Views/TEAnimationView.m @@ -53,7 +53,7 @@ - (void)display { @end -@interface TEAnimationView () +@interface TEAnimationView () @property (weak) TESpriteLayer *spriteLayer; - (void)_initialize; - (void)_invalidateAnimation; diff --git a/ThemeEngine/ThemeEngine/Views/TEGradientEditor.m b/ThemeEngine/ThemeEngine/Views/TEGradientEditor.m index 5a507ab..799e431 100644 --- a/ThemeEngine/ThemeEngine/Views/TEGradientEditor.m +++ b/ThemeEngine/ThemeEngine/Views/TEGradientEditor.m @@ -10,7 +10,7 @@ #import "TEGradientStopLayer.h" #import "NSColor+TE.h" -@interface TEGradientEditor () +@interface TEGradientEditor () @property (strong) CALayer *gradientLayer; @property (strong) NSMutableArray *colorStopLayers; diff --git a/ThemeEngine/ThemeEngine/Views/TESliceImageView.m b/ThemeEngine/ThemeEngine/Views/TESliceImageView.m index fe2d3f5..03eb8d3 100644 --- a/ThemeEngine/ThemeEngine/Views/TESliceImageView.m +++ b/ThemeEngine/ThemeEngine/Views/TESliceImageView.m @@ -17,7 +17,7 @@ static NSEdgeInsets TEIntegralInsets(NSEdgeInsets insets) { static const CGFloat sliceSpaceWidth = 2.0; -@interface TESliceImageView () +@interface TESliceImageView () @property (strong) CALayer *leftHandle; @property (strong) CALayer *topHandle; @property (strong) CALayer *bottomHandle; @@ -576,7 +576,7 @@ - (CGFloat)constrainBottomValue:(CGFloat)value { - (BOOL)validateValue:(inout id __nullable __autoreleasing * __nonnull)ioValue forKeyPath:(nonnull NSString *)inKeyPath error:(out NSError * __nullable __autoreleasing * __nullable)outError { NSLog(@"%@", inKeyPath); if ([inKeyPath hasSuffix:@"HandlePosition"]) { - CGFloat newValue; + CGFloat newValue = 0.0; CGFloat oldValue = ((NSNumber *)*ioValue).doubleValue; if ([inKeyPath isEqualToString:@"leftHandlePosition"]) { newValue = [self constrainLeftValue:oldValue]; diff --git a/ThemeKit/ThemeKit.xcodeproj/project.pbxproj b/ThemeKit/ThemeKit.xcodeproj/project.pbxproj index fccef74..8c1ee9f 100644 --- a/ThemeKit/ThemeKit.xcodeproj/project.pbxproj +++ b/ThemeKit/ThemeKit.xcodeproj/project.pbxproj @@ -500,7 +500,7 @@ FA092C751B2C1C7600D04F6D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0630; + LastUpgradeCheck = 1020; ORGANIZATIONNAME = "Alex Zielenski"; TargetAttributes = { FA092C7D1B2C1C7600D04F6D = { @@ -510,10 +510,11 @@ }; buildConfigurationList = FA092C781B2C1C7600D04F6D /* Build configuration list for PBXProject "ThemeKit" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( en, + Base, ); mainGroup = FA092C741B2C1C7600D04F6D; productRefGroup = FA092C7F1B2C1C7600D04F6D /* Products */; @@ -572,24 +573,36 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_OPTIMIZATION_PROFILE_FILE = ""; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + 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; COPY_PHASE_STRIP = NO; CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -609,7 +622,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx10.11; + SDKROOT = macosx; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -619,18 +632,29 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; CLANG_OPTIMIZATION_PROFILE_FILE = ""; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + 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; COPY_PHASE_STRIP = NO; @@ -650,7 +674,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx10.11; + SDKROOT = macosx; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; }; @@ -672,6 +696,7 @@ INFOPLIST_FILE = ThemeKit/Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alexzielenski.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/ThemeKit/**"; @@ -694,6 +719,7 @@ INFOPLIST_FILE = ThemeKit/Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alexzielenski.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/ThemeKit/**"; diff --git a/ThemeKit/ThemeKit/Classes/Renditions/TKElement.h b/ThemeKit/ThemeKit/Classes/Renditions/TKElement.h index 4fec627..58839bd 100644 --- a/ThemeKit/ThemeKit/Classes/Renditions/TKElement.h +++ b/ThemeKit/ThemeKit/Classes/Renditions/TKElement.h @@ -13,5 +13,5 @@ @interface TKElement : NSObject @property (nonnull, strong) NSSet *renditions; @property (readonly, nonnull, copy) NSString *name; -@property (readonly, weak) TKAssetStorage *storage; +@property (readonly, nullable, weak) TKAssetStorage *storage; @end diff --git a/ThemeKit/ThemeKit/Info.plist b/ThemeKit/ThemeKit/Info.plist index 113a79f..2e69ccc 100644 --- a/ThemeKit/ThemeKit/Info.plist +++ b/ThemeKit/ThemeKit/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier - com.alexzielenski.$(PRODUCT_NAME:rfc1034identifier) + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundleName