libhandy-rs/regen.sh
2020-07-10 21:13:45 +00:00

35 lines
628 B
Bash
Executable file

#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
CRATE_API=libhandy
CRATE_SYS=libhandy-sys
CONFIG_API=${CRATE_API}/Gir.toml
CONFIG_SYS=${CRATE_SYS}/gir-libhandy.toml
GIR=./target/release/gir
# Build the gir tool
git submodule update --init
(cd gir && cargo build --release)
# Copy the gir
cp Handy-1.gir gir-files/
# Regenerate the sys crate
rm -rf ${CRATE_SYS}/{build.rs, src/auto}
${GIR} -c ${CONFIG_SYS} -d gir-files -o ${CRATE_SYS}
# Regenerate the api crate
rm -rf ${CRATE_API}/src/auto
${GIR} -c ${CONFIG_API} -d gir-files -o ${CRATE_API}
rm gir-files/Handy-1.gir
# Run cargo fmt --all
cargo fmt --all