Skip to content

Commit 4b30143

Browse files
authored
Merge pull request #1395 from ychin/sparkle-2.4.0
Sparkle 2.4.0
2 parents 8cbd16e + 08ae40e commit 4b30143

File tree

103 files changed

+711
-781
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+711
-781
lines changed
Binary file not shown.

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUDownloadData.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
#import <Foundation/Foundation.h>
1010

11-
#ifdef BUILDING_SPARKLE_DOWNLOADER_SERVICE
11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
1212
// Ignore incorrect warning
1313
#pragma clang diagnostic push
1414
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUStandardUpdaterController.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
12+
// Ignore incorrect warning
13+
#pragma clang diagnostic push
14+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
15+
#import "SUExport.h"
16+
#pragma clang diagnostic pop
17+
#else
1018
#import <Sparkle/SUExport.h>
19+
#endif
1120

1221
NS_ASSUME_NONNULL_BEGIN
1322

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUStandardUserDriver.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
12+
// Ignore incorrect warning
13+
#pragma clang diagnostic push
14+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
15+
#import "SPUUserDriver.h"
16+
#import "SUExport.h"
17+
#pragma clang diagnostic pop
18+
#else
1019
#import <Sparkle/SPUUserDriver.h>
1120
#import <Sparkle/SUExport.h>
21+
#endif
1222

1323
NS_ASSUME_NONNULL_BEGIN
1424

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUStandardUserDriverDelegate.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
11+
// Ignore incorrect warning
12+
#pragma clang diagnostic push
13+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
14+
#import "SUExport.h"
15+
#pragma clang diagnostic pop
16+
#else
1017
#import <Sparkle/SUExport.h>
18+
#endif
1119

1220
NS_ASSUME_NONNULL_BEGIN
1321

@@ -42,6 +50,19 @@ SU_EXPORT @protocol SPUStandardUserDriverDelegate <NSObject>
4250
*/
4351
- (_Nullable id <SUVersionDisplay>)standardUserDriverRequestsVersionDisplayer;
4452

