edit-text
edit-text copied to clipboard
Centralize custom cargo arguments in ./tools
The source code of the ./tools command that runs build steps is found in "build-tools/src/main.rs". There are two variables, release and force_color, which are set at the beginning of the script. They are used to set the color output and release mode flags for all invocations to cargo that the build script performs. But repeating each of these arguments each time cargo is called is verbose and error-prone.
There's already a function that is called to generate arguments to be passed on to cargo, cargo_args_for_crate, which is used right now to load features options from the Configuration.toml file. If the logic for adding the "--release" flag and the "--color=always" flag were added to the vector of arguments cargo_args_for_crate returns, then there can be just one set of arguments injected into each cargo call in the script, and the variables release and force_color (and all the places where they are used) can be deleted.
https://github.com/tcr/edit-text/blob/4156a859f599fad1da2a4e74ac6c3572121eb5a3/build-tools/src/main.rs#L321-L336