From 2a277c24b5b4a37c248dba4cda2f57d7d01d829e Mon Sep 17 00:00:00 2001 From: Zorg Date: Sat, 12 Mar 2016 14:43:27 -0500 Subject: [PATCH] Put SUInstaller protocol into its own file --- Sparkle.xcodeproj/project.pbxproj | 2 ++ Sparkle/Autoupdate/SUInstallerProtocol.h | 24 ++++++++++++++++++++++++ Sparkle/SUGuidedPackageInstaller.h | 2 +- Sparkle/SUGuidedPackageInstaller.m | 2 ++ Sparkle/SUInstaller.h | 13 +------------ Sparkle/SUPackageInstaller.h | 2 +- Sparkle/SUPackageInstaller.m | 2 ++ Sparkle/SUPlainInstaller.h | 2 +- Sparkle/SUPlainInstaller.m | 1 + 9 files changed, 35 insertions(+), 15 deletions(-) create mode 100644 Sparkle/Autoupdate/SUInstallerProtocol.h diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 1fcc079c..0be9d838 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -731,6 +731,7 @@ 72A450511C69A68900D67EEA /* SUUpdatePermissionPromptResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUUpdatePermissionPromptResult.h; sourceTree = ""; }; 72A450521C69A68900D67EEA /* SUUpdatePermissionPromptResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUUpdatePermissionPromptResult.m; sourceTree = ""; }; 72A4A23F1BB6567D00E7820D /* SUFileManagerTest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SUFileManagerTest.swift; sourceTree = ""; }; + 72A6F97D1C94A5C2005F404C /* SUInstallerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SUInstallerProtocol.h; path = Autoupdate/SUInstallerProtocol.h; sourceTree = ""; }; 72AC6B251B9AAC8800F62325 /* SparkleTestCodeSignApp.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = SparkleTestCodeSignApp.tar.gz; sourceTree = ""; }; 72AC6B271B9AAD6700F62325 /* SparkleTestCodeSignApp.tar */ = {isa = PBXFileReference; lastKnownFileType = archive.tar; path = SparkleTestCodeSignApp.tar; sourceTree = ""; }; 72AC6B291B9AAF3A00F62325 /* SparkleTestCodeSignApp.tar.bz2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = SparkleTestCodeSignApp.tar.bz2; sourceTree = ""; }; @@ -1111,6 +1112,7 @@ children = ( 7275F9BF1B5F1F2900B1D19E /* SUFileManager.h */, 7275F9C01B5F1F2900B1D19E /* SUFileManager.m */, + 72A6F97D1C94A5C2005F404C /* SUInstallerProtocol.h */, 618FA4FF0DAE88B40026945C /* SUInstaller.h */, 618FA5000DAE88B40026945C /* SUInstaller.m */, 618FA5030DAE8AB80026945C /* SUPlainInstaller.h */, diff --git a/Sparkle/Autoupdate/SUInstallerProtocol.h b/Sparkle/Autoupdate/SUInstallerProtocol.h new file mode 100644 index 00000000..2254ea02 --- /dev/null +++ b/Sparkle/Autoupdate/SUInstallerProtocol.h @@ -0,0 +1,24 @@ +// +// SUInstallerProtocol.h +// Sparkle +// +// Created by Mayur Pawashe on 3/12/16. +// Copyright © 2016 Sparkle Project. All rights reserved. +// + +#import + +@protocol SUVersionComparison; +@class SUHost; + +@protocol SUInstaller + +- (instancetype)initWithHost:(SUHost *)host sourcePath:(NSString *)sourcePath installationPath:(NSString *)installationPath versionComparator:(id )comparator; + +- (BOOL)startInstallation:(NSError **)error; + +- (BOOL)resumeInstallation:(NSError **)error; + +- (void)cleanup; + +@end diff --git a/Sparkle/SUGuidedPackageInstaller.h b/Sparkle/SUGuidedPackageInstaller.h index 103fc36f..459c8781 100644 --- a/Sparkle/SUGuidedPackageInstaller.h +++ b/Sparkle/SUGuidedPackageInstaller.h @@ -20,7 +20,7 @@ A guided installation can be started by applications other than the application */ #import -#import "SUInstaller.h" +#import "SUInstallerProtocol.h" @interface SUGuidedPackageInstaller : NSObject diff --git a/Sparkle/SUGuidedPackageInstaller.m b/Sparkle/SUGuidedPackageInstaller.m index 8e7d474e..23120d23 100644 --- a/Sparkle/SUGuidedPackageInstaller.m +++ b/Sparkle/SUGuidedPackageInstaller.m @@ -11,6 +11,8 @@ #import "SUParameterAssert.h" #import "SUGuidedPackageInstaller.h" #import "SUErrors.h" +#import "SUVersionComparisonProtocol.h" +#import "SUHost.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit diff --git a/Sparkle/SUInstaller.h b/Sparkle/SUInstaller.h index e64404d3..bd179b1a 100644 --- a/Sparkle/SUInstaller.h +++ b/Sparkle/SUInstaller.h @@ -8,23 +8,12 @@ #import #import "SUVersionComparisonProtocol.h" +#import "SUInstallerProtocol.h" NS_ASSUME_NONNULL_BEGIN @class SUHost; -@protocol SUInstaller - -- (instancetype)initWithHost:(SUHost *)host sourcePath:(NSString *)sourcePath installationPath:(NSString *)installationPath versionComparator:(id )comparator; - -- (BOOL)startInstallation:(NSError **)error; - -- (BOOL)resumeInstallation:(NSError **)error; - -- (void)cleanup; - -@end - @interface SUInstaller : NSObject + (nullable id)installerForHost:(SUHost *)host updateDirectory:(NSString *)updateDirectory versionComparator:(id )comparator error:(NSError **)error; diff --git a/Sparkle/SUPackageInstaller.h b/Sparkle/SUPackageInstaller.h index d18c1759..84750039 100644 --- a/Sparkle/SUPackageInstaller.h +++ b/Sparkle/SUPackageInstaller.h @@ -7,7 +7,7 @@ // #import -#import "SUInstaller.h" +#import "SUInstallerProtocol.h" @interface SUPackageInstaller : NSObject diff --git a/Sparkle/SUPackageInstaller.m b/Sparkle/SUPackageInstaller.m index 1a46ce1b..b8337f94 100644 --- a/Sparkle/SUPackageInstaller.m +++ b/Sparkle/SUPackageInstaller.m @@ -7,6 +7,8 @@ // #import "SUPackageInstaller.h" +#import "SUVersionComparisonProtocol.h" +#import "SUHost.h" #import "SUConstants.h" #import "SUErrors.h" #import "SULog.h" diff --git a/Sparkle/SUPlainInstaller.h b/Sparkle/SUPlainInstaller.h index f2e4e58b..f0aecf9e 100644 --- a/Sparkle/SUPlainInstaller.h +++ b/Sparkle/SUPlainInstaller.h @@ -7,7 +7,7 @@ // #import -#import "SUInstaller.h" +#import "SUInstallerProtocol.h" @interface SUPlainInstaller : NSObject diff --git a/Sparkle/SUPlainInstaller.m b/Sparkle/SUPlainInstaller.m index 24958749..8aab2d8f 100644 --- a/Sparkle/SUPlainInstaller.m +++ b/Sparkle/SUPlainInstaller.m @@ -13,6 +13,7 @@ #import "SULog.h" #import "SUErrors.h" #import "SUParameterAssert.h" +#import "SUVersionComparisonProtocol.h" #ifdef _APPKITDEFINES_H #error This is a "core" class and should NOT import AppKit