diff --git a/Cargo.lock b/Cargo.lock index 48e57cb..c540f11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,7 +75,6 @@ dependencies = [ "clap 2.29.0 (registry+https://github.com/rust-lang/crates.io-index)", "derive-error 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "framed 0.1.4", - "framed_test_type 0.1.0", ] [[package]] diff --git a/bin/decode_typed b/bin/decode_typed new file mode 100755 index 0000000..03ceb10 --- /dev/null +++ b/bin/decode_typed @@ -0,0 +1,49 @@ +#!/usr/bin/env bash +set -e + +REPO_DIR="$(cd $(dirname ${BASH_SOURCE[0]} )/..; pwd )" + +TYPE_CRATE_DIR="${TYPE_CRATE_DIR-${REPO_DIR}/test_type}" +TYPE_NAME="${TYPE_NAME-framed_test_type::Test}" + +echo "TYPE_CRATE_DIR = '${TYPE_CRATE_DIR}'" +echo "TYPE_NAME = '${TYPE_NAME}'" + +TYPE_CRATE_NAME="$(cargo read-manifest --manifest-path "${TYPE_CRATE_DIR}/Cargo.toml" | jq '.name' -r)" + +TMP_DIR="${REPO_DIR}/target/decode_typed/tmp" + +mkdir -p "${TMP_DIR}"; +rm -f "${TMP_DIR}/"*; + +# TODO: Move dynamic.rs to TMP_DIR, both here and in the include! in main.rs. +export FRAMED_DECODE_DYNAMIC_RS="${TMP_DIR}/dynamic_${TYPE_NAME}.rs"; +cat > "${FRAMED_DECODE_DYNAMIC_RS}" <