forked from readium/swift-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (56 loc) · 1.92 KB
/
Makefile
File metadata and controls
67 lines (56 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
SCRIPTS_PATH := Sources/Navigator/EPUB/Scripts
help:
@echo "Usage: make <target>\n\n\
carthage-project\tGenerate the Carthage Xcode project\n\
podspecs\t\tGenerate the CocoaPods podspecs\n\
scripts\t\tBundle the Navigator EPUB scripts\n\
test\t\t\tRun unit tests\n\
lint-format\t\tVerify formatting\n\
format\t\tFormat sources\n\
update-locales\tUpdate the localization files\n\
"
.PHONY: podspecs
podspecs:
swift run --package-path BuildTools GeneratePodspecs
.PHONY: carthage-project
carthage-project:
rm -rf **/.DS_Store
rm -rf $(SCRIPTS_PATH)/node_modules/
xcodegen -s Support/Carthage/project.yml --use-cache --cache-path Support/Carthage/.xcodegen
.PHONY: navigator-ui-tests-project
navigator-ui-tests-project:
xcodegen -s Tests/NavigatorTests/UITests/project.yml
.PHONY: scripts
scripts:
@which corepack >/dev/null 2>&1 || (echo "ERROR: corepack is required, please install it first\nhttps://pnpm.io/installation#using-corepack"; exit 1)
cd $(SCRIPTS_PATH); \
rm -rf "node_modules"; \
corepack install; \
pnpm install --frozen-lockfile; \
pnpm run format; \
pnpm run lint; \
pnpm run bundle
.PHONY: update-scripts
update-scripts:
@which corepack >/dev/null 2>&1 || (echo "ERROR: corepack is required, please install it first\nhttps://pnpm.io/installation#using-corepack"; exit 1)
pnpm install --dir "$(SCRIPTS_PATH)"
.PHONY: lint-format
lint-format:
swift run --package-path BuildTools swiftformat --lint .
.PHONY: format
f: format
format:
swift run --package-path BuildTools swiftformat .
BRANCH ?= main
.PHONY: update-locales
update-locales:
@which node >/dev/null 2>&1 || (echo "ERROR: node is required, please install it first"; exit 1)
ifndef DIR
rm -rf thorium-locales
git clone -b $(BRANCH) --single-branch --depth 1 https://github.com/edrlab/thorium-locales.git
endif
node BuildTools/Scripts/convert-thorium-localizations.js thorium-locales
ifndef DIR
rm -rf thorium-locales
endif
make format