mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
Xcode has decent support for skipping certain build phases when input files haven't changed. This only happens for build phases within a single target, and not for entire Target dependencies. Before, we defined `Connlib` as its own bonafide build target, and then added it as a target dependency for the network extension targets. This causes Xcode to always run our `build-rust.sh` script, which takes around 30s on my M1 even when `rust/` hasn't changed. Instead, we can remove the `Connlib` target, and add a "Run script" phase to the network extension targets themselves. By configuring the input file list, Xcode will skip this phase if `rust/**/*.rs`, `rust/**/*.toml` and `rust/Cargo.lock` haven't changed. This makes it **much** faster to iterate on Swift code -- Xcode is _very_ fast when building pure Swift (sometimes under < 1s). <img width="1016" alt="Screenshot 2024-12-11 at 6 10 45 PM" src="https://github.com/user-attachments/assets/29b5f073-3d58-4c07-9592-f9209033c966" />