From 5fcc9a8aa958267e13e855bee165b31b7c69e359 Mon Sep 17 00:00:00 2001 From: Kornel Date: Tue, 1 Sep 2020 22:13:13 +0100 Subject: [PATCH 1/6] Merge pull request #1644 from oneeightyg/feature-1642-release-notes-url-prefix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add —release-notes-url-prefix to generate_appcast (cherry picked from commit 7ea72a2af4a28a1d6806780a9f149def772a944e) --- generate_appcast/ArchiveItem.swift | 7 +++++- generate_appcast/main.swift | 40 ++++++++++++++++++++++++------ 2 files changed, 39 insertions(+), 8 deletions(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 341941aa..29b0b13f 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -48,6 +48,7 @@ class ArchiveItem: CustomStringConvertible { var dsaSignature: String? var edSignature: String? var downloadUrlPrefix: URL? + var releaseNotesURLPrefix: URL? init(version: String, shortVersion: String?, feedURL: URL?, minimumSystemVersion: String?, publicEdKey: String?, supportsDSA: Bool, appPath: URL, archivePath: URL) throws { self.version = version @@ -188,7 +189,11 @@ class ArchiveItem: CustomStringConvertible { guard let escapedFilename = path.lastPathComponent.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) else { return nil } - if let relative = self.feedURL { + + if let releaseNotesURLPrefix = self.releaseNotesURLPrefix { + // If a URL prefix for release notes was passed on the command-line, use it + return URL(string: escapedFilename, relativeTo: releaseNotesURLPrefix) + } else if let relative = self.feedURL { return URL(string: escapedFilename, relativeTo: relative) } return URL(string: escapedFilename) diff --git a/generate_appcast/main.swift b/generate_appcast/main.swift index 0c67fc67..66523bb7 100644 --- a/generate_appcast/main.swift +++ b/generate_appcast/main.swift @@ -34,7 +34,8 @@ func printHelp() { "\t-n: provide the name of the private DSA key. This option has to be used together with `-k`\n", "\t-k: provide the name of the keychain. This option has to be used together with `-n`\n", "\t-s: provide the path to the private EdDSA key\n", - "\t--download-url-prefix: provide a static url that will be used as prefix for the url from where updates will be downloaded\n" + "\t--download-url-prefix: provide a prefix used to construct URLs for update downloads\n", + "\t--release-notes-url-prefix: provide a prefix used to construct URLs for release notes\n" ) } @@ -75,7 +76,10 @@ func loadPrivateKeys(_ privateDSAKey: SecKey?, _ privateEdString: String?) -> Pr return PrivateKeys(privateDSAKey: privateDSAKey, privateEdKey: privateEdKey, publicEdKey: publicEdKey) } -func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, privateEdString: String?, downloadUrlPrefix: URL?, archivesSourceDir: URL) { +/** + * Parses all possible command line options and returns the values in a tuple. + */ +func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, privateEdString: String?, downloadUrlPrefix: URL?, releaseNotesURLPrefix: URL?, archivesSourceDir: URL) { // if the option `-h` is in the argument list print the help dialog if argumentList.contains("-h") { printHelp() @@ -91,6 +95,7 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, var privateDSAKey: SecKey? var privateEdString: String? var downloadUrlPrefix: URL? + var releaseNotesURLPrefix: URL? var archivesSourceDir: URL // check if the private dsa key option is present @@ -171,6 +176,21 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, arguments.remove(at: downloadUrlPrefixOptionIndex + 1) arguments.remove(at: downloadUrlPrefixOptionIndex) } + + // Check if a URL prefix was specified for the release notes + if let releaseNotesURLPrefixOptionIndex = arguments.firstIndex(of: "--release-notes-url-prefix") { + if releaseNotesURLPrefixOptionIndex + 1 >= arguments.count { + print("Foo few arguments were given") + exit(1) + } + + // Get the URL prefix for the release notes + releaseNotesURLPrefix = URL(string: arguments[releaseNotesURLPrefixOptionIndex + 1]) + + // Remove the parsed argument + arguments.remove(at: releaseNotesURLPrefixOptionIndex + 1) + arguments.remove(at: releaseNotesURLPrefixOptionIndex) + } // now that all command line options have been removed from the arguments array // there should only be the path to the private DSA key (if provided) path to the archives dir left @@ -192,7 +212,7 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, // now only the archives source dir is left archivesSourceDir = URL(fileURLWithPath: arguments[0], isDirectory: true) - return (privateDSAKey, privateEdString, downloadUrlPrefix, archivesSourceDir) + return (privateDSAKey, privateEdString, downloadUrlPrefix, releaseNotesURLPrefix, archivesSourceDir) } func main() { @@ -205,20 +225,26 @@ func main() { var privateDSAKey: SecKey? var privateEdString: String? var downloadUrlPrefix: URL? + var releaseNotesURLPrefix: URL? var archivesSourceDir: URL - (privateDSAKey, privateEdString, downloadUrlPrefix, archivesSourceDir) = parseCommandLineOptions(argumentList: args) + (privateDSAKey, privateEdString, downloadUrlPrefix, releaseNotesURLPrefix, archivesSourceDir) = parseCommandLineOptions(argumentList: args) let keys = loadPrivateKeys(privateDSAKey, privateEdString) do { let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, keys: keys, verbose: verbose) - // if a download url prefix was provided set it for each archive item - if downloadUrlPrefix != nil { + // If a URL prefix was provided, set on the archive items + if downloadUrlPrefix != nil || releaseNotesURLPrefix != nil { for (_, archiveItems) in allUpdates { for archiveItem in archiveItems { - archiveItem.downloadUrlPrefix = downloadUrlPrefix + if downloadUrlPrefix != nil { + archiveItem.downloadUrlPrefix = downloadUrlPrefix + } + if releaseNotesURLPrefix != nil { + archiveItem.releaseNotesURLPrefix = releaseNotesURLPrefix + } } } } From 923f15220fd0bd8e2e82847bfb2a7bfe65ebd4a8 Mon Sep 17 00:00:00 2001 From: Kornel Date: Thu, 3 Sep 2020 13:46:13 +0100 Subject: [PATCH 2/6] Merge pull request #1648 from oneeightyg/feature-1646-generate-appcast-output-filename --- generate_appcast/main.swift | 185 ++++++++++++++++++++++-------------- 1 file changed, 113 insertions(+), 72 deletions(-) diff --git a/generate_appcast/main.swift b/generate_appcast/main.swift index 66523bb7..6ec7fcb3 100644 --- a/generate_appcast/main.swift +++ b/generate_appcast/main.swift @@ -10,33 +10,45 @@ import Foundation var verbose = false -func printUsage() { - let command = URL(fileURLWithPath: CommandLine.arguments.first!).lastPathComponent - print("Generate appcast from a directory of Sparkle update archives\n", - "Usage:\n", - " \(command) \n", - " e.g. \(command) ./my-app-release-zipfiles/\n", - "\nOR for old apps that have a DSA keys (deprecated):\n", - " \(command) \n", - " e.g. \(command) dsa_priv.pem archives/\n", - "\n", - "Appcast files and deltas will be written to the archives directory.\n", - "Note that pkg-based updates are not supported.\n" - ) +// Enum that contains keys for command-line arguments +struct CommandLineArguments { + var privateDSAKey : SecKey? + var privateEdString : String? + var downloadURLPrefix : URL? + var releaseNotesURLPrefix: URL? + var outputPathURL: URL? + var archivesSourceDir: URL? } -func printHelp() { +func printUsage() { let command = URL(fileURLWithPath: CommandLine.arguments.first!).lastPathComponent - print( - "Usage: \(command) [OPTIONS] [ARCHIVES_FOLDER]\n", - "Options:\n", - "\t-f: provide the path to the private DSA key\n", - "\t-n: provide the name of the private DSA key. This option has to be used together with `-k`\n", - "\t-k: provide the name of the keychain. This option has to be used together with `-n`\n", - "\t-s: provide the path to the private EdDSA key\n", - "\t--download-url-prefix: provide a prefix used to construct URLs for update downloads\n", - "\t--release-notes-url-prefix: provide a prefix used to construct URLs for release notes\n" - ) + let usage = """ + +Generate appcast from a directory of Sparkle update archives + +Usage: \(command) [OPTIONS] [ARCHIVES_FOLDER] + -h: prints this message + -f: provide the path to the private DSA key + -n: provide the name of the private DSA key. This option must be used with `-k` + -k: provide the name of the keychain. This option must be used with `-n` + -s: provide the path to the private EdDSA key + -o: provide a filename for the generated appcast (allowed when only one will be created) + + --download-url-prefix: provide a prefix used to construct URLs for update downloads + --release-notes-url-prefix: provide a prefix used to construct URLs for release notes + +Examples: + \(command) ./my-app-release-zipfiles/ + \(command) -o appcast-name.xml ./my-app-release-zipfiles/ + + \(command) dsa_priv.pem ./my-app-release-zipfiles/ [DEPRECATED] + +Appcast files and deltas will be written to the archives directory. +Note that pkg-based updates are not supported. + +""" + + print(usage) } func loadPrivateKeys(_ privateDSAKey: SecKey?, _ privateEdString: String?) -> PrivateKeys { @@ -77,26 +89,24 @@ func loadPrivateKeys(_ privateDSAKey: SecKey?, _ privateEdString: String?) -> Pr } /** - * Parses all possible command line options and returns the values in a tuple. + * Parses all possible command line options and returns a struct that contains them */ -func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, privateEdString: String?, downloadUrlPrefix: URL?, releaseNotesURLPrefix: URL?, archivesSourceDir: URL) { - // if the option `-h` is in the argument list print the help dialog - if argumentList.contains("-h") { - printHelp() +func parseCommandLineOptions() -> CommandLineArguments { + var arguments = CommandLine.arguments + + // If there are fewer than two arguments (the name of the application + + // the required archive directory), or if `-h` is in the argument list, + // then show the usage message + if arguments.count < 2 || arguments.contains("-h") { + printUsage() exit(1) } - - // make a mutable copy of the argument list - var arguments = argumentList - // remove the first element since this is the path to executable which we don't need + + // Remove the first element since this is the path to executable which we don't need arguments.removeFirst() - // define the variables for the possible argument values - var privateDSAKey: SecKey? - var privateEdString: String? - var downloadUrlPrefix: URL? - var releaseNotesURLPrefix: URL? - var archivesSourceDir: URL + // Create the struct that will hold the parsed args + var commandLineArguments = CommandLineArguments() // check if the private dsa key option is present if let privateDSAKeyOptionIndex = arguments.firstIndex(of: "-f") { @@ -109,7 +119,7 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, // get the private DSA key let privateKeyUrl = URL(fileURLWithPath: arguments[privateDSAKeyOptionIndex + 1]) do { - privateDSAKey = try loadPrivateDSAKey(at: privateKeyUrl) + commandLineArguments.privateDSAKey = try loadPrivateDSAKey(at: privateKeyUrl) } catch { print("Unable to load DSA private key from", privateKeyUrl.path, "\n", error) exit(1) @@ -132,7 +142,7 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, let keyName: String = arguments[keyNameOptionIndex + 1] let keychainUrl: URL = URL(fileURLWithPath: arguments[keychainNameOptionIndex + 1]) do { - privateDSAKey = try loadPrivateDSAKey(named: keyName, fromKeychainAt: keychainUrl) + commandLineArguments.privateDSAKey = try loadPrivateDSAKey(named: keyName, fromKeychainAt: keychainUrl) } catch { print("Unable to load DSA private key '\(keyName)' from keychain at", keychainUrl.path, "\n", error) exit(1) @@ -154,7 +164,7 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, } // get the private EdDSA key string - privateEdString = arguments[privateEdDSAKeyOptionIndex + 1] + commandLineArguments.privateEdString = arguments[privateEdDSAKeyOptionIndex + 1] // remove the already parsed argument arguments.remove(at: privateEdDSAKeyOptionIndex + 1) @@ -170,7 +180,7 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, } // get the download url prefix - downloadUrlPrefix = URL(string: arguments[downloadUrlPrefixOptionIndex + 1]) + commandLineArguments.downloadURLPrefix = URL(string: arguments[downloadUrlPrefixOptionIndex + 1]) // remove the parsed argument arguments.remove(at: downloadUrlPrefixOptionIndex + 1) @@ -180,28 +190,44 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, // Check if a URL prefix was specified for the release notes if let releaseNotesURLPrefixOptionIndex = arguments.firstIndex(of: "--release-notes-url-prefix") { if releaseNotesURLPrefixOptionIndex + 1 >= arguments.count { - print("Foo few arguments were given") + print("Too few arguments were given") exit(1) } // Get the URL prefix for the release notes - releaseNotesURLPrefix = URL(string: arguments[releaseNotesURLPrefixOptionIndex + 1]) + commandLineArguments.releaseNotesURLPrefix = URL(string: arguments[releaseNotesURLPrefixOptionIndex + 1]) // Remove the parsed argument arguments.remove(at: releaseNotesURLPrefixOptionIndex + 1) arguments.remove(at: releaseNotesURLPrefixOptionIndex) } + + // Check if an output filename was specified + if let outputFilenameOptionIndex = arguments.firstIndex(of: "-o") { + // check that when accessing the value of the option we don't get out of bounds + if outputFilenameOptionIndex + 1 >= arguments.count { + print("Too few arguments were given") + exit(1) + } + + // Get the URL prefix for the release notes + commandLineArguments.outputPathURL = URL(fileURLWithPath: arguments[outputFilenameOptionIndex + 1]) + + // Remove the parsed argument + arguments.remove(at: outputFilenameOptionIndex + 1) + arguments.remove(at: outputFilenameOptionIndex) + } // now that all command line options have been removed from the arguments array // there should only be the path to the private DSA key (if provided) path to the archives dir left if arguments.count == 2 { // if there are two arguments left they are the private DSA key and the path to the archives directory (in this order) // first get the private DSA key - let privateKeyUrl = URL(fileURLWithPath: arguments[0]) + let privateKeyURL = URL(fileURLWithPath: arguments[0]) do { - privateDSAKey = try loadPrivateDSAKey(at: privateKeyUrl) + commandLineArguments.privateDSAKey = try loadPrivateDSAKey(at: privateKeyURL) } catch { - print("Unable to load DSA private key from", privateKeyUrl.path, "\n", error) + print("Unable to load DSA private key from", privateKeyURL.path, "\n", error) exit(1) } @@ -210,49 +236,64 @@ func parseCommandLineOptions(argumentList: [String]) -> (privateDSAKey: SecKey?, } // now only the archives source dir is left - archivesSourceDir = URL(fileURLWithPath: arguments[0], isDirectory: true) + if let archivesSourceDir = arguments.first { + commandLineArguments.archivesSourceDir = URL(fileURLWithPath: archivesSourceDir, isDirectory: true) + } else { + print("Archive folder must be specified") + exit(1); + } - return (privateDSAKey, privateEdString, downloadUrlPrefix, releaseNotesURLPrefix, archivesSourceDir) + return commandLineArguments } func main() { - let args = CommandLine.arguments - if args.count < 2 { - printUsage() - exit(1) - } - - var privateDSAKey: SecKey? - var privateEdString: String? - var downloadUrlPrefix: URL? - var releaseNotesURLPrefix: URL? - var archivesSourceDir: URL - - (privateDSAKey, privateEdString, downloadUrlPrefix, releaseNotesURLPrefix, archivesSourceDir) = parseCommandLineOptions(argumentList: args) - - let keys = loadPrivateKeys(privateDSAKey, privateEdString) - + // Parse the command line arguments + let args = parseCommandLineOptions() + + // If parsing the command line options was successful, then + // the archivesSourceDir must exist + let archivesSourceDir = args.archivesSourceDir! + + // Extract the keys + let keys = loadPrivateKeys(args.privateDSAKey, args.privateEdString) + do { let allUpdates = try makeAppcast(archivesSourceDir: archivesSourceDir, keys: keys, verbose: verbose) // If a URL prefix was provided, set on the archive items - if downloadUrlPrefix != nil || releaseNotesURLPrefix != nil { + if args.downloadURLPrefix != nil || args.releaseNotesURLPrefix != nil { for (_, archiveItems) in allUpdates { for archiveItem in archiveItems { - if downloadUrlPrefix != nil { - archiveItem.downloadUrlPrefix = downloadUrlPrefix + if let downloadURLPrefix = args.downloadURLPrefix { + archiveItem.downloadUrlPrefix = downloadURLPrefix } - if releaseNotesURLPrefix != nil { + if let releaseNotesURLPrefix = args.releaseNotesURLPrefix { archiveItem.releaseNotesURLPrefix = releaseNotesURLPrefix } } } } + // If a (single) output filename was specified on the command-line, but more than one + // appcast file was found in the archives, then it's an error. + if let outputPathURL = args.outputPathURL, + allUpdates.count > 1 { + print("Cannot write to \(outputPathURL.path): multiple appcasts found") + exit(1); + } + for (appcastFile, updates) in allUpdates { - let appcastDestPath = URL(fileURLWithPath: appcastFile, relativeTo: archivesSourceDir) + // If an output filename was specified, use it. + // Otherwise, use the name of the appcast file found in the archive. + let appcastDestPath = args.outputPathURL ?? URL(fileURLWithPath: appcastFile, + relativeTo: archivesSourceDir) + + // Write the appcast try writeAppcast(appcastDestPath: appcastDestPath, updates: updates) - print("Written", appcastDestPath.path, "based on", updates.count, "updates") + + // Inform the user, pluralizing "update" if necessary + let updateString = (updates.count == 1) ? "update" : "updates" + print("Wrote \(updates.count) \(updateString) to: \(appcastDestPath.path)") } } catch { print("Error generating appcast from directory", archivesSourceDir.path, "\n", error) From 65cab6a14d3efd49c6cdaa986113317cace2e562 Mon Sep 17 00:00:00 2001 From: Brad Andalman Date: Wed, 2 Sep 2020 18:14:27 -0700 Subject: [PATCH 3/6] =?UTF-8?q?generate=5Fappcast=20can=20update=20the=20r?= =?UTF-8?q?elease=20notes=20element=E2=80=99s=20URL=20when=20required?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously, generate_appcast could only add or remove the release notes element for an update. This was probably fine, because it was unlikely to change: the release notes URL was determined by the SUFeedURL. However, now that —release-notes-url-prefix was added, the release notes element CAN change. So, with this commit, if the release notes element is present for an update, the URL will be set correctly. (cherry picked from commit 7c7e924ed45603a36a8d6ef1ac4ff5b01659c3e1) --- generate_appcast/FeedXML.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/generate_appcast/FeedXML.swift b/generate_appcast/FeedXML.swift index 1834a577..07040b85 100644 --- a/generate_appcast/FeedXML.swift +++ b/generate_appcast/FeedXML.swift @@ -108,16 +108,24 @@ func writeAppcast(appcastDestPath: URL, updates: [ArchiveItem]) throws { } minVer?.setChildren([text(update.minimumSystemVersion)]) + // Look for an existing release notes element let releaseNotesXpath = "\(SUAppcastElementReleaseNotesLink)" let results = ((try? item.nodes(forXPath: releaseNotesXpath)) as? [XMLElement])? .filter { !($0.attributes ?? []) .contains(where: { $0.name == SUXMLLanguage }) } let relElement = results?.first + if let url = update.releaseNotesURL { - if nil == relElement { + // The update includes a valid release notes URL + if let existingReleaseNotesElement = relElement { + // The existing item includes a release notes element. Update it. + existingReleaseNotesElement.stringValue = url.absoluteString + } else { + // The existing item doesn't have a release notes element. Add one. item.addChild(XMLElement.element(withName: SUAppcastElementReleaseNotesLink, stringValue: url.absoluteString) as! XMLElement) } } else if let childIndex = relElement?.index { + // The update doesn't include a release notes URL. Remove it. item.removeChild(at: childIndex) } From bc6d15a13c32639fb207031ac8a2ccbb0d854d83 Mon Sep 17 00:00:00 2001 From: Bi11 Date: Thu, 3 Sep 2020 16:37:13 +0800 Subject: [PATCH 4/6] Support App Store URL scheme in release note webview (cherry picked from commit f2fc729b69a28ae671a947f6e2bab4131946af23) --- Sparkle/SUUpdateAlert.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sparkle/SUUpdateAlert.m b/Sparkle/SUUpdateAlert.m index 9628bb24..75e83e5f 100644 --- a/Sparkle/SUUpdateAlert.m +++ b/Sparkle/SUUpdateAlert.m @@ -479,7 +479,8 @@ static NSString *const SUUpdateAlertTouchBarIndentifier = @"" SPARKLE_BUNDLE_IDE { NSURL *requestURL = request.URL; NSString *scheme = requestURL.scheme; - BOOL whitelistedSafe = [scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"] || [requestURL.absoluteString isEqualToString:@"about:blank"]; + BOOL isAboutBlank = [requestURL.absoluteString isEqualToString:@"about:blank"]; + BOOL whitelistedSafe = isAboutBlank || [@[@"http", @"https", @"macappstore", @"macappstores", @"itms-apps", @"itms-appss"] containsObject:scheme]; // Do not allow redirects to dangerous protocols such as file:// if (!whitelistedSafe) { From 6f1fceb7d4a9b958fadbe3d6a08b4c679542059c Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 10 Sep 2020 14:00:58 +0200 Subject: [PATCH 5/6] generate_appcast follow symbolic links When archives are stored as symlinks e.g. due to storing binary files in a git-annex repository, everything works file except file size in the generate feed xml file. This patch makes generate_appcast correctly determine file size by following the symlink (cherry picked from commit 7233bb93e79bb67e0ce2dc6749f3061a410d4eaf) --- generate_appcast/ArchiveItem.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/generate_appcast/ArchiveItem.swift b/generate_appcast/ArchiveItem.swift index 29b0b13f..52a8181a 100644 --- a/generate_appcast/ArchiveItem.swift +++ b/generate_appcast/ArchiveItem.swift @@ -63,7 +63,8 @@ class ArchiveItem: CustomStringConvertible { } else { self.publicEdKey = nil } - self.archiveFileAttributes = try FileManager.default.attributesOfItem(atPath: self.archivePath.path) + let path = (self.archivePath.path as NSString).resolvingSymlinksInPath + self.archiveFileAttributes = try FileManager.default.attributesOfItem(atPath: path) self.deltas = [] } From e3ba2388e8f4ead6f31068b434b1a0bea3928ac6 Mon Sep 17 00:00:00 2001 From: Gwynne Raskind Date: Wed, 23 Sep 2020 07:36:55 -0500 Subject: [PATCH 6/6] Fix tests to actually build --- Tests/SUAppcastTest.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tests/SUAppcastTest.swift b/Tests/SUAppcastTest.swift index 387cb96d..0ffa6a51 100644 --- a/Tests/SUAppcastTest.swift +++ b/Tests/SUAppcastTest.swift @@ -74,7 +74,8 @@ class SUAppcastTest: XCTestCase { XCTAssertNotNil(testFileUrl) do { - let items = try appcast.parseAppcastItems(fromXMLFile: testFileUrl) as! [SUAppcastItem]; + let testFileData = try Data(contentsOf: testFileUrl) + let items = try appcast.parseAppcastItems(fromXMLData: testFileData, relativeTo: testFileUrl) as! [SUAppcastItem]; XCTAssertEqual("https://sparkle-project.org/#localized_notes_link_works", items[0].releaseNotesURL.absoluteString) } catch let err as NSError { NSLog("%@", err)