-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
35 lines (29 loc) · 1.33 KB
/
Makefile
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
TOOL = PLAYBOOK_DEVELOPMENT=1 swift run -c release
GITHUB_RAW_CONTENT_PATH = https://raw.githubusercontent.com/playbook-ui/accessibility-snapshot-ios/main/
GITHUB_TREE_PATH = https://github.com/playbook-ui/accessibility-snapshot-ios/main/
.PHONY: proj
proj:
$(TOOL) xcodegen --spec Example/project.yml --project Example
.PHONY: format
format:
$(TOOL) swift-format format -i -p -r Sources Example/SampleAccessibilitySnapshot
.PHONY: lint
lint:
$(TOOL) swift-format lint -s -p -r Sources Example/SampleAccessibilitySnapshot
.PHONY: npm
npm:
npm i
.PHONY: docs
docs:
xcodebuild docbuild \
-scheme PlaybookAccessibilitySnapshot \
-destination generic/platform=iOS \
OTHER_DOCC_FLAGS="--transform-for-static-hosting --hosting-base-path accessibility-snapshot-ios --output-path docs"
.PHONY: fix-readme-links
fix-readme-links:
sed -i '' -E '/.?http/!s#(<img src=")([^"]+)#\1$(GITHUB_RAW_CONTENT_PATH)\2#g' README.md
sed -i '' -E '/.?http/!s#(<img .+src=")([^"]+)#\1$(GITHUB_RAW_CONTENT_PATH)\2#g' README.md
sed -i '' -E '/.?http/!s#(<a href=")([^"]+)#\1$(GITHUB_TREE_PATH)\2#g' README.md
sed -i '' -E '/.?http/!s#(<a .+href=")([^"]+)#\1$(GITHUB_TREE_PATH)\2#g' README.md
sed -i '' -E '/.?http/!s#(\!\[.+\])\((.+)\)#\1($(GITHUB_RAW_CONTENT_PATH)\2)#g' README.md
sed -i '' -E '/.?http/!s#(\[.+\])\((.+)\)#\1($(GITHUB_TREE_PATH)\2)#g' README.md