forked from arlyon/async-stripe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toml
60 lines (51 loc) · 1.39 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
[env]
RUST_FILES = { glob = "./**/*.rs", include_files = true, include_dirs = false, ignore_type = "git" }
[tasks.openapi-delete]
cwd = "openapi"
command = "rm"
args = ["-f", "spec3.json"]
# verifies if all the apis are exported, and reports which are missing
[tasks.verify]
script = '''
#!/usr/bin/env bash
for filename in src/resources/generated/*.rs ; do
BASE=$(basename $filename '.rs')
if ! grep -Fq "pub mod $BASE;" src/resources/generated.rs ; then
echo $BASE missing module
fi
if ! grep -Fq "$BASE::*," src/resources.rs ; then
echo $BASE missing export
fi
done
'''
[tasks.openapi-fetch]
cwd = "openapi"
command = "wget"
args = [
"https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.json",
]
dependencies = ["openapi-delete"]
[tasks.openapi-generate]
cwd = "openapi"
command = "cargo"
args = ["run", "spec3.json"]
dependencies = ["openapi-fetch"]
[tasks.openapi-copy]
cwd = "openapi"
command = "cp"
args = ["-a", "out/.", "../src/resources/generated"]
dependencies = ["openapi-generate"]
[tasks.fmt]
command = "cargo"
toolchain = "nightly"
install_crate = "rustfmt"
args = ["fmt", "--", "@@split(RUST_FILES,;)"]
[tasks.check]
command = "cargo"
toolchain = "nightly"
install_crate = "rustfmt"
args = ["fmt", "--", "--check", "@@split(RUST_FILES,;)"]
[tasks.openapi-install]
dependencies = ["openapi-copy", "fmt"]
[config]
default_to_workspace = false