So I've added swift-format as one of my dependencies to my own swift package so that I can use their lint swift package plugin.
Here is my Package.swift:
// swift-tools-version: 5.7
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "EssentialFeed",
platforms: [
.iOS(.v16),
.macOS(.v13),
.macCatalyst(.v16),
.tvOS(.v16),
.watchOS(.v9)
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "EssentialFeed",
targets: ["EssentialFeed"]),
.library(
name: "EssentialFeedTestHelpers",
targets: ["EssentialFeedTestHelpers"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-format", .upToNextMajor(from: "0.50700.1")),
],
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: "EssentialFeed",
dependencies: [],
plugins: [
.plugin(name: "LintPlugin", package: "swift-format"),
.plugin(name: "FormatPlugin", package: "swift-format"),
]
),
.target(
name: "EssentialFeedTestHelpers",
dependencies: []),
.testTarget(
name: "EssentialFeedTests",
dependencies: ["EssentialFeed", "EssentialFeedTestHelpers"]),
.testTarget(
name: "EssentialFeedAPIEndToEndTests",
dependencies: ["EssentialFeed", "EssentialFeedTestHelpers"]),
]
)
I get the following error when pulling this package:
product 'LintPlugin' required by package 'essentialfeed' target 'EssentialFeed' not found in package 'swift-format'.
But if you look at swift-format's Package.swift, you can see the plugins exist.
Meet Swift Package plugins
RSS for tagDiscuss the WWDC22 Session Meet Swift Package plugins
Posts under wwdc2022-110359 tag
1 Post
Sort by: