Skip to content

Commit b8810ab

Browse files
committed
3.0.0-alpha.2 (#478)
1 parent ca396ce commit b8810ab

13 files changed

+92
-93
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ All notable changes to this project will be documented in this file. Take a look
44

55
**Warning:** Features marked as *alpha* may change or be removed in a future release without notice. Use with caution.
66

7-
## [Unreleased]
7+
<!-- ## [Unreleased] -->
8+
9+
## [3.0.0-alpha.2]
810

911
### Added
1012

@@ -746,3 +748,4 @@ progression. Now if no reading progression is set, the `effectiveReadingProgress
746748
[2.7.1]: https://github.com/readium/swift-toolkit/compare/2.7.0...2.7.1
747749
[2.7.2]: https://github.com/readium/swift-toolkit/compare/2.7.1...2.7.2
748750
[3.0.0-alpha.1]: https://github.com/readium/swift-toolkit/compare/2.7.1...3.0.0-alpha.1
751+
[3.0.0-alpha.2]: https://github.com/readium/swift-toolkit/compare/3.0.0-alpha.1...3.0.0-alpha.2

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ If you're stuck, find more information at [developer.apple.com](https://develope
4545
Add the following to your `Cartfile`:
4646

4747
```
48-
github "readium/swift-toolkit" ~> 3.0.0-alpha.1
48+
github "readium/swift-toolkit" ~> 3.0.0-alpha.2
4949
```
5050

5151
Then, [follow the usual Carthage steps](https://github.com/Carthage/Carthage#adding-frameworks-to-an-application) to add the Readium libraries to your project.
@@ -72,12 +72,12 @@ Refer to the following table to know which dependencies are required for each Re
7272
Add the following `pod` statements to your `Podfile` for the Readium libraries you want to use:
7373

7474
```
75-
pod 'ReadiumShared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.1/Support/CocoaPods/ReadiumShared.podspec'
76-
pod 'ReadiumStreamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.1/Support/CocoaPods/ReadiumStreamer.podspec'
77-
pod 'ReadiumNavigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.1/Support/CocoaPods/ReadiumNavigator.podspec'
78-
pod 'ReadiumOPDS', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.1/Support/CocoaPods/ReadiumOPDS.podspec'
79-
pod 'ReadiumLCP', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.1/Support/CocoaPods/ReadiumLCP.podspec'
80-
pod 'ReadiumInternal', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.1/Support/CocoaPods/ReadiumInternal.podspec'
75+
pod 'ReadiumShared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.2/Support/CocoaPods/ReadiumShared.podspec'
76+
pod 'ReadiumStreamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.2/Support/CocoaPods/ReadiumStreamer.podspec'
77+
pod 'ReadiumNavigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.2/Support/CocoaPods/ReadiumNavigator.podspec'
78+
pod 'ReadiumOPDS', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.2/Support/CocoaPods/ReadiumOPDS.podspec'
79+
pod 'ReadiumLCP', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.2/Support/CocoaPods/ReadiumLCP.podspec'
80+
pod 'ReadiumInternal', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0-alpha.2/Support/CocoaPods/ReadiumInternal.podspec'
8181
8282
# Required if you use ReadiumAdapterGCDWebServer.
8383
pod 'ReadiumGCDWebServer', podspec: 'https://raw.githubusercontent.com/readium/GCDWebServer/4.0.0/GCDWebServer.podspec'

Support/CocoaPods/ReadiumAdapterGCDWebServer.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumAdapterGCDWebServer"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Adapter to use GCDWebServer as an HTTP server in Readium"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :branch => "develop" }
9+
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :tag => "3.0.0-alpha.2" }
1010
s.requires_arc = true
1111
s.source_files = "Sources/Adapters/GCDWebServer/**/*.{m,h,swift}"
1212
s.platform = :ios

Support/CocoaPods/ReadiumAdapterLCPSQLite.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumAdapterLCPSQLite"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Adapter to use SQLite.swift for the Readium LCP repositories"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :branch => "develop" }
9+
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :tag => "3.0.0-alpha.2" }
1010
s.requires_arc = true
1111
s.source_files = "Sources/Adapters/LCPSQLite/**/*.{m,h,swift}"
1212
s.platform = :ios

Support/CocoaPods/ReadiumInternal.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumInternal"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Private utilities used by the Readium modules"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :branch => "develop" }
9+
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :tag => "3.0.0-alpha.2" }
1010
s.requires_arc = true
1111
s.source_files = "Sources/Internal/**/*.{m,h,swift}"
1212
s.platform = :ios