53+
/**
54+
Decides whether or not the standard user driver should provide an option to show full release notes to the user.
55+
56+
When a user checks for new updates and no new update is found, Sparkle by default will offer to show the application's version history to the user
57+
by providing a "Version History" button in the no new update available alert.
58+
59+
If this delegate method is implemented to return `NO`, then Sparkle will not provide an option to show full release notes to the user.
60+
61+
@param item The appcast item corresponding to the latest version available.
62+
@return @c YES to allow Sparkle to show full release notes to the user, otherwise @c NO to disallow this.
63+
*/
64+
- (BOOL)standardUserDriverShouldShowVersionHistoryForAppcastItem:(SUAppcastItem *)item;
65+
4566
/**
4667
Handles showing the full release notes to the user.
4768

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdatePermissionRequest.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
12+
// Ignore incorrect warning
13+
#pragma clang diagnostic push
14+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
15+
#import "SUExport.h"
16+
#pragma clang diagnostic pop
17+
#else
1018
#import <Sparkle/SUExport.h>
19+
#endif
1120

1221
NS_ASSUME_NONNULL_BEGIN
1322

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdater.h

Lines changed: 71 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,18 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
12+
// Ignore incorrect warning
13+
#pragma clang diagnostic push
14+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
15+
#import "SUExport.h"
16+
#import "SPUUserDriver.h"
17+
#pragma clang diagnostic pop
18+
#else
1019
#import <Sparkle/SUExport.h>
1120
#import <Sparkle/SPUUserDriver.h>
21+
#endif
1222

1323
NS_ASSUME_NONNULL_BEGIN
1424

@@ -100,15 +110,17 @@ SU_EXPORT @interface SPUUpdater : NSObject
100110
You usually do not need to call this method directly. If `automaticallyChecksForUpdates` is @c YES,
101111
Sparkle calls this method automatically according to its update schedule using the `updateCheckInterval`
102112
and the `lastUpdateCheckDate`. Therefore, you should typically only consider calling this method directly if you
103-
opt out of automatic update checks.
113+
opt out of automatic update checks. Calling this method when updating your own bundle is invalid if Sparkle is configured
114+
to ask the user's permission to check for updates automatically and `automaticallyChecksForUpdates` is `NO`.
115+
If you want to reset the updater's cycle after an updater setting change, see `resetUpdateCycle` or `resetUpdateCycleAfterShortDelay` instead.
104116
105117
This is meant for programmatically initating a check for updates in the background without the user initiating it.
106118
This check will not show UI if no new updates are found.
107119
108120
If a new update is found, the updater's user driver may handle showing it at an appropriate (but not necessarily immediate) time.
109121
If you want control over when and how a new update is shown, please see https://sparkle-project.org/documentation/gentle-reminders/
110122
111-
Note if automated updating is turned on, either a new update may be downloaded in the background to be installed silently,
123+
Note if automated downloading/installing is turned on, either a new update may be downloaded in the background to be installed silently,
112124
or an already downloaded update may be shown.
113125
114126
This will not find updates that the user has opted into skipping.
@@ -206,10 +218,14 @@ SU_EXPORT @interface SPUUpdater : NSObject
206218
207219
By default, updates are not automatically downloaded.
208220
221+
By default starting from Sparkle 2.4, users are provided an option to opt in to automatically downloading and installing updates when they are asked if they want automatic update checks enabled.
222+
The default value for this option is based on what the developer sets `SUAutomaticallyUpdate` in their Info.plist.
223+
This is not done if `SUEnableAutomaticChecks` is set in the Info.plist however. Please check `automaticallyChecksForUpdates` property for more details.
224+
209225
Note that the developer can disallow automatic downloading of updates from being enabled (via `SUAllowsAutomaticUpdates` Info.plist key).
210226
In this case, this property will return NO regardless of how this property is set.
211227
212-
Prefer to set SUAutomaticallyUpdate directly in your Info.plist for setting the initial value.
228+
Prefer to set `SUAutomaticallyUpdate` directly in your Info.plist for setting the initial value.
213229
214230
Setting this property will persist in the host bundle's user defaults.
215231
Hence developers shouldn't maintain an additional user default for this property.
@@ -222,32 +238,59 @@ SU_EXPORT @interface SPUUpdater : NSObject
222238
The URL of the appcast used to download update information.
223239
224240
If the updater's delegate implements `-[SPUUpdaterDelegate feedURLStringForUpdater:]`, this will return that feed URL.
225-
Otherwise if the feed URL has been set before, the feed URL returned will be retrieved from the host bundle's user defaults.
241+
Otherwise if the feed URL has been set before using `-[SPUUpdater setFeedURL:]`, the feed URL returned will be retrieved from the host bundle's user defaults.
226242
Otherwise the feed URL in the host bundle's Info.plist will be returned.
227243
If no feed URL can be retrieved, returns nil.
228244
229245
For setting a primary feed URL, please set the `SUFeedURL` property in your Info.plist.
230-
For setting an alternative feed URL, please prefer `-[SPUUpdaterDelegate feedURLStringForUpdater:]` over `-setFeedURL:`
246+
For setting an alternative feed URL, please prefer `-[SPUUpdaterDelegate feedURLStringForUpdater:]` over `-setFeedURL:`.
247+
Please see the documentation for `-setFeedURL:` for migrating away from that API.
231248
232249
This property must be called on the main thread; calls from background threads will return nil.
233250
*/
234251
@property (nonatomic, readonly, nullable) NSURL *feedURL;
235252

236253
/**
237-
Set the URL of the appcast used to download update information. Using this method is discouraged.
254+
Set the URL of the appcast used to download update information. This method is deprecated.
238255
239256
Setting this property will persist in the host bundle's user defaults.
240-
To avoid this, you should consider implementing
257+
To avoid this undesirable behavior, please consider implementing
241258
`-[SPUUpdaterDelegate feedURLStringForUpdater:]` instead of using this method.
242259
243-
Passing nil will remove any feed URL that has been set in the host bundle's user defaults.
260+
Calling `-clearFeedURLFromUserDefaults` will remove any feed URL that has been set in the host bundle's user defaults.
261+
Passing nil to this method can also do this, but using `-clearFeedURLFromUserDefaults` is preferred.
262+
To migrate away from using this API, you must clear and remove any feed URLs set in the user defaults through this API.
263+
244264
If you do not need to alternate between multiple feeds, set the SUFeedURL in your Info.plist instead of invoking this method.
245265
246266
For beta updates, you may consider migrating to `-[SPUUpdaterDelegate allowedChannelsForUpdater:]` in the future.
247267
268+
Updaters that update other developer's bundles should not call this method.
269+
248270
This method must be called on the main thread; calls from background threads will have no effect.
249271
*/
250-
- (void)setFeedURL:(nullable NSURL *)feedURL;
272+
- (void)setFeedURL:(nullable NSURL *)feedURL __deprecated_msg("Please call -[SPUUpdater clearFeedURLFromUserDefaults] to migrate away from using this API and transition to either specifying the feed URL in your Info.plist, using channels in Sparkle 2, or using -[SPUUpdaterDelegate feedURLStringForUpdater:] to specify the dynamic feed URL at runtime");
273+
274+
/**
275+
Clears any feed URL from the host bundle's user defaults that was set via `-setFeedURL:`
276+
277+
You should call this method if you have used `-setFeedURL:` in the past and want to stop using that API.
278+
Otherwise for compatibility Sparkle will prefer to use the feed URL that was set in the user defaults over the one that was specified in the host bundle's Info.plist,
279+
which is often undesirable (except for testing purposes).
280+
281+
If a feed URL is found stored in the host bundle's user defaults (from calling `-setFeedURL:`) before it gets cleared,
282+
then that previously set URL is returned from this method.
283+
284+
This method should be called as soon as possible, after your application finished launching or right after the updater has been started
285+
if you manually manage starting the updater.
286+
287+
Updaters that update other developer's bundles should not call this method.
288+
289+
This method must be called on the main thread.
290+
291+
@return A previously set feed URL in the host bundle's user defaults, if available, otherwise this returns `nil`
292+
*/
293+
- (nullable NSURL *)clearFeedURLFromUserDefaults;
251294

252295
/**
253296
The host bundle that is being updated.
@@ -258,7 +301,7 @@ SU_EXPORT @interface SPUUpdater : NSObject
258301
The user agent used when checking for updates.
259302
260303
By default the user agent string returned is in the format:
261-
$(BundleDisplayName)/$(BundleDisplayVersion) Sparkle/$(SparkleDisplayVersion)
304+
`$(BundleDisplayName)/$(BundleDisplayVersion) Sparkle/$(SparkleDisplayVersion)`
262305
263306
BundleDisplayVersion is derived from the main application's Info.plist's CFBundleShortVersionString.
264307
@@ -292,15 +335,28 @@ SU_EXPORT @interface SPUUpdater : NSObject
292335
@property (nonatomic, readonly, copy, nullable) NSDate *lastUpdateCheckDate;
293336

294337
/**
295-
Appropriately schedules or cancels the update checking timer according to the settings for the time interval and automatic checks.
296-
297-
If you change the `updateCheckInterval` or `automaticallyChecksForUpdates` properties, the update cycle will be reset automatically after a short delay.
298-
The update cycle is also started automatically after the updater is started. In all these cases, this method should not be called directly.
338+
Appropriately re-schedules the update checking timer according to the current updater settings.
339+
340+
This method should only be called in response to a user changing updater settings. This method may trigger a new update check to occur in the background if an updater setting such as the updater's feed or allowed channels has changed.
341+
342+
If the `updateCheckInterval` or `automaticallyChecksForUpdates` properties are changed, this method is automatically invoked after a short delay using `-resetUpdateCycleAfterShortDelay`. In these cases, manually resetting the update cycle is not necessary.
299343
300-
This call does not change the date of the next check, but only the internal timer.
344+
See also `-resetUpdateCycleAfterShortDelay` which gives the user a short delay before triggering a cycle reset.
301345
*/
302346
- (void)resetUpdateCycle;
303347

