Skip to content

Commit

Permalink
DOCS: Eth API
Browse files Browse the repository at this point in the history
  • Loading branch information
aakoshh committed May 9, 2024
1 parent 67c1c16 commit 580adff
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions scripts/copy-rust-dep-structure.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# Copy only the Cargo.toml files in the exact project structure,
# so that we can build all dependencies without our own sources.

IN_DIR=$1
OUT_DIR=$2

for file in $(find $IN_DIR -type f \( -wholename "**/Cargo.*" \) | grep -v target | grep -v node_modules); do
RELATIVE_PATH=${file#*$IN_DIR/}
TARGET_DIR=$OUT_DIR/$(dirname $RELATIVE_PATH)
mkdir -p $TARGET_DIR
cp $file $TARGET_DIR
done


# Construct dummy sources. Add a print to help debug the case if we failed to properly replace the file.
echo "fn main() { println!(\"I'm the dummy.\"); }" > $OUT_DIR/fendermint/app/src/main.rs

for crate in $(find $TARGET_DIR -name "Cargo.toml" | xargs dirname | grep -v infra | grep -v node_modules | grep /); do \
touch $crate/src/lib.rs; \
done

0 comments on commit 580adff

Please sign in to comment.