-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
125 lines (107 loc) · 3.02 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
[config]
skip_core_tasks = true
[env]
PROJ_NAME = "SpringQL-client-c"
[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.build]
script = ['''
#!/usr/bin/env bash -eux
RUSTFLAGS='-D warnings' cargo build --workspace --all-targets --all-features
''']
[tasks.test]
script = ['''
#!/usr/bin/env bash -eux
RUSTFLAGS='-D warnings' cargo test --workspace --all-targets --all-features
''']
[tasks.example-build]
dependencies = ["build"]
script = ['''
#!/usr/bin/env bash -eux
cd c_example
cmake .
make
''']
[tasks.example-run]
dependencies = ["example-build"]
script = ['''
#!/usr/bin/env bash -eux
cd c_example
echo '-- Start doc_app1'
./run_doc_app1 &
sleep 1
echo '{"ts": "2022-01-01 13:00:00.000000000", "temperature": 5.3}' |nc localhost 54300
sleep 1
pkill run_doc_app1
echo '-- End doc_app1'
echo
echo '-- Start doc_app2'
./run_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 run_doc_app2
echo '-- End doc_app2'
echo
echo '-- Start print_trade'
(python trade_projection/print_trade.py | nc -l 19876) &
sleep 1
./run_trade_projection
echo '-- End print_trade'
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 doc
for crate in $( cargo metadata --format-version=1 --no-deps | jq -r '.packages | map(.targets)[0][] | select(.doc) | .name' ); do
cargo deadlinks --check-http --ignore-fragments --dir target/doc/${crate}
done
mlc --ignore-path target
''']
[tasks.copyright]
script = [
'''
#!/usr/bin/env bash -eux
for rs in $(git ls-files |grep -e '\.\(rs\|c\|h\)$') ; do grep '// This file is part of https://github.com/SpringQL/SpringQL-client-c 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 publish
''',
]
[tasks.lcov]
script = [
'''
#!/usr/bin/env bash -eux
rm -rf target/debug/deps/${PROJ_NAME}-*
export CARGO_INCREMENTAL=0
export RUSTFLAGS="-Zinstrument-coverage"
export LLVM_PROFILE_FILE="${PROJ_NAME}-%p-%m.profraw"
cargo +nightly build --workspace --verbose
cargo +nightly test --workspace --verbose
grcov . -s . --binary-path ./target/debug/ -t lcov --branch --ignore-not-existing -o lcov.info
''',
]