I have a Xcode project that has multiple local Swift Packages. Consider the following Package.swift
file as an example:
let package = Package(
name: "SomeFeature",
products: [
.library(name: "FooFeature", targets: ["FooComposition"])
],
targets: [
.target(name: "FooCore"),
.target(name: "FooHelper"),
.target(
name: "FooComposition",
dependencies: [
.target(name: "FooCore"),
.target(name: "FooHelper")
]
)
]
)
Here, I want to build FooCore
and FooHelper
individually without building the FooFeature
product. From the command line I can use swift build --target <target>
to achieve this.
However, it seems to be impossible to do the same via a scheme in Xcode, since I can only select products in the target selection when editing the scheme (see the following screenshot).
Is there a solution that allows me to build individual SwiftPM targets directly from Xcode?