Ok... The issue was I had the following as my config, and hadn't replaced the products.library with products.executable
Incorrect Config
import PackageDescription
let package = Package(
name: "MyServer",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "MyServer",
targets: ["MyServer"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "MyServer",
dependencies: [dependencies: [
.product(name: "Vapor", package: "vapor")
]),]),
.testTarget(
name: "MyServerTests",
dependencies: ["MyLibrary1"]),
]
)
The Correct Config is shown here but is the same as that in the WWDC Session
import PackageDescription
let package = Package(
name: "MyServer",
platforms: [.macOS("12.0")],
products: [
.executable(
name: "MyServer",
targets: ["MyServer"]),
],
dependencies: [
.package(url: "https://github.com/vapor/vapor.git", .upToNextMajor(from: "4.0.0")),
],
targets: [
.executableTarget(
name: "MyServer",
dependencies: [
.product(name: "Vapor", package: "vapor")
]),
.testTarget(
name: "MyServerTests",
dependencies: ["MyServer"]),
]
)
Resolved Issue