Skip to content

Commit 769b90d

Browse files
authored
Setup the libraries (#2)
1 parent ff78034 commit 769b90d

File tree

313 files changed

+11027
-7211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+11027
-7211
lines changed

lcp/.github/ISSUE_TEMPLATE/bug_report.md renamed to .github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,7 @@ Then, explain the steps to reproduce the problem from the Test App (https://gith
4242

4343
<!-- Fill in the following information -->
4444

45-
#### Readium versions
46-
47-
<!-- Remove unused modules -->
48-
49-
* `r2-shared-swift`:
50-
* `r2-streamer-swift`:
51-
* `r2-navigator-swift`:
52-
* `r2-opds-swift`:
53-
* `r2-lcp-swift`:
45+
* Readium version:
5446

5547
#### Development environment
5648

.github/workflows/checks.yml

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
name: Checks
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
8+
env:
9+
platform: ${{ 'iOS Simulator' }}
10+
device: ${{ 'iPhone 12' }}
11+
# github.sha is the merge commit for a PR event, which fails the Carthage job
12+
# since it doesn't exist.
13+
commit_sha: ${{ github.event.pull_request.head.sha || github.sha }}
14+
15+
jobs:
16+
build:
17+
name: Build
18+
runs-on: macos-latest
19+
env:
20+
scheme: ${{ 'Readium-Package' }}
21+
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v2
25+
- name: Install dependencies
26+
run: brew install xcodegen
27+
- name: Check Carthage project
28+
run: |
29+
# Check that the Carthage project is up to date.
30+
make carthage-project
31+
git diff --exit-code --name-only PM/Carthage/Readium.xcodeproj
32+
- name: Build
33+
run: |
34+
xcodebuild build-for-testing -scheme "$scheme" -destination "platform=$platform,name=$device"
35+
- name: Test
36+
run: |
37+
xcodebuild test-without-building -scheme "$scheme" -destination "platform=$platform,name=$device"
38+
39+
lint:
40+
name: Lint
41+
runs-on: macos-latest
42+
env:
43+
scripts: ${{ 'Sources/Navigator/EPUB/Scripts' }}
44+
45+
steps:
46+
- name: Checkout
47+
uses: actions/checkout@v2
48+
- name: Install dependencies
49+
run: yarn --cwd "$scripts" install --frozen-lockfile
50+
- name: Lint JavaScript
51+
run: yarn --cwd "$scripts" run lint
52+
- name: Check JavaScript formatting
53+
run: yarn --cwd "$scripts" run checkformat
54+
- name: Check if bundled scripts are up-to-date
55+
run: |
56+
make scripts
57+
git diff --exit-code --name-only Sources/Navigator/EPUB/Assets/Static/scripts/*.js
58+
59+
int-spm:
60+
name: Integration (Swift Package Manager)
61+
runs-on: macos-latest
62+
defaults:
63+
run:
64+
working-directory: TestApp
65+
environment: LCP
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v2
69+
- name: Install dependencies
70+
run: brew install xcodegen
71+
- name: Generate project
72+
run: make spm lcp=${{ secrets.LCP_URL_CARTHAGE }} commit=$commit_sha
73+
- name: Build
74+
run: |
75+
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device"
76+
77+
int-carthage:
78+
name: Integration (Carthage)
79+
runs-on: macos-latest
80+
defaults:
81+
run:
82+
working-directory: TestApp
83+
environment: LCP
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@v2
87+
- name: Install dependencies
88+
run: brew install xcodegen
89+
- name: Generate project
90+
run: make carthage lcp=${{ secrets.LCP_URL_CARTHAGE }} commit=$commit_sha
91+
- name: Build
92+
run: |
93+
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device"
94+
95+
# Warning: This cannot actually test the state of the current commit, but
96+
# will check that the latest branch/tag set in the Podspecs are valid.
97+
int-cocoapods:
98+
name: Integration (CocoaPods)
99+
runs-on: macos-latest
100+
defaults:
101+
run:
102+
working-directory: TestApp
103+
environment: LCP
104+
steps:
105+
- name: Checkout
106+
uses: actions/checkout@v2
107+
- name: Install dependencies
108+
run: brew install xcodegen
109+
- name: Generate project
110+
run: make cocoapods lcp=${{ secrets.LCP_URL_COCOAPODS }} commit=$commit_sha
111+
- name: Build
112+
run: |
113+
xcodebuild build -workspace TestApp.xcworkspace -scheme TestApp -destination "platform=$platform,name=$device"
114+
115+
int-dev:
116+
name: Integration (Local)
117+
runs-on: macos-latest
118+
defaults:
119+
run:
120+
working-directory: TestApp
121+
environment: LCP
122+
steps:
123+
- name: Checkout
124+
uses: actions/checkout@v2
125+
- name: Install dependencies
126+
run: brew install xcodegen
127+
- name: Generate project
128+
run: make dev lcp=${{ secrets.LCP_URL_CARTHAGE }} commit=$commit_sha
129+
- name: Build
130+
run: |
131+
xcodebuild build -scheme TestApp -destination "platform=$platform,name=$device"
132+

.gitignore

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
.DS_Store
2+
3+
4+
# Swift Package Manager
5+
.build/
6+
.swiftpm/
7+
Package.resolved
8+
9+
10+
# Xcode
11+
12+
## User settings
13+
xcuserdata/
14+
15+
## Obj-C/Swift specific
16+
*.hmap
17+
18+
## App packaging
19+
*.ipa
20+
*.dSYM.zip
21+
*.dSYM
22+
23+
## Playgrounds
24+
timeline.xctimeline
25+
playground.xcworkspace
26+
27+
28+
# JetBrains AppCode
29+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
30+
31+
## User-specific stuff
32+
.idea/**/workspace.xml
33+
.idea/**/tasks.xml
34+
.idea/**/usage.statistics.xml
35+
.idea/**/dictionaries
36+
.idea/**/shelf
37+
38+
## Generated files
39+
.idea/**/contentModel.xml
40+
41+
## Sensitive or high-churn files
42+
.idea/**/dataSources/
43+
.idea/**/dataSources.ids
44+
.idea/**/dataSources.local.xml
45+
.idea/**/sqlDataSources.xml
46+
.idea/**/dynamic.xml
47+
.idea/**/uiDesigner.xml
48+
.idea/**/dbnavigator.xml
49+
50+
## File-based project format
51+
*.iws
52+
53+
## IntelliJ
54+
out/
55+

Cartfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
github "cezheng/Fuzi" ~> 3.1.3
2+
github "dexman/Minizip" ~> 1.4.0
3+
github "krzyzanowskim/CryptoSwift" ~> 1.3.8
4+
github "ra1028/DifferenceKit" ~> 1.2.0
5+
github "readium/GCDWebServer" ~> 3.6.3
6+
github "scinfu/SwiftSoup" ~> 2.3.2
7+
github "stephencelis/SQLite.swift" ~> 0.12.2
8+
github "weichsel/ZIPFoundation" == 0.9.11 # 0.9.12 requires iOS 12+
File renamed without changes.

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
SCRIPTS_PATH := Sources/Navigator/EPUB/Scripts
2+
3+
help:
4+
@echo "Usage: make <target>\n\n\
5+
carthage-project\tGenerate the Carthage Xcode project\n\
6+
scripts\t\tBundle the Navigator EPUB scripts\n\
7+
"
8+
9+
.PHONY: carthage-project
10+
carthage-project:
11+
xcodegen -s PM/Carthage/project.yml --use-cache --cache-path PM/Carthage/.xcodegen
12+
13+
.PHONY: scripts
14+
scripts:
15+
yarn --cwd "$(SCRIPTS_PATH)" install --frozen-lockfile
16+
yarn --cwd "$(SCRIPTS_PATH)" run format
17+
yarn --cwd "$(SCRIPTS_PATH)" run lint
18+
yarn --cwd "$(SCRIPTS_PATH)" run bundle

0 commit comments

Comments
 (0)