Imagine I have a package called commonPackage:
import PackageDescription
let package = Package(
name: "commonPackage",
dependencies: [.package(url: "https://github.com/SwiftGen/SwiftGen.git", from: "6.6.2")]
)
I can run swift run swiftgen
in a terminal application which gives me:
swift run swiftgen
Building for debugging...
Build complete! (0.34s)
Error: `swiftgen.yml` is not a config file
Usage: swiftgen config run [--config <config>] [--quiet] [--normal] [--verbose]
See 'swiftgen config run --help' for more information.
This is great, but it's in my commonPackage which has no code.
Now imagine I have another package called consumerPackage with a dependency on commonPackage:
import PackageDescription
let package = Package(
name: "consumerPackage",
dependencies: [.package(path: "/Users/user/Developer/commonPackage")]
)
Now when I run swift run swiftgen
, I get
swift run swiftgen
error: 'commonpackage': package 'commonpackage' contains no products
What do I need to do to be able to run swift run swiftgen
in the consumerPackage directory?
What product do I need to create in my commonPackage?
(I want to have the swiftgen dependency only in the commonPackage)