Skip to content

Commit 6ba50b6

Browse files
authored
3.0.0 (#535)
1 parent 2dc5805 commit 6ba50b6

12 files changed

+95
-101
lines changed

README.md

+6-6
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-beta.2
48+
github "readium/swift-toolkit" ~> 3.0.0
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.
@@ -74,11 +74,11 @@ Add the following `pod` statements to your `Podfile` for the Readium libraries y
7474
source 'https://github.com/readium/podspecs'
7575
source 'https://cdn.cocoapods.org/'
7676
77-
pod 'ReadiumShared', '~> 3.0.0-beta.2'
78-
pod 'ReadiumStreamer', '~> 3.0.0-beta.2'
79-
pod 'ReadiumNavigator', '~> 3.0.0-beta.2'
80-
pod 'ReadiumOPDS', '~> 3.0.0-beta.2'
81-
pod 'ReadiumLCP', '~> 3.0.0-beta.2'
77+
pod 'ReadiumShared', '~> 3.0.0'
78+
pod 'ReadiumStreamer', '~> 3.0.0'
79+
pod 'ReadiumNavigator', '~> 3.0.0'
80+
pod 'ReadiumOPDS', '~> 3.0.0'
81+
pod 'ReadiumLCP', '~> 3.0.0'
8282
```
8383

8484
Take a look at [CocoaPods's documentation](https://guides.cocoapods.org/using/using-cocoapods.html) for more information.

Support/CocoaPods/ReadiumAdapterGCDWebServer.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumAdapterGCDWebServer"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
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"
@@ -14,8 +14,8 @@ Pod::Spec.new do |s|
1414
s.ios.deployment_target = "13.4"
1515
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
1616

17-
s.dependency 'ReadiumShared', '~> 3.0.0-beta.2'
18-
s.dependency 'ReadiumInternal', '~> 3.0.0-beta.2'
17+
s.dependency 'ReadiumShared', '~> 3.0.0'
18+
s.dependency 'ReadiumInternal', '~> 3.0.0'
1919
s.dependency 'ReadiumGCDWebServer', '~> 4.0.0'
2020

2121
end

Support/CocoaPods/ReadiumAdapterLCPSQLite.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumAdapterLCPSQLite"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
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"
@@ -14,8 +14,8 @@ Pod::Spec.new do |s|
1414
s.ios.deployment_target = "13.4"
1515
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
1616

17-
s.dependency 'ReadiumLCP', '~> 3.0.0-beta.2'
18-
s.dependency 'ReadiumShared', '~> 3.0.0-beta.2'
17+
s.dependency 'ReadiumLCP', '~> 3.0.0'
18+
s.dependency 'ReadiumShared', '~> 3.0.0'
1919
s.dependency 'SQLite.swift', '~> 0.15.0'
2020

2121
end

Support/CocoaPods/ReadiumInternal.podspec

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumInternal"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Private utilities used by the Readium modules"
77
s.homepage = "http://readium.github.io"

Support/CocoaPods/ReadiumLCP.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumLCP"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium LCP"
77
s.homepage = "http://readium.github.io"
@@ -20,8 +20,8 @@ Pod::Spec.new do |s|
2020
s.ios.deployment_target = "13.4"
2121
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2'}
2222

23-
s.dependency 'ReadiumShared' , '~> 3.0.0-beta.2'
24-
s.dependency 'ReadiumInternal', '~> 3.0.0-beta.2'
23+
s.dependency 'ReadiumShared' , '~> 3.0.0'
24+
s.dependency 'ReadiumInternal', '~> 3.0.0'
2525
s.dependency 'ReadiumZIPFoundation', '~> 1.0.0'
2626
s.dependency 'CryptoSwift', '~> 1.8.0'
2727
end

Support/CocoaPods/ReadiumNavigator.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumNavigator"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium Navigator"
77
s.homepage = "http://readium.github.io"
@@ -19,8 +19,8 @@ Pod::Spec.new do |s|
1919
s.platform = :ios
2020
s.ios.deployment_target = "13.4"
2121

22-
s.dependency 'ReadiumShared', '~> 3.0.0-beta.2'
23-
s.dependency 'ReadiumInternal', '~> 3.0.0-beta.2'
22+
s.dependency 'ReadiumShared', '~> 3.0.0'
23+
s.dependency 'ReadiumInternal', '~> 3.0.0'
2424
s.dependency 'DifferenceKit', '~> 1.0'
2525
s.dependency 'SwiftSoup', '~> 2.7.0'
2626

Support/CocoaPods/ReadiumOPDS.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumOPDS"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium OPDS"
77
s.homepage = "http://readium.github.io"
@@ -14,8 +14,8 @@ Pod::Spec.new do |s|
1414
s.ios.deployment_target = "13.4"
1515
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
1616

17-
s.dependency 'ReadiumShared', '~> 3.0.0-beta.2'
18-
s.dependency 'ReadiumInternal', '~> 3.0.0-beta.2'
17+
s.dependency 'ReadiumShared', '~> 3.0.0'
18+
s.dependency 'ReadiumInternal', '~> 3.0.0'
1919
s.dependency 'ReadiumFuzi', '~> 4.0.0'
2020

2121
end

Support/CocoaPods/ReadiumShared.podspec

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumShared"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium Shared"
77
s.homepage = "http://readium.github.io"
@@ -19,6 +19,6 @@ Pod::Spec.new do |s|
1919
s.dependency 'SwiftSoup', '~> 2.7.0'
2020
s.dependency 'ReadiumFuzi', '~> 4.0.0'
2121
s.dependency 'ReadiumZIPFoundation', '~> 1.0.0'
22-
s.dependency 'ReadiumInternal', '~> 3.0.0-beta.2'
22+
s.dependency 'ReadiumInternal', '~> 3.0.0'
2323

2424
end

Support/CocoaPods/ReadiumStreamer.podspec

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "ReadiumStreamer"
4-
s.version = "3.0.0-beta.2"
4+
s.version = "3.0.0"
55
s.license = "BSD 3-Clause License"
66
s.summary = "Readium Streamer"
77
s.homepage = "http://readium.github.io"
@@ -22,8 +22,8 @@ Pod::Spec.new do |s|
2222
s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
2323

2424
s.dependency 'ReadiumFuzi', '~> 4.0.0'
25-
s.dependency 'ReadiumShared', '~> 3.0.0-beta.2'
26-
s.dependency 'ReadiumInternal', '~> 3.0.0-beta.2'
25+
s.dependency 'ReadiumShared', '~> 3.0.0'
26+
s.dependency 'ReadiumInternal', '~> 3.0.0'
2727
s.dependency 'CryptoSwift', '~> 1.8.0'
2828

2929
end

TestApp/Integrations/Carthage/project+lcp.yml

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ targets:
2828
- framework: Carthage/Build/R2LCPClient.xcframework
2929
- framework: Carthage/Build/ReadiumAdapterGCDWebServer.xcframework
3030
- framework: Carthage/Build/ReadiumAdapterLCPSQLite.xcframework
31+
- framework: Carthage/Build/ReadiumFuzi.xcframework
3132
- framework: Carthage/Build/ReadiumGCDWebServer.xcframework
3233
- framework: Carthage/Build/ReadiumInternal.xcframework
3334
- framework: Carthage/Build/ReadiumLCP.xcframework

TestApp/Sources/Info.plist

+2-2
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-beta.2</string>
255+
<string>3.0.0</string>
256256
<key>CFBundleVersion</key>
257-
<string>3.0.0-beta.2</string>
257+
<string>3.0.0</string>
258258
<key>LSRequiresIPhoneOS</key>
259259
<true/>
260260
<key>LSSupportsOpeningDocumentsInPlace</key>

docs/Migration Guide.md

+65-72
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,26 @@ All migration steps necessary in reading apps to upgrade to major versions of th
44

55
<!-- ## Unreleased -->
66

7-
## 3.0.0-beta.2
7+
## 3.0.0
88

9-
### CocoaPods Specs repository
9+
:warning: If you upgrade from an `alpha` or `beta` version of 3.0.0, please refer to the [3.0.0-beta.2 migration guide](https://github.com/readium/swift-toolkit/blob/3.0.0-beta.2/docs/Migration%20Guide.md) instead.
10+
11+
### R2 prefix dropped
12+
13+
The `R2` prefix is now deprecated. The `R2Shared`, `R2Streamer` and `R2Navigator` packages were renamed as `ReadiumShared`, `ReadiumStreamer` and `ReadiumNavigator`.
14+
15+
You will need to update your imports, as well as the dependencies you include in your project:
16+
17+
* Swift Package Manager: There's nothing to do.
18+
* Carthage:
19+
* Update the Carthage dependencies and make sure the new `ReadiumShared.xcframework`, `ReadiumStreamer.xcframework` and `ReadiumNavigator.xcframework` were built.
20+
* Replace the old frameworks with the new ones in your project.
21+
* CocoaPods:
22+
* Update the `pod` statements to reflect the new names of `ReadiumShared`, `ReadiumStreamer` and `ReadiumNavigator`.
23+
24+
### Dependency managers
25+
26+
#### CocoaPods Specs repository
1027

1128
All the libraries are now available on a dedicated [Readium CocoaPods Specs repository](https://github.com/readium/podspecs). To use it, add the following statements at the top of your `Podfile`:
1229

@@ -35,14 +52,57 @@ Don't forget to remove the statements for some internal dependencies that are no
3552

3653
Finally, run `pod install --repo-update`.
3754

38-
### ZIPFoundation replaces Minizip
55+
#### ZIPFoundation replaces Minizip
3956

4057
The default `ZIPArchiveOpener` is now using ZIPFoundation instead of Minizip, with improved performances when reading ranges of `stored` ZIP entries.
4158

4259
If you use Carthage, remove `Minizip.xcframework` from your dependencies and add `ReadiumZIPFoundation.xcframework` instead. No changes are needed when using Swift Package Manager or CocoaPods.
4360

61+
### Migration of HREFs and Locators (bookmarks, annotations, etc.)
4462

45-
## 3.0.0-alpha.2
63+
:warning: This requires a database migration in your application, if you were persisting `Locator` objects.
64+
65+
In Readium v2.x, a `Link` or `Locator`'s `href` could be either:
66+
67+
* a valid absolute URL for a streamed publication, e.g. `https://domain.com/isbn/dir/my%20chapter.html`,
68+
* a percent-decoded path for a local archive such as an EPUB, e.g. `/dir/my chapter.html`.
69+
* Note that it was relative to the root of the archive (`/`).
70+
71+
To improve the interoperability with other Readium toolkits (in particular the Readium Web Toolkits, which only work in a streaming context) **Readium v3 now generates and expects valid URLs** for `Locator` and `Link`'s `href`.
72+
73+
* `https://domain.com/isbn/dir/my%20chapter.html` is left unchanged, as it was already a valid URL.
74+
* `/dir/my chapter.html` becomes the relative URL path `dir/my%20chapter.html`
75+
* We dropped the `/` prefix to avoid issues when resolving to a base URL.
76+
* Special characters are percent-encoded.
77+
78+
**You must migrate the HREFs or Locators stored in your database** when upgrading to Readium 3. To assist you, two helpers are provided: `AnyURL(legacyHREF:)` and `Locator(legacyJSONString:)`.
79+
80+
Here's an example of a [GRDB migration](https://swiftpackageindex.com/groue/grdb.swift/master/documentation/grdb/migrations) that can serve as inspiration:
81+
82+
```swift
83+
migrator.registerMigration("normalizeHREFs") { db in
84+
let normalizedRows: [(id: Int, href: String, locator: String)] =
85+
try Row.fetchAll(db, sql: "SELECT id, href, locator FROM bookmarks")
86+
.compactMap { row in
87+
guard
88+
let normalizedHREF = AnyURL(legacyHREF: row["href"])?.string,
89+
let normalizedLocator = try Locator(legacyJSONString: row["locator"])?.jsonString
90+
else {
91+
return nil
92+
}
93+
return (row["id"], normalizedHREF, normalizedLocator)
94+
}
95+
96+
let updateStmt = try db.makeStatement(sql: "UPDATE bookmarks SET href = :href, locator = :locator WHERE id = :id")
97+
for (id, href, locator) in normalizedRows {
98+
try updateStmt.execute(arguments: [
99+
"id": id,
100+
"href": href
101+
"locator": locator
102+
])
103+
}
104+
}
105+
```
46106

47107
### Error management
48108

@@ -119,7 +179,7 @@ To use `ReadiumAdapterLCPSQLite`, you must update your imports and the dependenc
119179
* CocoaPods:
120180
* Update the `pod` statements in your `Podfile` with the following, before running `pod install`:
121181
```
122-
pod 'ReadiumAdapterLCPSQLite', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumAdapterLCPSQLite.podspec'
182+
pod 'ReadiumAdapterLCPSQLite', '~> 3.0.0'
123183
```
124184
Then, provide the adapters when initializing the `LCPService`.
125185

@@ -145,73 +205,6 @@ The LCP APIs now accept a `LicenseDocumentSource` enum instead of a URL to an LC
145205
```
146206

147207

148-
## 3.0.0-alpha.1
149-
150-
### R2 prefix dropped
151-
152-
The `R2` prefix is now deprecated. The `R2Shared`, `R2Streamer` and `R2Navigator` packages were renamed as `ReadiumShared`, `ReadiumStreamer` and `ReadiumNavigator`.
153-
154-
You will need to update your imports, as well as the dependencies you include in your project:
155-
156-
* Swift Package Manager: There's nothing to do.
157-
* Carthage:
158-
* Update the Carthage dependencies and make sure the new `ReadiumShared.xcframework`, `ReadiumStreamer.xcframework` and `ReadiumNavigator.xcframework` were built.
159-
* Replace the old frameworks with the new ones in your project.
160-
* CocoaPods:
161-
* Update the `pod` statements in your `Podfile` with the following, before running `pod install`:
162-
```
163-
pod 'ReadiumShared', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumShared.podspec'
164-
pod 'ReadiumStreamer', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumStreamer.podspec'
165-
pod 'ReadiumNavigator', podspec: 'https://raw.githubusercontent.com/readium/swift-toolkit/3.0.0/Support/CocoaPods/ReadiumNavigator.podspec'
166-
```
167-
168-
### Migration of HREFs and Locators (bookmarks, annotations, etc.)
169-
170-
:warning: This requires a database migration in your application, if you were persisting `Locator` objects.
171-
172-
In Readium v2.x, a `Link` or `Locator`'s `href` could be either:
173-
174-
* a valid absolute URL for a streamed publication, e.g. `https://domain.com/isbn/dir/my%20chapter.html`,
175-
* a percent-decoded path for a local archive such as an EPUB, e.g. `/dir/my chapter.html`.
176-
* Note that it was relative to the root of the archive (`/`).
177-
178-
To improve the interoperability with other Readium toolkits (in particular the Readium Web Toolkits, which only work in a streaming context) **Readium v3 now generates and expects valid URLs** for `Locator` and `Link`'s `href`.
179-
180-
* `https://domain.com/isbn/dir/my%20chapter.html` is left unchanged, as it was already a valid URL.
181-
* `/dir/my chapter.html` becomes the relative URL path `dir/my%20chapter.html`
182-
* We dropped the `/` prefix to avoid issues when resolving to a base URL.
183-
* Special characters are percent-encoded.
184-
185-
**You must migrate the HREFs or Locators stored in your database** when upgrading to Readium 3. To assist you, two helpers are provided: `AnyURL(legacyHREF:)` and `Locator(legacyJSONString:)`.
186-
187-
Here's an example of a [GRDB migration](https://swiftpackageindex.com/groue/grdb.swift/master/documentation/grdb/migrations) that can serve as inspiration:
188-
189-
```swift
190-
migrator.registerMigration("normalizeHREFs") { db in
191-
let normalizedRows: [(id: Int, href: String, locator: String)] =
192-
try Row.fetchAll(db, sql: "SELECT id, href, locator FROM bookmarks")
193-
.compactMap { row in
194-
guard
195-
let normalizedHREF = AnyURL(legacyHREF: row["href"])?.string,
196-
let normalizedLocator = try Locator(legacyJSONString: row["locator"])?.jsonString
197-
else {
198-
return nil
199-
}
200-
return (row["id"], normalizedHREF, normalizedLocator)
201-
}
202-
203-
let updateStmt = try db.makeStatement(sql: "UPDATE bookmarks SET href = :href, locator = :locator WHERE id = :id")
204-
for (id, href, locator) in normalizedRows {
205-
try updateStmt.execute(arguments: [
206-
"id": id,
207-
"href": href
208-
"locator": locator
209-
])
210-
}
211-
}
212-
```
213-
214-
215208
## 2.7.0
216209

217210
### `AudioNavigator` is now stable

0 commit comments

Comments
 (0)