Skip to content
This repository has been archived by the owner on Aug 12, 2022. It is now read-only.

Commit

Permalink
2.0.0 (#207)
Browse files Browse the repository at this point in the history
  • Loading branch information
mickael-menu authored May 25, 2021
1 parent 4067b31 commit 6928a52
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 39 deletions.
11 changes: 8 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ All notable changes to this project will be documented in this file.

<!--## [Unreleased]-->

## [2.0.0]

### Deprecated

* All APIs deprecated in previous versions are now unavailable.


## [2.0.0-beta.2]

### Added
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion Cartfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cartfile.resolved
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion R2Streamer.podspec
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion r2-streamer-swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 1020;
LastUpgradeCheck = 1240;
LastUpgradeCheck = 1250;
ORGANIZATIONNAME = Readium;
TargetAttributes = {
59501DCC1E2FB0D700D1B4BF = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1240"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
4 changes: 2 additions & 2 deletions r2-streamer-swift/Parser/EPUB/EPUBParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ public enum EPUBParserError: Error {
case missingRootfile
}

@available(*, deprecated, renamed: "EPUBParserError")
@available(*, unavailable, renamed: "EPUBParserError")
public typealias EpubParserError = EPUBParserError

@available(*, deprecated, renamed: "EPUBParser")
@available(*, unavailable, renamed: "EPUBParser")
public typealias EpubParser = EPUBParser

extension EPUBParser: Loggable {}
Expand Down
2 changes: 1 addition & 1 deletion r2-streamer-swift/Parser/Image/CBZParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public enum CBZParserError: Error {
case invalidCBZ(path: String)
}

@available(*, deprecated, renamed: "CBZParserError")
@available(*, unavailable, renamed: "CBZParserError")
public typealias CbzParserError = CBZParserError

/// CBZ publication parsing class.
Expand Down
43 changes: 21 additions & 22 deletions r2-streamer-swift/Parser/PDF/PDFFileParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import R2Shared


/// Structure holding the metadata from a standalone PDF file.
@available(*, deprecated, message: "Use `PDFDocument` from r2-shared instead")
@available(*, unavailable, message: "Use `PDFDocument` from r2-shared instead")
public struct PDFFileMetadata {

// Permanent identifier based on the contents of the file at the time it was originally created.
Expand All @@ -41,33 +41,25 @@ public struct PDFFileMetadata {
}


@available(*, deprecated, message: "Use `PDFDocument` from r2-shared instead")
@available(*, unavailable, message: "Use `PDFDocument` from r2-shared instead")
public struct PDFOutlineNode {
let title: String?
let pageNumber: Int
let children: [PDFOutlineNode]
}

@available(*, deprecated)
@available(*, unavailable)
extension Array where Element == PDFOutlineNode {

func links(withHref href: String) -> [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.
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion r2-streamer-swift/Parser/PDF/PDFParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
4 changes: 2 additions & 2 deletions r2-streamer-swift/Parser/Readium/ReadiumWebPubParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion r2-streamer-swift/Toolkit/Extensions/Fetcher.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion r2-streamer-swift/Toolkit/Logger.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 6928a52

Please sign in to comment.