Skip to content

Commit

Permalink
fix std_build.sh script, fix Rust lints (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Leshiy authored Dec 14, 2023
1 parent a37a344 commit a9bf9ea
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
29 changes: 18 additions & 11 deletions earthly/rust/scripts/std_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,35 @@ status $rc "Checking Benchmarks all run to completion" \
cargo bench --all-targets; rc=$?

## Generate dependency graphs
cargo depgraph --workspace-only --dedup-transitive-deps > target/doc/workspace.dot
cargo depgraph --dedup-transitive-deps > target/doc/full.dot
cargo depgraph --all-deps --dedup-transitive-deps > target/doc/all.dot
status $rc "Generating workspace dependency graphs" \
$(cargo depgraph --workspace-only --dedup-transitive-deps > target/doc/workspace.dot); rc=$?
status $rc "Generating full dependency graphs" \
$(cargo depgraph --dedup-transitive-deps > target/doc/full.dot); rc=$?
status $rc "Generating all dependency graphs" \
$(cargo depgraph --all-deps --dedup-transitive-deps > target/doc/all.dot); rc=$?

export NO_COLOR=1
## Generate Module Trees for documentation purposes.
for lib in $1;
do
cargo modules generate tree --orphans --types --traits --tests --all-features \
--package $lib --lib > target/doc/$lib.lib.modules.tree; rc=$?
status $rc "Generate Module Trees for $lib" \
$(cargo modules generate tree --orphans --types --traits --tests --all-features \
--package $lib --lib > target/doc/$lib.lib.modules.tree); rc=$?

cargo modules generate graph --all-features --modules \
--package $lib --lib > target/doc/$lib.lib.modules.dot; rc=$?
status $rc "Generate Module Graphs for $lib" \
$(cargo modules generate graph --all-features --modules \
--package $lib --lib > target/doc/$lib.lib.modules.dot); rc=$?
done
for bin in $2;
do
IFS="/" read -r package bin <<< "$bin"
cargo modules generate tree --orphans --types --traits --tests --all-features \
--package $package --bin $bin > target/doc/$package.$bin.bin.modules.tree; rc=$?
status $rc "Generate Module Trees for $package/$bin" \
$(cargo modules generate tree --orphans --types --traits --tests --all-features \
--package $package --bin $bin > target/doc/$package.$bin.bin.modules.tree); rc=$?

cargo modules generate graph --all-features --modules \
--package $package --bin $bin > target/doc/$package.$bin.bin.modules.dot; rc=$?
status $rc "Generate Module Graphs for $package/$bin" \
$(cargo modules generate graph --all-features --modules \
--package $package --bin $bin > target/doc/$package.$bin.bin.modules.dot); rc=$?
done

# Return an error if any of this fails.
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions examples/rust/crates/bar/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! This is the bar crate
/// Adds two numbers
#[must_use]
pub fn add(left: usize, right: usize) -> usize {
left + right
}
Expand Down

0 comments on commit a9bf9ea

Please sign in to comment.