-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
284 lines (258 loc) · 9.06 KB
/
Makefile.toml
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
# project_name/Makefile.toml
# https://github.com/sagiegurari/cargo-make/blob/master/src/lib/Makefile.stable.toml
# PWA
[config]
skip_core_tasks = true
[tasks.default]
description = "help for prepared make tasks"
clear = true
script= [
"clear",
"printf ",
"printf ORDER OF EXECUTING MAKE TASKS:",
"printf ",
"printf clear - clear the screen",
"printf cargo make - this list",
"printf 01. ..... change your code in the editor",
"printf 02. cargo make dev - build developer versions",
"printf 02a. or cargo make dev_and_run - build and run developer versions",
"printf 03. cargo make run_dev0 - run the developer build",
"printf 04. cargo make test - test the test code",
"printf 05. cargo make increment_minor - if needed increment semver minor",
"printf 06. cargo make release - build release version, increment semver patch in cargo.toml",
"printf 06a. or cargo make release_and_run - build and run release version, increment semver patch in cargo.toml",
"printf 07. cargo make run_rel0 - run the release build",
"printf ",
"printf 08. cargo make doc - includes from cargo.toml to README.md and from README.md to main.rs or lib.rs, generates doc and copies to docs folder, exports codetour to .md.",
"printf 09. cargo make commit commit_message - git commit ",
"printf 10. cargo make sshadd - run only once - adds identity to ssh-agent for git and publish",
"printf 11. cargo make gitpush - git push",
"printf 12. cargo make publish_to_web",
"printf OR ",
"printf 12. cargo make crates_io_dry_run - prepare publishing for crates.io",
"printf 13. cargo make crates_io_publish - gittag and publish to crates.io",
"printf ",
"printf LIST PREPARED RUN WITH ARGUMENTS - separate debug and release versions",
"printf cargo make run_dev0 - no arguments - target/debug/${CARGO_MAKE_CRATE_NAME}",
"printf cargo make run_rel0 - no arguments - target/release/${CARGO_MAKE_CRATE_NAME}",
"printf cargo make run_rel1 - target/release/${CARGO_MAKE_CRATE_NAME} argument1",
"printf ",
"printf CREV - always verify you dependencies",
"printf cargo crev verify",
"printf "
]
# end of help
# end of help
# end of help
[tasks.check]
description = "cargo check --release"
clear = true
script = [
"clear",
"printf $ cargo fmt",
"cargo fmt",
"printf $ cargo check --release",
"cargo check --release",
]
[tasks.dev]
description = "wasm-pack build --target web --dev "
clear = true
script = [
"clear",
"printf $ cargo fmt",
"cargo fmt",
"printf $ wasm-pack build --target web --dev ",
"wasm-pack build --target web --dev ",
"printf $ rsync -a --info=progress2 --delete-after pkg/ web_server_folder/web_content_folder/pkg/",
"rsync -a --info=progress2 --delete-after pkg/ web_server_folder/web_content_folder/pkg/",
]
[tasks.dev_and_run]
description = "wasm-pack build development and run"
clear = true
dependencies = [
"dev",
"run_dev0",
]
[tasks.test]
description = "cargo test"
clear = true
script = [
"clear",
"printf $ cargo test",
"cargo test",
]
[tasks.release]
description = "wasm-pack build --target web --release "
clear = true
script = [
"clear",
# Binaries version is date
"printf $ lmake_version_from_date",
"lmake_version_from_date",
# Library version is semver
# "printf $ lmake_semver --increment=patch",
# "lmake_semver --increment=patch",
"printf $ cargo fmt",
"cargo fmt",
"printf $ wasm-pack build --target web --release ",
"wasm-pack build --target web --release ",
"printf $ rsync -a --info=progress2 --delete-after pkg/ web_server_folder/web_content_folder/pkg/",
"rsync -a --info=progress2 --delete-after pkg/ web_server_folder/web_content_folder/pkg/",
]
[tasks.release_and_run]
description = "wasm-pack build release and run"
clear = true
dependencies = [
"release",
"run_rel0",
]
[tasks.run_dev0]
description = "no-argument - target/debug/${CARGO_MAKE_CRATE_NAME}"
clear = true
script = [
"printf $ target/debug/${CARGO_MAKE_CRATE_NAME}",
"target/debug/${CARGO_MAKE_CRATE_NAME}",
]
[tasks.run_rel0]
description = "no-argument - target/release/${CARGO_MAKE_CRATE_NAME}"
clear = true
script = [
"printf $ target/release/${CARGO_MAKE_CRATE_NAME}",
"target/release/${CARGO_MAKE_CRATE_NAME}",
]
[tasks.run_rel1]
description = "target/release/${CARGO_MAKE_CRATE_NAME} argument1"
clear = true
script = [
"clear",
"printf $ target/release/${CARGO_MAKE_CRATE_NAME} argument1",
"target/release/${CARGO_MAKE_CRATE_NAME} argument1",
]
# end of run scripts
# end of run scripts
# end of run scripts
[tasks.audit]
description = "cargo audit - RustSec advisories"
clear = true
script = [
"clear",
"cargo audit"
]
[tasks.doc]
description = "cargo doc - create docs from doc comments"
clear = true
script= [
"clear",
"printf $ lmake_lines_of_code",
"lmake_lines_of_code",
"printf $ lmake_cargo_toml_to_md",
"lmake_cargo_toml_to_md",
"printf $ lmake_md_to_doc_comments",
"lmake_md_to_doc_comments",
"printf $ cargo doc --no-deps --document-private-items",
# create doc from doc comments
"cargo doc --no-deps --document-private-items",
"printf $ codetour_export_to_md",
# export code tour to md
"codetour_export_to_md",
# copy to /docs/ because it is github standard
"printf $ rsync -a --info=progress2 --delete-after target/doc/ docs/",
"rsync -a --info=progress2 --delete-after target/doc/ docs/",
# create simple index.html file in docs folder
"printf create simple index.html file in docs folder",
"printf \"<meta http-equiv=\\\"refresh\\\" content=\\\"0; url=${CARGO_MAKE_CRATE_NAME}/index.html\\\" />\" > docs/index.html",
# message to help user with next move
"printf after successful doc, run cargo make commit msg_for_commit",
]
[tasks.commit]
description = "cargo fmt and git commit"
clear = true
script = [
"clear",
"printf $ cargo fmt",
"cargo fmt",
"printf $ git add -A",
"git add -A",
"printf $ git commit -a -m \"${@}\"",
"git commit -a -m \"${@}\"",
"printf after successful fmt and git commit, run $ cargo make gitpush",
]
[tasks.amend]
description = "git --amend to last commit for small changes and corrections"
clear = true
script = [
"clear",
"printf $ cargo fmt",
"cargo fmt",
"printf $ git add .",
"git add .",
"printf $ git commit --amend",
"git commit --amend",
"printf after successful git commit, run $ cargo make gitpush",
]
[tasks.sshadd]
description = "adds identity to ssh-agent for git and publish operations"
clear = true
script = [
"clear",
"bash ~/sshadd.sh",
]
[tasks.gitpush]
description = "push the commits to github, uses ssh agent"
clear = true
script = [
"clear",
"printf $ git push",
"git push",
"printf after successful git push, use $ cargo make crates_io_dry_run or publish_to_web",
]
[tasks.publish_to_web]
description = "publish to web server"
workspace = false
clear = true
# backslash is the escape character for all other special characters.
# and then another time I have to escape the backslash. So 4 backslash for one backslash.
script = [
"clear",
"printf ",
"printf $ git tag -f -a v${CARGO_MAKE_CRATE_VERSION} -m version_${CARGO_MAKE_CRATE_VERSION}",
"git tag -f -a v${CARGO_MAKE_CRATE_VERSION} -m version_${CARGO_MAKE_CRATE_VERSION}",
"printf $ rsync -a --info=progress2 --delete-after /mnt/c/Users/Luciano/rustprojects/rust_regex_explanation_pwa/web_server_folder/web_content_folder/ /mnt/c/Users/Luciano/rustprojects/googlecloud/var/www/bestia.dev/rust_regex_explanation_pwa/",
"rsync -a --info=progress2 --delete-after /mnt/c/Users/Luciano/rustprojects/rust_regex_explanation_pwa/web_server_folder/web_content_folder/ /mnt/c/Users/Luciano/rustprojects/googlecloud/var/www/bestia.dev/rust_regex_explanation_pwa/",
"printf $ rsync -e ssh -a --info=progress2 --delete-after /mnt/c/Users/Luciano/rustprojects/googlecloud/var/www/bestia.dev/rust_regex_explanation_pwa/ [email protected]:/var/www/bestia.dev/rust_regex_explanation_pwa/",
"rsync -e ssh -a --info=progress2 --delete-after /mnt/c/Users/Luciano/rustprojects/googlecloud/var/www/bestia.dev/rust_regex_explanation_pwa/ [email protected]:/var/www/bestia.dev/rust_regex_explanation_pwa/",
]
# end of publish script
# end of publish script
# end of publish script
[tasks.crates_io_dry_run]
clear = true
description = "prepare before publishing to crates.io with dry-run"
script = [
"clear",
"printf $ cargo publish --dry-run",
"cargo publish --dry-run",
"printf after successful dry-run, use $ cargo make crates_io_publish",
]
[tasks.crates_io_publish]
clear = true
description = "gittag and publish to crates.io"
script = [
"clear",
# gittag
"printf $ git tag -f -a v${CARGO_MAKE_CRATE_VERSION} -m version_${CARGO_MAKE_CRATE_VERSION}",
"git tag -f -a v${CARGO_MAKE_CRATE_VERSION} -m version_${CARGO_MAKE_CRATE_VERSION}",
# cargo publish
"printf $ cargo publish",
"cargo publish",
]
# end of crates.io publish script
# end of crates.io publish script
# end of crates.io publish script
[tasks.increment_minor]
description = "increments semver minor"
clear = true
script = [
"clear",
"lmake_semver --increment=minor",
]