-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
160 lines (122 loc) · 3.73 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
.PHONY: default
default: setup bootstrap build test
# Commands
.PHONY: setup
setup:
bundle install
@$(MAKE) --directory=ExampleHTTP setup
.PHONY: bootstrap
bootstrap:
@$(MAKE) --directory=ExampleHTTP bootstrap
.PHONY: build
build:
@$(MAKE) --directory=ExampleHTTP build
.PHONY: test
test:
@$(MAKE) --directory=ExampleHTTP test
.PHONY: lock
lock:
$(info making locks with setup & boostrap)
$(info ExampleHTTP setup)
@$(MAKE) --directory=ExampleHTTP setup
$(info ExampleHTTP bootstrap)
@$(MAKE) --directory=ExampleHTTP bootstrap
.PHONY: setup-example-http
setup-example-http:
bundle install
@$(MAKE) --directory=ExampleHTTP setup
.PHONY: bootstrap-example-http
bootstrap-example-http:
@$(MAKE) --directory=ExampleHTTP bootstrap
.PHONY: build-example-http
build-example-http:
@$(MAKE) --directory=ExampleHTTP build
.PHONY: test-example-http
test-example-http:
@$(MAKE) --directory=ExampleHTTP test
.PHONY: clean-example-http
clean-example-http: clean-docs
@$(MAKE) --directory=ExampleHTTP clean
.PHONY: lint
lint: swiftlint
.PHONY: lint-strict
lint-strict:
@PATH="./ExampleHTTP/Pods/SwiftLint:$$PATH" swiftlint --strict --quiet
.PHONY: autocorrect
autocorrect:
@PATH="./ExampleHTTP/Pods/SwiftLint:$$PATH" swiftlint --fix
.PHONY: lint-all
lint-all: lint lint-circleci lint-podspec lint-docs
.PHONY: publish
publish: tag-release publish-podspec
# Release
.PHONY: tag-release
tag-release:
VERSION="$$(bundle exec pod ipc spec MobileCoin.podspec | jq -r '.version')" && \
git tag "v$$VERSION" && \
git push [email protected]:mobilecoinofficial/MobileCoin-Swift.git "refs/tags/v$$VERSION"
# MobileCoin pod
.PHONY: lint-locally-podspec
lint-locally-podspec:
cd ExampleHTTP; bundle exec pod repo update;
bundle exec pod lib lint MobileCoin.podspec --skip-tests --allow-warnings
.PHONY: lint-locally-strict-podspec
lint-locally-strict-podspec:
cd ExampleHTTP; bundle exec pod repo update;
bundle exec pod lib lint MobileCoin.podspec --skip-tests
.PHONY: lint-podspec
lint-podspec:
cd ExampleHTTP; bundle exec pod repo update;
bundle exec pod spec lint MobileCoin.podspec --skip-tests
.PHONY: publish-podspec
publish-podspec:
cd ExampleHTTP; bundle exec pod repo update;
bundle exec pod trunk push MobileCoin.podspec --skip-tests
# CircleCI
.PHONY: install-circleci
install-circleci:
brew install circleci
.PHONY: lint-circleci
lint-circleci:
@command -v circleci >/dev/null || $(MAKE) install-circleci
circleci config validate
# Documentation
.PHONY: docs
docs:
bundle exec jazzy
.PHONY: clean-docs
clean-docs:
@[ ! -e docs ] || rm -r docs
.PHONY: lint-docs
lint-docs:
@[ -e docs ] || $(MAKE) docs
@# Check that there are no categories that start with `Other `, since that signifies that a new public
@# type was added but was not added to a category in `.jazzy.yaml`
@[[ "$$( \
name_regex='^Other (?:Classes|Constants|Enumerations|Extensions|Functions|Protocols|Structures|Type Aliases|Type Definitions)$$'; \
cat docs/search.json | jq ".[] \
| select(has(\"parent_name\") | not) \
| select(has(\"name\")) \
| select(.name | test(\"$$name_regex\"))" \
)" == "" ]] || { echo 'Error: Found one or more public types not categorized in jazzy.'; exit 1; }
# Swiftlint
.PHONY: swiftlint
swiftlint:
@PATH="./Example/Pods/SwiftLint:$$PATH" swiftlint
# Maintenance
.PHONY: upgrade-deps
upgrade-deps:
bundle update
$(MAKE) -C ExampleHTTP upgrade-deps
.PHONY: generate-local-process-info
generate-local-process-info:
tools/generate_process_info_jsons.sh
.PHONY: fund-test-wallets-spm
fund-test-wallets-spm:
tools/generate_process_info_jsons.sh
swift test --filter "TestSetupClientTests"
.PHONY: run-all-tests-spm
run-all-tests-spm:
tools/generate_process_info_jsons.sh
tools/generate_secrets_json.sh
swift test --filter "MobileCoinTests"