Slide 79
Slide 79 text
// swift-tools-version: 5.6
import PackageDescription
let package = Package(
name: "ReadingTime",
platforms: [.iOS(.v8), .macOS(.v12)],
products: [
.library(name: "ReadingTime", targets: ["ReadingTime"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-markdown.git", branch: "main"),
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
.package(url: "https://github.com/JohnSundell/Plot.git", from: "0.5.0"),
],
targets: [
.target(name: "ReadingTime", dependencies: [.product(name: "Markdown", package: "swift-markdown")]),
.target(
name: "ReadingTimeSite", dependencies: [
.product(name: "Vapor", package: "vapor"),
.product(name: "Plot", package: "plot"),
"ReadingTime"
],
swiftSettings: [
.unsafeFlags(["-cross-module-optimization"], .when(configuration: .release))
]
),
.executableTarget(name: "ReadingTimeSiteRunner", dependencies: ["ReadingTimeSite"])
]
)
Let’s create a new target, again!