Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 7820e6c

Browse files
authored
Merge pull request #2445 from vaporos/1-3-000-justfile
Add justfile to 1-3 branch
2 parents 1ac9946 + 156d8c3 commit 7820e6c

File tree

12 files changed

+235
-0
lines changed

12 files changed

+235
-0
lines changed

adm/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,14 @@ help create the genesis block when initializing a validator, and manage the bloc
4848
depends = "$auto"
4949
section = "admin"
5050
maintainer-scripts = "packaging/ubuntu"
51+
52+
[features]
53+
default = []
54+
55+
stable = []
56+
57+
experimental = [
58+
# The experimental feature extends stable:
59+
"stable",
60+
# The following features are experimental:
61+
]

families/battleship/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,14 @@ serde = "1.0"
4848
serde_derive = "1.0"
4949
serde_json = "1.0"
5050
users = "0.11.0"
51+
52+
[features]
53+
default = []
54+
55+
stable = []
56+
57+
experimental = [
58+
# The experimental feature extends stable:
59+
"stable",
60+
# The following features are experimental:
61+
]

families/block_info/sawtooth_block_info/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,14 @@ log4rs = "1.2.0"
6060
[build-dependencies]
6161
protoc-rust = "2.0"
6262
glob = "0.3"
63+
64+
[features]
65+
default = []
66+
67+
stable = []
68+
69+
experimental = [
70+
# The experimental feature extends stable:
71+
"stable",
72+
# The following features are experimental:
73+
]

families/identity/sawtooth_identity/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,14 @@ conf-files = [
6161
"/lib/systemd/system/sawtooth-identity-tp.service",
6262
"/etc/default/sawtooth-identity-tp"
6363
]
64+
65+
[features]
66+
default = []
67+
68+
stable = []
69+
70+
experimental = [
71+
# The experimental feature extends stable:
72+
"stable",
73+
# The following features are experimental:
74+
]

families/settings/sawtooth_settings/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,14 @@ log4rs = "1.2.0"
6161
protoc-rust = "2.0"
6262
glob = "0.3"
6363
cfg-if = "0.1"
64+
65+
[features]
66+
default = []
67+
68+
stable = []
69+
70+
experimental = [
71+
# The experimental feature extends stable:
72+
"stable",
73+
# The following features are experimental:
74+
]

families/smallbank/smallbank_rust/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,14 @@ log4rs = "1.2.0"
3737
[build-dependencies]
3838
protoc-rust = "2.0"
3939
glob = "0.3"
40+
41+
[features]
42+
default = []
43+
44+
stable = []
45+
46+
experimental = [
47+
# The experimental feature extends stable:
48+
"stable",
49+
# The following features are experimental:
50+
]

justfile

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
# Copyright 2018-2020 Cargill Incorporated
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
16+
crates := '\
17+
validator \
18+
adm \
19+
perf/sawtooth_perf \
20+
perf/smallbank_workload \
21+
perf/intkey_workload \
22+
perf/sawtooth_workload \
23+
families/settings/sawtooth_settings \
24+
families/identity/sawtooth_identity \
25+
families/battleship \
26+
families/block_info/sawtooth_block_info \
27+
families/smallbank/smallbank_rust \
28+
'
29+
30+
features := '\
31+
--features=experimental \
32+
--features=stable \
33+
--features=default \
34+
--no-default-features \
35+
'
36+
37+
build:
38+
#!/usr/bin/env sh
39+
set -e
40+
for feature in $(echo {{features}})
41+
do
42+
for crate in $(echo {{crates}})
43+
do
44+
cmd="cargo build --tests --manifest-path=$crate/Cargo.toml $feature"
45+
echo "\033[1m$cmd\033[0m"
46+
$cmd
47+
done
48+
done
49+
echo "\n\033[92mBuild Success\033[0m\n"
50+
51+
clean:
52+
#!/usr/bin/env sh
53+
set -e
54+
for crate in $(echo {{crates}})
55+
do
56+
cmd="cargo clean --manifest-path=$crate/Cargo.toml"
57+
echo "\033[1m$cmd\033[0m"
58+
$cmd
59+
cmd="rm -f $crate/Cargo.lock"
60+
echo "\033[1m$cmd\033[0m"
61+
$cmd
62+
done
63+
64+
fix:
65+
#!/usr/bin/env sh
66+
set -e
67+
for crate in $(echo {{crates}})
68+
do
69+
for feature in $(echo {{features}})
70+
do
71+
cmd="cargo fix --manifest-path=$crate/Cargo.toml $feature"
72+
echo "\033[1m$cmd\033[0m"
73+
$cmd
74+
done
75+
done
76+
echo "\n\033[92mFix Success\033[0m\n"
77+
78+
lint:
79+
#!/usr/bin/env sh
80+
set -e
81+
for crate in $(echo {{crates}})
82+
do
83+
cmd="cargo fmt --manifest-path=$crate/Cargo.toml -- --check"
84+
echo "\033[1m$cmd\033[0m"
85+
$cmd
86+
done
87+
for crate in $(echo {{crates}})
88+
do
89+
for feature in $(echo {{features}})
90+
do
91+
cmd="cargo clippy --manifest-path=$crate/Cargo.toml $feature -- -D warnings"
92+
echo "\033[1m$cmd\033[0m"
93+
$cmd
94+
done
95+
done
96+
echo "\n\033[92mLint Success\033[0m\n"
97+
98+
99+
test:
100+
#!/usr/bin/env sh
101+
set -e
102+
for feature in $(echo {{features}})
103+
do
104+
for crate in $(echo {{crates}})
105+
do
106+
cmd="cargo build --tests --manifest-path=$crate/Cargo.toml $feature"
107+
echo "\033[1m$cmd\033[0m"
108+
$cmd
109+
cmd="cd $crate && cargo test $feature"
110+
echo "\033[1m$cmd\033[0m"
111+
(eval $cmd)
112+
done
113+
done
114+
echo "\n\033[92mTest Success\033[0m\n"

perf/intkey_workload/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,14 @@ rust-crypto = "^0.2"
1919
sawtooth_perf = { path = "../sawtooth_perf" }
2020
sawtooth-sdk = "0.3"
2121
simplelog = "0.5"
22+
23+
[features]
24+
default = []
25+
26+
stable = []
27+
28+
experimental = [
29+
# The experimental feature extends stable:
30+
"stable",
31+
# The following features are experimental:
32+
]

perf/sawtooth_perf/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,14 @@ rand = "0.6"
2828
tokio-core = "0.1"
2929
tokio-timer = "0.1"
3030
log = "0.4"
31+
32+
[features]
33+
default = []
34+
35+
stable = []
36+
37+
experimental = [
38+
# The experimental feature extends stable:
39+
"stable",
40+
# The following features are experimental:
41+
]

perf/sawtooth_workload/Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,14 @@ sawtooth-sdk = "0.3"
2222
sawtooth_perf = { path = "../sawtooth_perf" }
2323
protobuf = "2.0"
2424
clap = "2"
25+
26+
[features]
27+
default = []
28+
29+
stable = []
30+
31+
experimental = [
32+
# The experimental feature extends stable:
33+
"stable",
34+
# The following features are experimental:
35+
]

0 commit comments

Comments
 (0)