From f51903edbe30ca6f8d5df9ddc05db8d5dc115660 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Thu, 26 Sep 2024 15:25:34 -0700 Subject: [PATCH] directoryURL is missing from the Target protocol in the PackagePlugin APIs The directoryURL property was added to all of the concrete Target implementations, such as SwiftSourceModuleTarget, ClangSourceModuleTarget, and so on, but not to the base protocol itself. This means you need a bunch of conditional casts when trying to access the directoryURL in a package plugin. Closes: #8001 --- Sources/PackagePlugin/PackageModel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/PackagePlugin/PackageModel.swift b/Sources/PackagePlugin/PackageModel.swift index fff6774a26a..5f131d76ddf 100644 --- a/Sources/PackagePlugin/PackageModel.swift +++ b/Sources/PackagePlugin/PackageModel.swift @@ -178,8 +178,13 @@ public protocol Target { var name: String { get } /// The absolute path of the target directory in the local file system. + @available(_PackageDescription, deprecated: 6.1, renamed: "directoryURL") var directory: Path { get } + /// The absolute path of the target directory in the local file system. + @available(_PackageDescription, introduced: 6.1) + var directoryURL: URL { get } + /// Any other targets on which this target depends, in the same order as /// they are specified in the package manifest. Conditional dependencies /// that do not apply have already been filtered out.