From fdb9d5473985c10cda5ebd18696b874d9f31e2d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 23 Sep 2022 13:54:45 +0200 Subject: [PATCH 1/4] Bump third-party dependencies --- Cartfile | 8 ++++---- Package.swift | 10 +++++----- Support/CocoaPods/ReadiumLCP.podspec | 2 +- Support/CocoaPods/ReadiumNavigator.podspec | 4 ++-- Support/CocoaPods/ReadiumOPDS.podspec | 2 +- Support/CocoaPods/ReadiumShared.podspec | 6 +++--- Support/CocoaPods/ReadiumStreamer.podspec | 6 +++--- TestApp/Integrations/CocoaPods/Podfile | 2 +- TestApp/Integrations/CocoaPods/Podfile+lcp | 2 +- 9 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cartfile b/Cartfile index d01f83013..93055555f 100644 --- a/Cartfile +++ b/Cartfile @@ -1,8 +1,8 @@ github "cezheng/Fuzi" ~> 3.1.3 github "dexman/Minizip" ~> 1.4.0 github "krzyzanowskim/CryptoSwift" ~> 1.3.8 -github "ra1028/DifferenceKit" ~> 1.2.0 -github "readium/GCDWebServer" ~> 3.6.3 -github "scinfu/SwiftSoup" ~> 2.3.2 -github "stephencelis/SQLite.swift" ~> 0.12.2 +github "ra1028/DifferenceKit" ~> 1.3.0 +github "readium/GCDWebServer" ~> 3.7.3 +github "scinfu/SwiftSoup" ~> 2.4.3 +github "stephencelis/SQLite.swift" ~> 0.13.3 github "weichsel/ZIPFoundation" == 0.9.11 # 0.9.12 requires iOS 12+ diff --git a/Package.swift b/Package.swift index ff74a1d4f..4effc57fe 100644 --- a/Package.swift +++ b/Package.swift @@ -21,11 +21,11 @@ let package = Package( dependencies: [ .package(url: "https://github.com/cezheng/Fuzi.git", from: "3.1.3"), .package(url: "https://github.com/krzyzanowskim/CryptoSwift.git", from: "1.3.8"), - .package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.1"), - .package(url: "https://github.com/ra1028/DifferenceKit.git", from: "1.2.0"), - .package(url: "https://github.com/readium/GCDWebServer.git", from: "3.7.0"), - .package(url: "https://github.com/scinfu/SwiftSoup.git", from: "2.3.2"), - .package(url: "https://github.com/stephencelis/SQLite.swift.git", from: "0.12.2"), + .package(url: "https://github.com/marmelroy/Zip.git", from: "2.1.2"), + .package(url: "https://github.com/ra1028/DifferenceKit.git", from: "1.3.0"), + .package(url: "https://github.com/readium/GCDWebServer.git", from: "3.7.3"), + .package(url: "https://github.com/scinfu/SwiftSoup.git", from: "2.4.3"), + .package(url: "https://github.com/stephencelis/SQLite.swift.git", from: "0.13.3"), // 0.9.12 requires iOS 12+ .package(url: "https://github.com/weichsel/ZIPFoundation.git", "0.9.0"..<"0.9.12"), ], diff --git a/Support/CocoaPods/ReadiumLCP.podspec b/Support/CocoaPods/ReadiumLCP.podspec index c43f9fe31..e4cf63901 100644 --- a/Support/CocoaPods/ReadiumLCP.podspec +++ b/Support/CocoaPods/ReadiumLCP.podspec @@ -22,6 +22,6 @@ Pod::Spec.new do |s| s.dependency 'R2Shared' s.dependency 'ZIPFoundation', '<= 0.9.11' # 0.9.12 requires iOS 12+ - s.dependency 'SQLite.swift', '~> 0.12.2' + s.dependency 'SQLite.swift', '~> 0.13' s.dependency 'CryptoSwift', '~> 1.3.8' end diff --git a/Support/CocoaPods/ReadiumNavigator.podspec b/Support/CocoaPods/ReadiumNavigator.podspec index 7fa03402a..7d2cf0c2c 100644 --- a/Support/CocoaPods/ReadiumNavigator.podspec +++ b/Support/CocoaPods/ReadiumNavigator.podspec @@ -18,7 +18,7 @@ Pod::Spec.new do |s| s.platform = :ios s.ios.deployment_target = "10.0" s.dependency 'R2Shared' - s.dependency 'DifferenceKit' - s.dependency 'SwiftSoup', '~> 2.3' + s.dependency 'DifferenceKit', '~> 1.0' + s.dependency 'SwiftSoup', '~> 2.0' end diff --git a/Support/CocoaPods/ReadiumOPDS.podspec b/Support/CocoaPods/ReadiumOPDS.podspec index 76be31a90..18be47c85 100644 --- a/Support/CocoaPods/ReadiumOPDS.podspec +++ b/Support/CocoaPods/ReadiumOPDS.podspec @@ -17,6 +17,6 @@ Pod::Spec.new do |s| s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' } s.dependency 'R2Shared' - s.dependency 'Fuzi', '~> 3.1.3' + s.dependency 'Fuzi', '~> 3.0' end diff --git a/Support/CocoaPods/ReadiumShared.podspec b/Support/CocoaPods/ReadiumShared.podspec index 8d594f294..d8888b72a 100644 --- a/Support/CocoaPods/ReadiumShared.podspec +++ b/Support/CocoaPods/ReadiumShared.podspec @@ -19,8 +19,8 @@ Pod::Spec.new do |s| s.libraries = 'xml2' s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' } - s.dependency 'Fuzi', '~> 3.1.3' - s.dependency 'Minizip', '~> 1.0.0' - s.dependency 'SwiftSoup', '~> 2.3' + s.dependency 'Fuzi', '~> 3.0' + s.dependency 'Minizip', '~> 1.0' + s.dependency 'SwiftSoup', '~> 2.0' end diff --git a/Support/CocoaPods/ReadiumStreamer.podspec b/Support/CocoaPods/ReadiumStreamer.podspec index 5985ab78a..abd6e6aca 100644 --- a/Support/CocoaPods/ReadiumStreamer.podspec +++ b/Support/CocoaPods/ReadiumStreamer.podspec @@ -22,8 +22,8 @@ Pod::Spec.new do |s| s.dependency 'R2Shared' s.dependency 'CryptoSwift', '~> 1.3.8' - s.dependency 'Fuzi', '~> 3.1.3' - s.dependency 'GCDWebServer', '~> 3.6.3' - s.dependency 'Minizip', '~> 1.0.0' + s.dependency 'Fuzi', '~> 3.0' + s.dependency 'GCDWebServer', '~> 3.0' + s.dependency 'Minizip', '~> 1.0' end diff --git a/TestApp/Integrations/CocoaPods/Podfile b/TestApp/Integrations/CocoaPods/Podfile index 038bcf02a..7dede64dc 100644 --- a/TestApp/Integrations/CocoaPods/Podfile +++ b/TestApp/Integrations/CocoaPods/Podfile @@ -10,7 +10,7 @@ target 'TestApp' do pod 'ReadiumOPDS', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/VERSION/Support/CocoaPods/ReadiumOPDS.podspec' # Required for R2Streamer. - pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/3.6.3/GCDWebServer.podspec' + pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/master/GCDWebServer.podspec' pod 'GRDB.swift' pod 'Kingfisher' diff --git a/TestApp/Integrations/CocoaPods/Podfile+lcp b/TestApp/Integrations/CocoaPods/Podfile+lcp index e07f6a148..1777531ab 100644 --- a/TestApp/Integrations/CocoaPods/Podfile+lcp +++ b/TestApp/Integrations/CocoaPods/Podfile+lcp @@ -12,7 +12,7 @@ target 'TestApp' do pod 'R2LCPClient', podspec: 'LCP_URL' # Required for R2Streamer. - pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/3.6.3/GCDWebServer.podspec' + pod 'GCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/master/GCDWebServer.podspec' pod 'GRDB.swift' pod 'Kingfisher' From fe0b9a3515269c0c3a2c2ee75999a5d1732b81bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 23 Sep 2022 15:03:42 +0200 Subject: [PATCH 2/4] Fix build warnings --- Sources/Navigator/TTS/AVTTSEngine.swift | 2 +- .../Content/Iterators/HTMLResourceContentIterator.swift | 2 +- Sources/Shared/Toolkit/Extensions/String.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Navigator/TTS/AVTTSEngine.swift b/Sources/Navigator/TTS/AVTTSEngine.swift index 125934e4d..901064547 100644 --- a/Sources/Navigator/TTS/AVTTSEngine.swift +++ b/Sources/Navigator/TTS/AVTTSEngine.swift @@ -369,7 +369,7 @@ private extension TTSVoice.Quality { switch voice.quality { case .default: self = .medium - case .enhanced: + case .enhanced, .premium: self = .high @unknown default: return nil diff --git a/Sources/Shared/Publication/Services/Content/Iterators/HTMLResourceContentIterator.swift b/Sources/Shared/Publication/Services/Content/Iterators/HTMLResourceContentIterator.swift index 9e4a03f11..00a984ef2 100644 --- a/Sources/Shared/Publication/Services/Content/Iterators/HTMLResourceContentIterator.swift +++ b/Sources/Shared/Publication/Services/Content/Iterators/HTMLResourceContentIterator.swift @@ -154,7 +154,7 @@ public class HTMLResourceContentIterator: ContentIterator { locator: baseLocator.copy( locations: { $0 = Locator.Locations( - otherLocations: ["cssSelector": try? elem.cssSelector()] + otherLocations: ["cssSelector": (try? elem.cssSelector()) as Any] ) } ), diff --git a/Sources/Shared/Toolkit/Extensions/String.swift b/Sources/Shared/Toolkit/Extensions/String.swift index 9b9cb5024..df78d58d2 100644 --- a/Sources/Shared/Toolkit/Extensions/String.swift +++ b/Sources/Shared/Toolkit/Extensions/String.swift @@ -61,7 +61,7 @@ extension String { } /// Same as `index(_,offsetBy:)` but without crashing when reaching the end of the string. - func clampedIndex(_ i: String.Index, offsetBy n: String.IndexDistance) -> String.Index { + func clampedIndex(_ i: String.Index, offsetBy n: Int) -> String.Index { precondition(n != 0) let limit = (n > 0) ? endIndex : startIndex guard let index = index(i, offsetBy: n, limitedBy: limit) else { From 6dc6fdbd81fe73afa7a13e1c33484b52105d4e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 23 Sep 2022 15:05:53 +0200 Subject: [PATCH 3/4] Update changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2784a9af2..59f58255f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,8 @@ All notable changes to this project will be documented in this file. Take a look ### Fixed +* [#244](https://github.com/readium/swift-toolkit/issues/244) Fixed build with Xcode 14 and Carthage/CocoaPods. + #### Navigator * Fixed memory leaks in the EPUB and PDF navigators. From c55c08fb99f7d7a04a0db2ba4357f0dea92bf9dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Fri, 23 Sep 2022 15:28:43 +0200 Subject: [PATCH 4/4] Fix build --- Sources/Navigator/TTS/AVTTSEngine.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Navigator/TTS/AVTTSEngine.swift b/Sources/Navigator/TTS/AVTTSEngine.swift index 901064547..125934e4d 100644 --- a/Sources/Navigator/TTS/AVTTSEngine.swift +++ b/Sources/Navigator/TTS/AVTTSEngine.swift @@ -369,7 +369,7 @@ private extension TTSVoice.Quality { switch voice.quality { case .default: self = .medium - case .enhanced, .premium: + case .enhanced: self = .high @unknown default: return nil