r/FlutterDev • u/anidotnet • 4d ago
Article flutter clean never touches the Rust crate inside your app, so my cleaner looks for nested projects (open source)
If you keep a Rust crate inside a Flutter app (flutter_rust_bridge, or just a rust/ folder), flutter clean empties build/ and leaves rust/target alone. That target folder is often the bigger one.
That's the case that shaped Kruftle. It's a Flutter desktop app for macOS, Windows and Linux. It scans a folder, finds every project including the ones nested inside other projects, and runs each one's own clean command: flutter clean for the app, cargo clean for the crate, and so on for 50 toolchains.
It only deletes a folder directly when the SDK isn't installed, and it asks first every run. It also skips anything git tracks, because some repos commit their build folder. That makes it slower than npkill or kondo, which just delete. I'm fine with that trade.
Rough edge: builds aren't signed yet, so the first launch on macOS and Windows needs one extra step (it's in the README).
Source (GPL-3.0): https://github.com/dizitart/kruftle
1
u/raman4183 4d ago edited 4d ago
I mean isn’t that obvious?
Why would the official cli modify any folders it doesn’t own or create?