SE-273 Configuration Conditionals (Again)

About once/year I (re)discover that I'm shipping some mock data in an app bc I need it in previews. Then I think hey, I should be able to conditionally exclude that in release builds. Then I go look at SE-273 on how to do that. Then I remember that I've posted about this multiple times and that the review thread which specified syntax for the implementation to this day still gets people asking for this feature. :slight_smile:

Is it safe to assume at this point that SPM will not be getting that part of the proposal? If so, it seems a process shortcoming not to clean up the proposal with a statement to that effect. It would certainly still be handy to have.

3 Likes

Never is a long time. There's a bunch of life enhancing changes I want to start get through over the next few releases. I'll definitely take this one under consideration. I need to understand why it fell off first.

2 Likes

Sorry for hijacking, but I feel like SE-0226 is a similar candidate. A rather old SPM proposal which was never fully implemented.

this feedback is much appreciated!

Also looking forward to this.

Package Traits should support this if you build with swift build but cannot be injected to xcodebuild (yet :folded_hands:t2:).

FWIW I currently use Context.environment to exclude targets from release builds — works with xcodebuild.

1 Like

Very interested in this too.

@swhitty can you share how you use environment to exclude targets from release?