Commit 54b49f7
authored
Simplify example run.rs files to use dora_cli build and run functions (dora-rs#1165)
This commit standardizes all example run.rs files to use the
`dora_cli::build` and `dora_cli::run` functions directly instead of
spawning cargo commands with tokio::process::Command. This
simplification:
- Removes custom `build_dataflow` and `run_dataflow` helper functions
- Uses `dora_cli::{build, run}` API directly
- Standardizes error messages for tracing setup to use
`.wrap_err("failed to set up tracing subscriber")`
- Reduces code duplication across all examples
- Makes the codebase more maintainable
Modified examples:
- All Rust examples (rust-dataflow, rust-dataflow-git,
rust-dataflow-url, rust-ros2-dataflow)
- All C/C++ examples (c-dataflow, c++-dataflow, c++-arrow-dataflow,
c++-ros2-dataflow, cmake-dataflow)
- All Python examples (python-dataflow, python-operator-dataflow,
python-ros2-dataflow)
- Benchmark example
Total reduction: 289 lines of boilerplate code removed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)File tree
15 files changed
+209
-582
lines changed- .github/workflows
- binaries/daemon/src
- examples
- benchmark
- c++-arrow-dataflow
- c++-dataflow
- c++-ros2-dataflow
- c-dataflow
- cmake-dataflow
- python-dataflow
- python-operator-dataflow
- python-ros2-dataflow
- rust-dataflow-git
- rust-dataflow-url
- rust-dataflow
- rust-ros2-dataflow
15 files changed
+209
-582
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
122 | 129 | | |
123 | 130 | | |
124 | 131 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
275 | | - | |
276 | | - | |
| 275 | + | |
277 | 276 | | |
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
281 | 280 | | |
282 | 281 | | |
283 | 282 | | |
284 | | - | |
| 283 | + | |
285 | 284 | | |
286 | 285 | | |
287 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
| 5 | + | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
| 10 | + | |
17 | 11 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 12 | + | |
33 | 13 | | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | 14 | | |
48 | 15 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | 1 | | |
3 | 2 | | |
4 | 3 | | |
| |||
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 9 | + | |
14 | 10 | | |
15 | 11 | | |
16 | 12 | | |
| |||
30 | 26 | | |
31 | 27 | | |
32 | 28 | | |
33 | | - | |
| 29 | + | |
34 | 30 | | |
35 | 31 | | |
36 | | - | |
| 32 | + | |
37 | 33 | | |
38 | 34 | | |
39 | 35 | | |
40 | 36 | | |
41 | | - | |
| 37 | + | |
42 | 38 | | |
43 | 39 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 40 | + | |
| 41 | + | |
47 | 42 | | |
48 | 43 | | |
49 | | - | |
50 | | - | |
| 44 | + | |
51 | 45 | | |
52 | 46 | | |
53 | 47 | | |
| |||
62 | 56 | | |
63 | 57 | | |
64 | 58 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
69 | 62 | | |
70 | 63 | | |
71 | 64 | | |
| |||
98 | 91 | | |
99 | 92 | | |
100 | 93 | | |
101 | | - | |
| 94 | + | |
102 | 95 | | |
103 | | - | |
| 96 | + | |
104 | 97 | | |
105 | 98 | | |
106 | | - | |
| 99 | + | |
107 | 100 | | |
108 | 101 | | |
109 | 102 | | |
110 | 103 | | |
111 | 104 | | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
| 105 | + | |
| 106 | + | |
135 | 107 | | |
136 | 108 | | |
137 | 109 | | |
| |||
201 | 173 | | |
202 | 174 | | |
203 | 175 | | |
204 | | - | |
| 176 | + | |
205 | 177 | | |
206 | 178 | | |
207 | 179 | | |
| |||
0 commit comments