mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
30 lines
544 B
Bash
30 lines
544 B
Bash
|
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
|