Is there a step in the build process where I can run some rust before Cargo.toml is parsed?
In my never ending struggles to get sane management of/synchronise 3rd party dependencies in my workspace, I am considering having a single properties file with the versions in and then doing something clever in build.rs to set the versions in the various Cargo.tomls in the workspace.
I could do this outside of build.rs and alias cargo to call my thing, but build.rs seems neater.
js@flower:~/learn/rust/comli$ cat ~/bin/cargo-before
#!/bin/bash
echo "It works!"
cargo b
js@flower:~/learn/rust/comli$ cargo before
It works!
Finished dev [unoptimized + debuginfo] target(s) in 0.02s
And if in a directory with no Cargo.toml you will notice the "It works!" is before the Cargo.toml parse error.
js@flower:~$ cargo before
It works!
error: could not find `Cargo.toml` in `/home/js` or any parent directory