#Is there a reason tauri-cli can't be a purely build.rs driven workflow instead?
6 messages · Page 1 of 1 (latest)
for desktop by far the main issue here is that there's no cargo/rust hook that runs after the build, which means creating installers without the cli would be impossible.
also beforeDevCommand (if it's a dev server) wouldn't work but that's imo a minor, but still nice to have thing
gonna ignore mobile here, that just won't work
ah yeah I did mean just for build/release. I got caught out with beforeBuildCommand not running, before I realised it's tauri-cli which runs that so my cargo build was just skipping it. Then I was trying to run tauri cli from within build.rs, just so I could have the regular cargo build entrypoint. That deadlocks though - can't start a cargo build inside a cargo build, even if you figure out detection of whether it's via tauri-cli or not to know which bit to do.
but then what prompted the question was just thinking I can do tauri_build::build(), why doesn't that include beforeBuildCommand, and why can't I do tauri_cli::bundle(...) afterwards? You say there's no cargo/rust hook post build, but why not literally just
fn main() {
build();
bundle();
}
(or equivalently why is tauri-cli separate to tauri-build, why doesn't build just (optionally) bundle too, after the actual build?
The fact that rust build scripts run before the last compile steps make this impossible.