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 )
View in #support on Slack
@mollyiv : Hi Can we set a custom scheme and configuration for 3rd party swift package dependencies? We’re using custom configuration and schemes in our project and in order to make it work with swift package macros, the configurations must match.
// swift-tools-version: 6.0
@preconcurrency import PackageDescription
#if TUIST
import ProjectDescription
let packageSettings = PackageSettings(
productTypes: [:]
)
#endif
let package = Package(
name: "MyApp",
platforms: [
.iOS(.v13),
],
dependencies: [
.package(url: "<https://github.com/pointfreeco/swift-case-paths>", from: "1.5.6"),
]
)
Otherwise, we’re getting Xcode errors and warnings from tuist:
The following warnings need attention:
· The project 'swift-case-paths' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [custom-debug (debug), custom-release (release)]
...
For those curious, this is the error:
• https://github.com/pointfreeco/swift-navigation/discussions/244#discussioncomment-11039920
Sorry Pedro, asking one last time. Next questions on forum
I have a POC, I’ll open up GitHub
@Pedro : Is it ok if I move it to the forum and answer it there for visibility?
1 Like