diff --git a/.travis.yml b/.travis.yml index db94a4a..0c0f8d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ language: swift -osx_image: xcode12.2 +osx_image: xcode12.5 xcode_project: r2-streamer-swift.xcodeproj xcode_scheme: r2-streamer-swift -xcode_destination: platform=iOS Simulator,OS=11.3,name=iPhone X -xcode_sdk: iphonesimulator13.0 +xcode_destination: platform=iOS Simulator,OS=14.5.1,name=iPhone X +xcode_sdk: iphonesimulator14.5.1 branches: only: @@ -18,6 +18,11 @@ before_install: - brew update - brew outdated carthage || brew upgrade carthage - carthage bootstrap --verbose --no-use-binaries --use-xcframeworks --platform iOS --cache-builds + # The project expects .framework but we can only build XCFrameworks with Carthage on Xcode 12+. + # As a workaround, this will extract the .framework generated from the .xcframework files. + # See https://github.com/readium/r2-testapp-swift/issues/351#issuecomment-829250100 + - mkdir -p Carthage/Build/iOS + - cp -r Carthage/Build/*.xcframework/ios-arm64_armv7/*.framework Carthage/Build/iOS script: - xcodebuild clean build -quiet diff --git a/CHANGELOG.md b/CHANGELOG.md index 5022072..fe8e27a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file. +## [2.0.0] + +### Deprecated + +* All APIs deprecated in previous versions are now unavailable. + + ## [2.0.0-beta.2] ### Added @@ -62,3 +69,4 @@ All notable changes to this project will be documented in this file. [2.0.0-alpha.2]: https://github.com/readium/r2-streamer-swift/compare/2.0.0-alpha.1...2.0.0-alpha.2 [2.0.0-beta.1]: https://github.com/readium/r2-streamer-swift/compare/2.0.0-alpha.2...2.0.0-beta.1 [2.0.0-beta.2]: https://github.com/readium/r2-streamer-swift/compare/2.0.0-beta.1...2.0.0-beta.2 +[2.0.0]: https://github.com/readium/r2-streamer-swift/compare/2.0.0-beta.2...2.0.0 diff --git a/Cartfile b/Cartfile index c350925..0fb8dc9 100644 --- a/Cartfile +++ b/Cartfile @@ -1,4 +1,4 @@ -github "readium/r2-shared-swift" "develop" +github "readium/r2-shared-swift" == 2.0.0 github "dexman/Minizip" == 1.4.0 github "cezheng/Fuzi" == 3.1.3 github "krzyzanowskim/CryptoSwift" == 1.3.8 diff --git a/Cartfile.resolved b/Cartfile.resolved index 2bf4168..6da2579 100644 --- a/Cartfile.resolved +++ b/Cartfile.resolved @@ -2,4 +2,4 @@ github "cezheng/Fuzi" "3.1.3" github "dexman/Minizip" "1.4.0" github "edrlab/GCDWebServer" "3.6.3" github "krzyzanowskim/CryptoSwift" "1.3.8" -github "readium/r2-shared-swift" "d8b571d2ad66b2f7b7c44278e1269332b69559ab" +github "readium/r2-shared-swift" "2.0.0" diff --git a/R2Streamer.podspec b/R2Streamer.podspec index 534de04..7e56b4f 100644 --- a/R2Streamer.podspec +++ b/R2Streamer.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "R2Streamer" - s.version = "2.0.0-beta.2" + s.version = "2.0.0" s.license = "BSD 3-Clause License" s.summary = "R2 Streamer" s.homepage = "http://readium.github.io" diff --git a/r2-streamer-swift.xcodeproj/project.pbxproj b/r2-streamer-swift.xcodeproj/project.pbxproj index 8914867..df9f147 100644 --- a/r2-streamer-swift.xcodeproj/project.pbxproj +++ b/r2-streamer-swift.xcodeproj/project.pbxproj @@ -597,7 +597,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1020; - LastUpgradeCheck = 1240; + LastUpgradeCheck = 1250; ORGANIZATIONNAME = Readium; TargetAttributes = { 59501DCC1E2FB0D700D1B4BF = { diff --git a/r2-streamer-swift.xcodeproj/xcshareddata/xcschemes/r2-streamer-swift.xcscheme b/r2-streamer-swift.xcodeproj/xcshareddata/xcschemes/r2-streamer-swift.xcscheme index 9073ef8..21cdfad 100644 --- a/r2-streamer-swift.xcodeproj/xcshareddata/xcschemes/r2-streamer-swift.xcscheme +++ b/r2-streamer-swift.xcodeproj/xcshareddata/xcschemes/r2-streamer-swift.xcscheme @@ -1,6 +1,6 @@ [Link] { - return map { node in - return Link( - href: "\(href)#page=\(node.pageNumber)", - type: MediaType.pdf.string, - title: node.title, - children: node.children.links(withHref: href) - ) - } - } + @available(*, unavailable) + func links(withHref href: String) -> [Link] { [] } } /// Protocol to implement if you want to use a different PDF engine than the one provided with Readium 2 to parse the PDF's metadata. /// Note: this is not used in the case of .lcpdf files, since the metadata are parsed from the manifest.json file. -@available(*, deprecated, message: "Use `PDFDocumentFactory` from r2-shared instead") +@available(*, unavailable, message: "Use `PDFDocumentFactory` from r2-shared instead") public protocol PDFFileParser: PDFDocument { /// Initializes the parser with the given PDF data stream. @@ -85,30 +77,37 @@ public protocol PDFFileParser: PDFDocument { } -@available(*, deprecated) +@available(*, unavailable) public extension PDFFileParser { + @available(*, unavailable) var identifier: String? { try? parseMetadata().identifier } + @available(*, unavailable) var pageCount: Int { (try? parseNumberOfPages()) ?? 0 } + @available(*, unavailable) var cover: UIImage? { try? renderCover() } + @available(*, unavailable) var title: String? { try? parseMetadata().title } + @available(*, unavailable) var author: String? { try? parseMetadata().author } + @available(*, unavailable) var subject: String? { try? parseMetadata().subject } + @available(*, unavailable) var keywords: [String] { (try? parseMetadata().keywords) ?? [] } - var outline: [R2Shared.PDFOutlineNode] { (try? parseMetadata().outline.map { $0.asShared() }) ?? [] } - + @available(*, unavailable) + var outline: [R2Shared.PDFOutlineNode] { [] } + } -@available(*, deprecated) +@available(*, unavailable) extension PDFOutlineNode { - func asShared() -> R2Shared.PDFOutlineNode { - R2Shared.PDFOutlineNode(title: title, pageNumber: pageNumber, children: children.map { $0.asShared() }) - } + @available(*, unavailable) + func asShared() -> R2Shared.PDFOutlineNode { fatalError("Unavailable") } } -@available(*, deprecated, message: "Use `PDFDocumentFactory` from r2-shared instead") +@available(*, unavailable, message: "Use `PDFDocumentFactory` from r2-shared instead") class PDFFileParserFactory: PDFDocumentFactory { enum Error: Swift.Error { diff --git a/r2-streamer-swift/Parser/PDF/PDFParser.swift b/r2-streamer-swift/Parser/PDF/PDFParser.swift index a1959b9..bb5a707 100644 --- a/r2-streamer-swift/Parser/PDF/PDFParser.swift +++ b/r2-streamer-swift/Parser/PDF/PDFParser.swift @@ -73,7 +73,7 @@ public final class PDFParser: PublicationParser, Loggable { ) } - @available(*, deprecated, message: "Use `init(pdfFactory:)` instead") + @available(*, unavailable, message: "Use `init(pdfFactory:)` instead") public convenience init(parserType: PDFFileParser.Type) { self.init(pdfFactory: PDFFileParserFactory(parserType: parserType)) } diff --git a/r2-streamer-swift/Parser/Readium/ReadiumWebPubParser.swift b/r2-streamer-swift/Parser/Readium/ReadiumWebPubParser.swift index 927f511..b2e01ac 100644 --- a/r2-streamer-swift/Parser/Readium/ReadiumWebPubParser.swift +++ b/r2-streamer-swift/Parser/Readium/ReadiumWebPubParser.swift @@ -110,8 +110,8 @@ private extension MediaType { } -@available(*, deprecated, renamed: "ReadiumWebPubParserError") +@available(*, unavailable, renamed: "ReadiumWebPubParserError") public typealias WEBPUBParserError = ReadiumWebPubParserError -@available(*, deprecated, renamed: "ReadiumWebPubParser") +@available(*, unavailable, renamed: "ReadiumWebPubParser") public typealias WEBPUBParser = ReadiumWebPubParser diff --git a/r2-streamer-swift/Toolkit/Extensions/Fetcher.swift b/r2-streamer-swift/Toolkit/Extensions/Fetcher.swift index 18df305..6dcbad4 100644 --- a/r2-streamer-swift/Toolkit/Extensions/Fetcher.swift +++ b/r2-streamer-swift/Toolkit/Extensions/Fetcher.swift @@ -61,7 +61,7 @@ extension Fetcher { /// This is used as a support for backward compatibility in the old parser APIs, the `Streamer` /// implements its own algorithm for creating the leaf fetcher, with a recovery mechanism /// to handle user password. -@available(*, deprecated) +@available(*, unavailable) func makeFetcher(for url: URL) throws -> Fetcher { guard (try? url.checkResourceIsReachable()) == true else { throw Publication.OpeningError.notFound diff --git a/r2-streamer-swift/Toolkit/Logger.swift b/r2-streamer-swift/Toolkit/Logger.swift index 432b78c..2514e7d 100644 --- a/r2-streamer-swift/Toolkit/Logger.swift +++ b/r2-streamer-swift/Toolkit/Logger.swift @@ -12,7 +12,7 @@ import Foundation import R2Shared -@available(*, deprecated, message: "Use `R2Shared.R2EnableLog` instead") +@available(*, unavailable, message: "Use `R2Shared.R2EnableLog` instead") public func R2StreamerEnableLog(withMinimumSeverityLevel level: SeverityLevel, customLogger: LoggerType = LoggerStub()) -> () { R2EnableLog(withMinimumSeverityLevel: level, customLogger: customLogger) }