Can an App Extension be conditionally included in a build?

Viewed 111

I'm starting work on 2 app extensions, and I'd like to set up my builds as follows:

  • Builds intended for the App Store should not include either extension
  • Builds intended for TestFlight should include the extension that is almost ready
  • Local builds should include both extensions

Currently, I have a different build configuration for each of these to show and hide other aspects of the app (and compiler flags in some cases too). I use fastlane to make my builds.

As far as I can tell, the only ways to add or remove an app extension would be:

  • Duplicate the main target twice and use one for each of the above builds (drawback - must maintain 3 copies of the target until the extensions are fully complete)
  • Manually add/remove the extension before building (drawback - impossible to make both TestFlight and App Store builds from a given branch in a CI environment because manual intervention is required)

Can anyone think of a better solution for conditionally including the app extensions?

0 Answers
Related