348+
/**
349+
Appropriately re-schedules the update checking timer according to the current updater settings after a short cancellable delay.
350+
351+
This method calls `resetUpdateCycle` after a short delay to give the user a short amount of time to cancel changing an updater setting.
352+
If this method is called again, any previous reset request that is still inflight will be cancelled.
353+
354+
For example, if the user changes the `automaticallyChecksForUpdates` setting to `YES`, but quickly undoes their change then
355+
no cycle reset will be done.
356+
357+
If the `updateCheckInterval` or `automaticallyChecksForUpdates` properties are changed, this method is automatically invoked. In these cases, manually resetting the update cycle is not necessary.
358+
*/
359+
- (void)resetUpdateCycleAfterShortDelay;
304360

305361
/**
306362
The system profile information that is sent when checking for updates.

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterDelegate.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
12+
// Ignore incorrect warning
13+
#pragma clang diagnostic push
14+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
15+
#import "SUExport.h"
16+
#import "SPUUpdateCheck.h"
17+
#import "SPUUserUpdateState.h"
18+
#pragma clang diagnostic pop
19+
#else
1020
#import <Sparkle/SUExport.h>
1121
#import <Sparkle/SPUUpdateCheck.h>
1222
#import <Sparkle/SPUUserUpdateState.h>
23+
#endif
1324

1425
@protocol SUVersionComparison;
1526
@class SPUUpdater, SUAppcast, SUAppcastItem, SPUUserUpdateState;

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterSettings.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
12+
// Ignore incorrect warning
13+
#pragma clang diagnostic push
14+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
15+
#import "SUExport.h"
16+
#pragma clang diagnostic pop
17+
#else
1018
#import <Sparkle/SUExport.h>
19+
#endif
1120

1221
NS_ASSUME_NONNULL_BEGIN
1322

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUserDriver.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,17 @@
88

99
#import <Foundation/Foundation.h>
1010

11+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
12+
// Ignore incorrect warning
13+
#pragma clang diagnostic push
14+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
15+
#import "SPUUserUpdateState.h"
16+
#import "SUExport.h"
17+
#pragma clang diagnostic pop
18+
#else
1119
#import <Sparkle/SPUUserUpdateState.h>
1220
#import <Sparkle/SUExport.h>
21+
#endif
1322

1423
NS_ASSUME_NONNULL_BEGIN
1524

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUserUpdateState.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@
1111

1212
#import <Foundation/Foundation.h>
1313

14+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
15+
// Ignore incorrect warning
16+
#pragma clang diagnostic push
17+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
18+
#import "SUExport.h"
19+
#pragma clang diagnostic pop
20+
#else
1421
#import <Sparkle/SUExport.h>
22+
#endif
1523

1624
NS_ASSUME_NONNULL_BEGIN
1725

src/MacVim/Sparkle_2.framework/Versions/B/Headers/SUAppcast.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,15 @@
1010
#define SUAPPCAST_H
1111

1212
#import <Foundation/Foundation.h>
13+
#if defined(BUILDING_SPARKLE_SOURCES_EXTERNALLY)
14+
// Ignore incorrect warning
15+
#pragma clang diagnostic push
16+
#pragma clang diagnostic ignored "-Wquoted-include-in-framework-header"
17+
#import "SUExport.h"
18+
#pragma clang diagnostic pop
19+
#else
1320
#import <Sparkle/SUExport.h>
21+
#endif
1422

1523
NS_ASSUME_NONNULL_BEGIN
1624

@@ -28,7 +36,7 @@ SU_EXPORT @interface SUAppcast : NSObject
2836
2937
These `SUAppcastItem` items are in the same order as specified in the appcast XML feed and are thus not sorted by version.
3038
*/
31-
@property (readonly, copy) NSArray<SUAppcastItem *> *items;
39+
@property (readonly, nonatomic, copy) NSArray<SUAppcastItem *> *items;
3240

3341
@end
3442

0 commit comments

Comments
 (0)