From def287d7dc61b5cd85334b2d01ce4957989483d1 Mon Sep 17 00:00:00 2001 From: andym Date: Mon, 24 Dec 2007 07:13:44 +0000 Subject: [PATCH] Fixed up headers to make things easier for those who compile Sparkle in situ -- thanks for the help, Charles D. H. Williams. --- NSFileManager+Authentication.h | 2 ++ NSFileManager+Authentication.m | 6 +++--- SUAppcast.h | 2 +- SUAppcast.m | 1 - SUAppcastItem.h | 3 +-- SUAppcastItem.m | 1 - SUAutomaticUpdateAlert.h | 2 +- SUAutomaticUpdateAlert.m | 2 -- SUConstants.m | 2 ++ SUStandardVersionComparator.h | 3 +-- SUStatusChecker.h | 3 +-- SUStatusChecker.m | 2 -- SUStatusController.h | 2 +- SUStatusController.m | 1 - SUSystemProfiler.h | 3 +-- SUUnarchiver.h | 3 +-- SUUpdateAlert.h | 2 +- SUUpdateAlert.m | 2 -- SUUpdater.h | 3 +++ SUUpdater.m | 15 --------------- Sparkle.h | 27 ++++++++++++++++++++++++++- Sparkle.xcodeproj/project.pbxproj | 12 +++++------- Sparkle_Prefix.pch | 16 ---------------- 23 files changed, 50 insertions(+), 65 deletions(-) delete mode 100644 Sparkle_Prefix.pch diff --git a/NSFileManager+Authentication.h b/NSFileManager+Authentication.h index 73ab5d7a..8e515037 100644 --- a/NSFileManager+Authentication.h +++ b/NSFileManager+Authentication.h @@ -6,6 +6,8 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // +#import "Sparkle.h" + @interface NSFileManager (SUAuthenticationAdditions) - (BOOL)copyPath:(NSString *)src overPath:(NSString *)dst withAuthentication:(BOOL)useAuthentication; @end diff --git a/NSFileManager+Authentication.m b/NSFileManager+Authentication.m index f2d98efd..dcce68bb 100644 --- a/NSFileManager+Authentication.m +++ b/NSFileManager+Authentication.m @@ -8,13 +8,13 @@ // This code based on generous contribution from Allan Odgaard. Thanks, Allan! -#import "sys/stat.h" -#import +#import "NSFileManager+Authentication.h" -#import +#import #import #import #import +#import @implementation NSFileManager (SUAuthenticationAdditions) diff --git a/SUAppcast.h b/SUAppcast.h index 9bbf8a40..3b08d153 100644 --- a/SUAppcast.h +++ b/SUAppcast.h @@ -6,7 +6,7 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // -#import +#import "Sparkle.h" @class RSS, SUAppcastItem; @interface SUAppcast : NSObject { diff --git a/SUAppcast.m b/SUAppcast.m index c00f160e..608872fe 100644 --- a/SUAppcast.m +++ b/SUAppcast.m @@ -7,7 +7,6 @@ // #import "SUAppcast.h" -#import "SUAppcastItem.h" #import "RSS.h" @implementation SUAppcast diff --git a/SUAppcastItem.h b/SUAppcastItem.h index 90870734..e6e0d320 100644 --- a/SUAppcastItem.h +++ b/SUAppcastItem.h @@ -6,8 +6,7 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // -#import - +#import "Sparkle.h" @interface SUAppcastItem : NSObject { NSString *title; diff --git a/SUAppcastItem.m b/SUAppcastItem.m index 4e2090ac..0f935c14 100644 --- a/SUAppcastItem.m +++ b/SUAppcastItem.m @@ -8,7 +8,6 @@ #import "SUAppcastItem.h" - @implementation SUAppcastItem - initWithDictionary:(NSDictionary *)dict diff --git a/SUAutomaticUpdateAlert.h b/SUAutomaticUpdateAlert.h index d64677fb..5784199f 100644 --- a/SUAutomaticUpdateAlert.h +++ b/SUAutomaticUpdateAlert.h @@ -6,7 +6,7 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // -#import +#import "Sparkle.h" @class SUAppcastItem; @interface SUAutomaticUpdateAlert : NSWindowController { diff --git a/SUAutomaticUpdateAlert.m b/SUAutomaticUpdateAlert.m index ac8b481d..9bdd32c7 100644 --- a/SUAutomaticUpdateAlert.m +++ b/SUAutomaticUpdateAlert.m @@ -7,8 +7,6 @@ // #import "SUAutomaticUpdateAlert.h" -#import "NSBundle+SUAdditions.h" -#import "SUAppcastItem.h" @implementation SUAutomaticUpdateAlert diff --git a/SUConstants.m b/SUConstants.m index bcc2670b..3d713271 100644 --- a/SUConstants.m +++ b/SUConstants.m @@ -6,6 +6,8 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // +#import + NSString *SUUpdaterWillRestartNotification = @"SUUpdaterWillRestartNotificationName"; NSString *SUHasLaunchedBeforeKey = @"SUHasLaunchedBefore"; diff --git a/SUStandardVersionComparator.h b/SUStandardVersionComparator.h index a04f182b..1c021457 100644 --- a/SUStandardVersionComparator.h +++ b/SUStandardVersionComparator.h @@ -6,8 +6,7 @@ // Copyright 2007 __MyCompanyName__. All rights reserved. // -#import -#import "SUVersionComparisonProtocol.h" +#import "Sparkle.h" /*! @class diff --git a/SUStatusChecker.h b/SUStatusChecker.h index e83d1520..2913ea88 100644 --- a/SUStatusChecker.h +++ b/SUStatusChecker.h @@ -5,8 +5,7 @@ // Created by Evan Schoenberg on 7/6/06. // -#import -#import +#import "SUUpdater.h" @class SUStatusChecker; diff --git a/SUStatusChecker.m b/SUStatusChecker.m index 0bc341c5..8894fa2a 100644 --- a/SUStatusChecker.m +++ b/SUStatusChecker.m @@ -6,8 +6,6 @@ // #import "SUStatusChecker.h" -#import "SUAppcast.h" -#import "SUAppcastItem.h" @interface SUStatusChecker (Private) - (id)initForDelegate:(id)inDelegate; diff --git a/SUStatusController.h b/SUStatusController.h index f6d3d8b4..ec91c51b 100644 --- a/SUStatusController.h +++ b/SUStatusController.h @@ -6,7 +6,7 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // -#import +#import "Sparkle.h" @interface SUStatusController : NSWindowController { double progressValue, maxProgressValue; diff --git a/SUStatusController.m b/SUStatusController.m index 85dce557..1a78c482 100644 --- a/SUStatusController.m +++ b/SUStatusController.m @@ -7,7 +7,6 @@ // #import "SUStatusController.h" -#import "NSBundle+SUAdditions.h" @implementation SUStatusController diff --git a/SUSystemProfiler.h b/SUSystemProfiler.h index bf5667b3..5a1b4342 100644 --- a/SUSystemProfiler.h +++ b/SUSystemProfiler.h @@ -6,8 +6,7 @@ // Copyright 2007 __MyCompanyName__. All rights reserved. // -#import - +#import "Sparkle.h" @interface SUSystemProfiler : NSObject {} + (NSURL *)profiledURLForAppcastURL:(NSURL *)appcastURL hostBundle:(NSBundle *)hostBundle; diff --git a/SUUnarchiver.h b/SUUnarchiver.h index bb8905e6..c008ab1f 100644 --- a/SUUnarchiver.h +++ b/SUUnarchiver.h @@ -6,8 +6,7 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // -#import - +#import "Sparkle.h" @interface SUUnarchiver : NSObject { id delegate; diff --git a/SUUpdateAlert.h b/SUUpdateAlert.h index 6de9573e..ac03a404 100644 --- a/SUUpdateAlert.h +++ b/SUUpdateAlert.h @@ -6,7 +6,7 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // -#import +#import "Sparkle.h" typedef enum { diff --git a/SUUpdateAlert.m b/SUUpdateAlert.m index 80fb6daf..6c6514f8 100644 --- a/SUUpdateAlert.m +++ b/SUUpdateAlert.m @@ -7,8 +7,6 @@ // #import "SUUpdateAlert.h" -#import "SUAppcastItem.h" -#import "NSBundle+SUAdditions.h" #import @implementation SUUpdateAlert diff --git a/SUUpdater.h b/SUUpdater.h index ebe02db2..c3d1906a 100644 --- a/SUUpdater.h +++ b/SUUpdater.h @@ -53,6 +53,9 @@ @end +#import "Sparkle.h" + + // Define some minimum intervals to avoid DOS-like checking attacks. These are in seconds. #ifdef DEBUG #define SU_MIN_CHECK_INTERVAL 60 diff --git a/SUUpdater.m b/SUUpdater.m index fd83774b..e6fe255a 100644 --- a/SUUpdater.m +++ b/SUUpdater.m @@ -7,21 +7,6 @@ // #import "SUUpdater.h" -#import "SUAppcast.h" -#import "SUAppcastItem.h" -#import "SUUnarchiver.h" -#import "NSBundle+SUAdditions.h" -#import "SUUserDefaults.h" -#import "SUVersionComparisonProtocol.h" -#import "SUStandardVersionComparator.h" - -#import "SUUpdateAlert.h" -#import "SUAutomaticUpdateAlert.h" -#import "SUStatusController.h" - -#import "NSFileManager+Authentication.h" -#import "NSFileManager+Verification.h" - #import #import #import diff --git a/Sparkle.h b/Sparkle.h index bf2bfd16..0ddfe6be 100644 --- a/Sparkle.h +++ b/Sparkle.h @@ -6,6 +6,24 @@ // Copyright 2006 Andy Matuschak. All rights reserved. // +// +// Prefix header for all source files of the 'Sparkle' target in the 'Sparkle' project. +// +#ifndef SPARKLE_H +#define SPARKLE_H +#define SULocalizedString(key,comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", [NSBundle bundleForClass:[self class]], comment) + +#ifdef __OBJC__ +#import +#import "SUConstants.h" +#endif + +// Apple recommends using SystemVersion.plist instead of Gestalt() here, don't ask me why. +// This code *should* use NSSearchPathForDirectoriesInDomains(NSCoreServiceDirectory, NSSystemDomainMask, YES) +// but that returns /Library/CoreServices for some reason +// This returns a version string of the form X.Y.Z +#define SUSystemVersionString() [[NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"] objectForKey:@"ProductVersion"] + #import "SUUpdater.h" #import "SUConstants.h" #import "SUAppcast.h" @@ -16,7 +34,14 @@ #import "SUUnarchiver.h" #import "SUStatusChecker.h" #import "SUUserDefaults.h" +#import "SUVersionComparisonProtocol.h" +#import "SUStandardVersionComparator.h" #import "NSFileManager+Authentication.h" #import "NSFileManager+Verification.h" -#import "NSBundle+SUAdditions.h" \ No newline at end of file +#import "NSBundle+SUAdditions.h" + +#else +/* Sparkle.h included more than once */ +#endif + diff --git a/Sparkle.xcodeproj/project.pbxproj b/Sparkle.xcodeproj/project.pbxproj index 8d68d0d8..bd0fe835 100644 --- a/Sparkle.xcodeproj/project.pbxproj +++ b/Sparkle.xcodeproj/project.pbxproj @@ -109,7 +109,6 @@ 0867D69BFE84028FC02AAC07 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; 1058C7B1FEA5585E11CA2CBB /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; - 32DBCF5E0370ADEE00C91783 /* Sparkle_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Sparkle_Prefix.pch; sourceTree = ""; }; 345AF9E20A5D707200D7DA6F /* SUStatusChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SUStatusChecker.h; sourceTree = ""; }; 345AF9E30A5D707200D7DA6F /* SUStatusChecker.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SUStatusChecker.m; sourceTree = ""; }; 610D5A740A1670A4004AAD9C /* SUStatus.nib */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; path = SUStatus.nib; sourceTree = ""; }; @@ -365,7 +364,6 @@ 61AAE8240A321A7F00D8810D /* SUAutomaticUpdateAlert.nib */, 61AAE8260A321A7F00D8810D /* SUUpdateAlert.nib */, 61299B3509CB04E000B7442F /* Sparkle.h */, - 32DBCF5E0370ADEE00C91783 /* Sparkle_Prefix.pch */, ); name = "Other Sources"; sourceTree = ""; @@ -410,8 +408,8 @@ children = ( 611779570D1111C400749C97 /* NSWorkspace_RBAdditions.h */, 611779560D1111C400749C97 /* NSWorkspace_RBAdditions.m */, - 610EC1BF0CF3914D00AE239E /* NTSynchronousTask.m */, 610EC1C00CF3914D00AE239E /* NTSynchronousTask.h */, + 610EC1BF0CF3914D00AE239E /* NTSynchronousTask.m */, 61B5F8DF09C4CE3C00B25A18 /* NSString+extras.h */, 61B5F8E009C4CE3C00B25A18 /* NSString+extras.m */, 61B5F8E109C4CE3C00B25A18 /* RSS.h */, @@ -831,8 +829,8 @@ GCC_GENERATE_DEBUGGING_SYMBOLS = YES; GCC_MODEL_TUNING = G5; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Sparkle_Prefix.pch; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = ""; GCC_TREAT_WARNINGS_AS_ERRORS = NO; INFOPLIST_FILE = Info.plist; INSTALL_PATH = "@executable_path/../Frameworks"; @@ -873,8 +871,8 @@ GCC_ENABLE_OBJC_EXCEPTIONS = YES; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = Sparkle_Prefix.pch; + GCC_PRECOMPILE_PREFIX_HEADER = NO; + GCC_PREFIX_HEADER = ""; GCC_REUSE_STRINGS = NO; GCC_TREAT_WARNINGS_AS_ERRORS = YES; INFOPLIST_FILE = Info.plist; diff --git a/Sparkle_Prefix.pch b/Sparkle_Prefix.pch deleted file mode 100644 index fb4ddb89..00000000 --- a/Sparkle_Prefix.pch +++ /dev/null @@ -1,16 +0,0 @@ -// -// Prefix header for all source files of the 'Sparkle' target in the 'Sparkle' project. -// - -#define SULocalizedString(key,comment) NSLocalizedStringFromTableInBundle(key, @"Sparkle", [NSBundle bundleForClass:[self class]], comment) - -#ifdef __OBJC__ - #import - #import "SUConstants.h" -#endif - -// Apple recommends using SystemVersion.plist instead of Gestalt() here, don't ask me why. -// This code *should* use NSSearchPathForDirectoriesInDomains(NSCoreServiceDirectory, NSSystemDomainMask, YES) -// but that returns /Library/CoreServices for some reason -// This returns a version string of the form X.Y.Z -#define SUSystemVersionString() [[NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"] objectForKey:@"ProductVersion"] \ No newline at end of file