[env] HEADER_OUTPUT_DIR_C="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/includes" HEADER_OUTPUT_DIR_CPP="${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/includes-cpp" HEADER_NAME="wooting-analog-common.h" HEADER_PATH_CLEAN="${HEADER_OUTPUT_DIR_C}/wooting-analog-common*" HEADER_PATH_CLEAN_CPP="${HEADER_OUTPUT_DIR_CPP}/wooting-analog-common*" PLUGIN_GEN_PATH="${CARGO_MAKE_WORKING_DIRECTORY}/cbindgen-plugin.toml" [tasks.header-cpp] command = "cbindgen" args = ["-l", "c++", "${CBINDGEN_ARGS}", "--clean", "-o", "${HEADER_OUTPUT_DIR_CPP}/${HEADER_NAME}"] [tasks.header-c] command = "cbindgen" args = ["-l", "c", "${CBINDGEN_ARGS}", "--clean", "-o", "${HEADER_OUTPUT_DIR_C}/${HEADER_NAME}"] [tasks.cbindgen-install] install_crate = { crate_name = "cbindgen", rustup_component_name="cbindgen", binary="cbindgen", test_arg = "--help" } command = "cbindgen" args = ["--version"] [tasks.cbindgen] #TODO: Check the rustup_component_name arg to see if it is the correct name dependencies=["cbindgen-install", "header-c", "header-cpp"] [tasks.gen-headers] env = { CBINDGEN_ARGS="-v" } run_task = "cbindgen" [tasks.verify-headers] env = { CBINDGEN_ARGS="--verify" } run_task = "cbindgen" [tasks.clean-headers] #env = { HEADER_POSTFIX="*" } script_runner = "@shell" script = [ ''' rm ${HEADER_PATH_CLEAN} rm ${HEADER_PATH_CLEAN_CPP} ''' ] [tasks.post-test] dependencies=["verify-headers"] [tasks.post-build] dependencies=["gen-headers"] [tasks.clean] #dependencies=["clean-headers"]