-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
110 lines (78 loc) · 3.48 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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# -- Main entrypoint
dev: install_dev_deps install_githooks remove_old_rswift generate_project compile_mobilecore build_web_pdf_tools open_project
# -- Setup Environment --
install_dev_deps: homebrew_dev bundler mint
@echo "All dev dependencies are installed"
# -- -- Homebrew
homebrew_dev:
ifeq (, $(shell which brew))
$(error "You must install homebrew on your system before setup can continue. Visit: https://brew.sh to get started with that.")
endif
@brew bundle --file Brewfile
homebrew_ci:
@brew bundle --file Brewfile_CI
homebrew_ci_imagemagick: # only needed for specific context & takes time, so not adding to Brewfile_CI.
@brew install imagemagick
# -- -- Ruby
bundler:
ifeq (, $(shell which bundle))
$(error "You must install bundler on your system before setup can continue. You could try running 'gem install bundler'.")
endif
bundle config set --local path 'vendor/bundle'
bundle install
# -- -- SPM
mint:
@mint bootstrap --mintfile ./Mintfile
mint_ci:
@mint bootstrap --mintfile ./Mintfile_CI
# -- -- Generate MobileCore framework --
compile_mobilecore:
Scripts/fetch_mobile_core.sh
# -- -- Generate web pdf tools javascript file --
build_web_pdf_tools:
Scripts/build_web_pdf_tools.sh
# -- -- Generate Xcode project --
generate_project:
mint run xcodegen --spec project.yml
open_project:
open CTR.xcodeproj
# -- Linting --
run_swiftlint:
mint run swiftlint --quiet --strict --config=./.swiftlint.yml
# -- Install Git Hooks: --
install_githooks: install_githooks_gitlfs install_githooks_xcodegen
@echo "All githooks are installed"
install_githooks_xcodegen:
@echo "\nxcodegen generate --spec project.yml --use-cache" >> .git/hooks/post-checkout
@chmod +x .git/hooks/post-checkout
install_githooks_gitlfs:
@git lfs install --force
# -- Sync with Public Repo --
sync_repo:
@mint bootstrap
@repotools sync-repo --public-github-path minvws/nl-covid19-coronacheck-app-ios --private-github-path minvws/nl-covid19-coronacheck-app-ios-private --matching-tags-pattern "Holder-" --matching-tags-pattern "Verifier-" --excluding-tag-pattern \\-RC .
# -- Lokalize: --
# Create an API key here: https://app.lokalise.com/profile
# add export LOKALISE_API_KEY="--your value here--" to your ~/.zshrc file
# run source ~/.zshrc to load in that exported value
# then you can run `make download_translations` each time you want to download the latest copy.
download_translations:
@mkdir -p tmp/localization_downloads
# Holder:
@lokalise2 file download --token ${LOKALISE_API_KEY} --project-id "5229025261717f4fcb81c1.73606773" --format strings --unzip-to tmp/localization_downloads/Holder --export-empty-as skip --original-filenames false
# Verifier:
@lokalise2 file download --token ${LOKALISE_API_KEY} --project-id "243601816196631318a279.00348152" --format strings --unzip-to tmp/localization_downloads/Verifier --export-empty-as skip --original-filenames false
# Merge Verifier and Holder into one file for each NL and EN:
@Scripts/merge_localizations.sh
# Check the HTML within the strings:
@Scripts/check_html_in_strings.sh
# Cleanup:
@rm -rf "tmp/localization_downloads"
# -- Periphery --
scan_unused_code:
periphery scan --index-exclude "Sources/CTR/Infrastructure/Resources/R.generated.swift"
remove_old_rswift:
@rm Sources/CTR/Infrastructure/Resources/R.generated.swift || true
generate_diagrams:
@d2 Diagrams/packages-withouttests.d2 Diagrams/packages-withouttests.png --layout=elk --sketch
@d2 Diagrams/client-side-datamodel.d2 Diagrams/client-side-datamodel.png --layout=elk