1234567891011121314151617181920212223242526272829 |
- set -eu
- SRC="authentication keyexchange mercury
- metadata pubsub spirc"
- cat > src/lib.rs <<EOF
- // Autogenerated by build.sh
- extern crate protobuf;
- EOF
- cat > files.rs <<EOF
- // Autogenerated by build.sh
- pub const FILES : &'static [(&'static str, u32)] = &[
- EOF
- for name in $SRC; do
- src=proto/$name.proto
- out=src/$name.rs
- checksum=$(cksum $src | cut -f 1 -d' ')
- protoc --rust_out src/ -I proto/ proto/$name.proto
- echo "pub mod $name;" >> src/lib.rs
- echo " (\"$src\", $checksum)," >> files.rs
- done
- echo "];" >> files.rs
|