/
Makefile.toml
128 lines (109 loc) · 2.97 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
extend= [
{ path = "coverage_grcov.makefile.toml" }
]
[config]
default_to_workspace = false
skip_core_tasks = true
[env]
PROJ_NAME = "SpringQL"
SKIP_INSTALL_GRCOV = 1
[tasks.help]
script = ['''
#!/usr/bin/env bash -eux
cargo make --list-all-steps
''']
[tasks.format]
script = ['''
#!/usr/bin/env bash -eux
cargo fmt --all
''']
[tasks.lint]
script = ['''
#!/usr/bin/env bash -eux
RUSTFLAGS='-D warnings' cargo clippy --workspace --all-targets --all-features
''']
[tasks.check-dependencies]
condition = { rust_version = { min = "1.56.1" } } # cargo-deny 0.11.4 : supports rust 1.56.1 later
script = ['''
#!/usr/bin/env bash -eux
cargo deny check
''']
[tasks.build]
script = ['''
#!/usr/bin/env bash -eux
RUSTFLAGS='-D warnings' cargo build --workspace --all-targets --all-features
''']
dependencies=["check-dependencies"]
[tasks.test]
script = ['''
#!/usr/bin/env bash -eux
RUST_LOG=springql_core=info,warn RUSTFLAGS='-D warnings' cargo test --workspace --all-targets --all-features
''']
[tasks.example-build]
script = ['''
#!/usr/bin/env bash -eux
for example in $(git ls-files |grep -e 'examples/[^/]*\.rs$') ; do
cargo build --example $(basename -s .rs "$example")
done
''']
[tasks.example-run]
dependencies = ["example-build"]
script = ['''
#!/usr/bin/env bash -eux
echo '-- Start doc_app1'
cargo run --example doc_app1 &
sleep 1
echo '{"ts": "2022-01-01 13:00:00.000000000", "temperature": 5.3}' | nc localhost 54300
sleep 1
pkill doc_app1
echo '-- End doc_app1'
echo
sleep 3
echo '-- Start doc_app2'
cargo run --example doc_app2 &
sleep 1
echo '{"ts": "2022-01-01 13:00:00.000000000", "symbol": "ORCL", "amount": 10}' |nc localhost 54300
echo '{"ts": "2022-01-01 13:00:01.000000000", "symbol": "ORCL", "amount": 30}' |nc localhost 54300
echo '{"ts": "2022-01-01 13:00:01.000000000", "symbol": "GOOGL", "amount": 50}' |nc localhost 54300
echo '{"ts": "2022-01-01 13:00:02.000000000", "symbol": "ORCL", "amount": 40}' |nc localhost 54300
echo '{"ts": "2022-01-01 13:00:05.000000000", "symbol": "GOOGL", "amount": 60}' |nc localhost 54300
echo '{"ts": "2022-01-01 13:00:10.000000000", "symbol": "APPL", "amount": 100}' |nc localhost 54300
sleep 1
pkill doc_app2
echo '-- End doc_app2'
echo
echo '-- Start in_vehicle_pipeline'
cargo run --example in_vehicle_pipeline
echo '-- End in_vehicle_pipeline'
echo
''']
[tasks.doc]
script = ['''
#!/usr/bin/env bash -eux
cargo clean --doc
cargo doc --no-deps --all-features
''']
[tasks.deadlink]
script = ['''
#!/usr/bin/env bash -eux
cargo deadlinks --check-http --ignore-fragments
mlc --ignore-path target
''']
[tasks.copyright]
script = [
'''
#!/usr/bin/env bash -eux
for rs in $(git ls-files |grep -e '\.rs$') ; do
grep '// This file is part of https://github.com/SpringQL/SpringQL which is licensed under MIT OR Apache-2.0. See file LICENSE-MIT or LICENSE-APACHE for full license details.' $rs
done
''',
]
[tasks.publish]
script = [
'''
#!/usr/bin/env bash -eux
cargo workspaces publish
''',
]
[tasks.lcov]
alias="coverage_grcov"