I created a build tool plugin to generate symbols from an asset catalog.
The plugin calls an executable target that generates a Colors.swift
file.
The plugin works as expected.
My app target (the one that imports the package containing the plugin) has an iOS and a Watch App target, meaning the executable is called twice when compiling the app.
The error looks like this:
Multiple commands produce '/Users/g1intlv/Library/Developer/Xcode/DerivedData/Stage-asmtpprdyfhrcubtcapnpsvqjlkf/SourcePackages/plugins/stage.output/StageDesignSystem/GenerateColors/Colors.swift'
This is my plugin declaration:
.plugin(
name: "GenerateColors",
capability: .buildTool(),
dependencies: ["GenerateColorsExec"]
),
.executableTarget(
name: "GenerateColorsExec",
path: "Plugins/GenerateColorsExec"
),
Is this expected? A workaround could be to exclude the Watch App in the executable. Can I do that using some swift setting? I.e.
swiftSettings: [SwiftSetting]