Skip to content

Commit 8d1f546

Browse files
committed
chore: minimize the need to define more scripts in parent makefile
1 parent 107de8e commit 8d1f546

File tree

1 file changed

+70
-30
lines changed

1 file changed

+70
-30
lines changed

Makefile.toml

Lines changed: 70 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,84 @@ command = "cargo"
1111
args = ["test"]
1212

1313
[tasks.build]
14-
run_task = { name = ["build-llm"] }
14+
script_runner = "@shell"
15+
script = '''
16+
domains=(llm)
17+
18+
# if there is no domain passed run for every domain
19+
if [ -z $1 ]; then
20+
for domain in ${domains[@]};
21+
do
22+
cargo make --cwd $domain build;
23+
done
24+
else
25+
cargo make --cwd $1 build
26+
fi
27+
'''
1528

1629
[tasks.release-build]
17-
run_task = { name = ["release-build-llm"] }
30+
script_runner = "@shell"
31+
script = '''
32+
domains=(llm)
33+
34+
# if there is no domain passed run for every domain
35+
if [ -z $1 ]; then
36+
for domain in ${domains[@]};
37+
do
38+
cargo make --cwd $domain release-build;
39+
done
40+
else
41+
cargo make --cwd $1 release-build
42+
fi
43+
'''
1844

1945
[tasks.build-portable]
20-
run_task = { name = ["build-llm-portable"] }
46+
script_runner = "@shell"
47+
script = '''
48+
domains=(llm)
49+
50+
# if there is no domain passed run for every domain
51+
if [ -z $1 ]; then
52+
for domain in ${domains[@]};
53+
do
54+
cargo make --cwd $domain build-portable;
55+
done
56+
else
57+
cargo make --cwd $1 build-portable
58+
fi
59+
'''
2160

2261
[tasks.release-build-portable]
23-
run_task = { name = ["release-build-llm-portable"] }
62+
script_runner = "@shell"
63+
script = '''
64+
domains=(llm)
65+
66+
# if there is no domain passed run for every domain
67+
if [ -z $1 ]; then
68+
for domain in ${domains[@]};
69+
do
70+
cargo make --cwd $domain release-build-portable;
71+
done
72+
else
73+
cargo make --cwd $1 release-build-portable
74+
fi
75+
'''
2476

2577
[tasks.wit]
26-
run_task = { name = ["llm-wit"] }
78+
script_runner = "@shell"
79+
script = '''
80+
domains=(llm)
81+
82+
# if there is no domain passed run for every domain
83+
if [ -z $1 ]; then
84+
for domain in ${domains[@]};
85+
do
86+
cargo make --cwd $domain wit;
87+
done
88+
else
89+
cargo make --cwd $1 wit
90+
fi
91+
'''
2792

2893
[tasks.build-all]
2994
script_runner = "@duckscript"
@@ -89,31 +154,6 @@ for target in ${targets}
89154
end
90155
'''
91156

92-
# Tasks for llm module
93-
[tasks.build-llm]
94-
command = "cargo"
95-
args = ["make", "--cwd", "llm", "build"]
96-
97-
[tasks.build-llm-portable]
98-
command = "cargo"
99-
args = ["make", "--cwd", "llm", "build-portable"]
100-
101-
[tasks.release-build-llm]
102-
command = "cargo"
103-
args = ["make", "--cwd", "llm", "release-build"]
104-
105-
[tasks.release-build-llm-portable]
106-
command = "cargo"
107-
args = ["make", "--cwd", "llm", "release-build-portable"]
108-
109-
[tasks.llm-wit]
110-
command = "cargo"
111-
args = ["make", "--cwd", "llm", "wit"]
112-
113-
[tasks.llm-build-test-components]
114-
command = "cargo"
115-
args = ["make", "--cwd", "llm", "build-test-components"]
116-
117157
# Maintenance tasks
118158
[tasks.check]
119159
description = "Runs rustfmt and clippy checks without applying any fix"

0 commit comments

Comments
 (0)