Support/CocoaPods/ReadiumLCP.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumLCP"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium LCP"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :branch => "develop" }
9+
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :tag => "3.0.0-alpha.2" }
1010
s.requires_arc = true
1111
s.resource_bundles = {
1212
'ReadiumLCP' => [

Support/CocoaPods/ReadiumNavigator.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumNavigator"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium Navigator"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :branch => "develop" }
9+
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :tag => "3.0.0-alpha.2" }
1010
s.requires_arc = true
1111
s.resource_bundles = {
1212
'ReadiumNavigator' => [

Support/CocoaPods/ReadiumOPDS.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumOPDS"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium OPDS"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :branch => "develop" }
9+
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :tag => "3.0.0-alpha.2" }
1010
s.requires_arc = true
1111
s.resource_bundles = {
1212
'ReadiumOPDS' => ['Sources/OPDS/Resources/**'],

Support/CocoaPods/ReadiumShared.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumShared"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium Shared"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => 'https://github.com/readium/swift-toolkit.git', :branch => "develop" }
9+
s.source = { :git => 'https://github.com/readium/swift-toolkit.git', :tag => "3.0.0-alpha.2" }
1010
s.exclude_files = ["Sources/Shared/Toolkit/ZIP/ZIPFoundation.swift"]
1111
s.requires_arc = true
1212
s.resource_bundles = {

Support/CocoaPods/ReadiumStreamer.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumStreamer"
4-
s.version = "3.0.0-alpha.1"
4+
s.version = "3.0.0-alpha.2"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium Streamer"
77
s.homepage = "http://readium.github.io"
88
s.author = { "Readium" => "[email protected]" }
9-
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :branch => "develop" }
9+
s.source = { :git => "https://github.com/readium/swift-toolkit.git", :tag => "3.0.0-alpha.2" }
1010
s.requires_arc = true
1111
s.resource_bundles = {
1212
'ReadiumStreamer' => [

TestApp/Sources/App/Readium.swift

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,3 +209,66 @@ extension ReadiumNavigator.TTSError: UserErrorConvertible {
209209
}
210210
}
211211
}
212+
213+
#if LCP
214+
215+
extension LCPError: UserErrorConvertible {
216+
func userError() -> UserError {
217+
UserError(cause: self) {
218+
switch self {
219+
case .missingPassphrase:
220+
return "lcp_error_missing_passphrase".localized
221+
case .notALicenseDocument, .licenseIntegrity, .licenseProfileNotSupported, .parsing:
222+
return "lcp_error_invalid_license".localized
223+
case .licenseIsBusy, .licenseInteractionNotAvailable:
224+
return "lcp_error_invalid_operation".localized
225+
case .licenseContainer:
226+
return "lcp_error_container".localized
227+
case .crlFetching, .runtime, .unknown:
228+
return "lcp_error_internal".localized
229+
case .network:
230+
return "lcp_error_network".localized
231+
case let .licenseStatus(error):
232+
let dateFormatter = DateFormatter()
233+
dateFormatter.dateStyle = .medium
234+
235+
switch error {
236+
case let .cancelled(date):
237+
return "lcp_error_status_cancelled".localized(dateFormatter.string(from: date))
238+
case let .returned(date):
239+
return "lcp_error_status_returned".localized(dateFormatter.string(from: date))
240+
241+
case let .expired(start: start, end: end):
242+
if start > Date() {
243+
return "lcp_error_status_expired_start".localized(dateFormatter.string(from: start))
244+
} else {
245+
return "lcp_error_status_expired_end".localized(dateFormatter.string(from: end))
246+
}
247+
248+
case let .revoked(date, devicesCount):
249+
return "lcp_error_status_revoked".localized(dateFormatter.string(from: date), devicesCount)
250+
}
251+
case let .licenseRenew(error):
252+
switch error {
253+
case .renewFailed:
254+
return "lcp_error_renew_failed".localized
255+
case .invalidRenewalPeriod:
256+
return "lcp_error_invalid_renewal_period".localized
257+
case .unexpectedServerError:
258+
return "lcp_error_network".localized
259+
}
260+
case let .licenseReturn(error):
261+
switch error {
262+
case .returnFailed:
263+
return "lcp_error_return_failed".localized
264+
case .alreadyReturnedOrExpired:
265+
return "lcp_error_already_returned_or_expired".localized
266+
case .unexpectedServerError:
267+
return "lcp_error_network".localized
268+
}
269+
}
270+
}
271+
}
272+
}
273+
274+
#endif

TestApp/Sources/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@
252252
<key>CFBundlePackageType</key>
253253
<string>APPL</string>
254254
<key>CFBundleShortVersionString</key>
255-
<string>3.0.0-alpha.1</string>
255+
<string>3.0.0-alpha.2</string>
256256
<key>CFBundleVersion</key>
257-
<string>3.0.0-alpha.1</string>
257+
<string>3.0.0-alpha.2</string>
258258
<key>LSRequiresIPhoneOS</key>
259259
<true/>
260260
<key>LSSupportsOpeningDocumentsInPlace</key>

TestApp/Sources/LCP/LCPError.swift

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)