How to override the default configurations of external packages

If your project doesn’t follow the standard configuration names Release and Debug, you’ll have to ensure that the configurations of the targets generated for your packages align. You can do that through the PackageSettings definition in your Package.swift:

#if TUIST
import ProjectDescription

let packageSettings = PackageSettings(
    baseSettings: .settings(configurations: [
      .debug(name: "MyDebugConfiguration" /**...*//),
      .release(name: "MyReleaseConfiguration" /** ... *//)
    ])
)
#endif

Some notes:

  • When configurations don’t align, you get a warning. Don’t ignore it. Make sure configurations match throughout the graph.
  • .debug and .release are internally referred to as “flavors” and are used to set some default values for you.
  • If you need a configuration list other than “Debug” and “Release”, ask yourself if the deviation from the standard is really needed (perhaps not)
1 Like