Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?
[X] Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.
Description
The Path type in Swift Package Manager plugins has been deprecated in favor of URL. However, the Target protocol still uses Path for the directory property:
protocol Target {
var directory: PackagePlugin.Path { get }
}
When accessing any property of directory, we receive a deprecation warning:
"'property' is deprecated: UseURLtype instead ofPath. but we dont have access to URL.
The issue is that we don't have access to an equivalent URL property or a way to convert Path to URL within the plugin context.
when you run from terminal we get:
- warning: 'propertyName' is deprecated: UseURLtype instead ofPath`.
Expected behavior
We should have a way to access the target's directory as a URL or a method to convert Path to URL without triggering deprecation warnings.
let target = any Target object
target.directoryURL.lastComponent
Actual behavior
Currently, we must use the deprecated Path properties, leading to warnings and potential future incompatibilities.
let target = any Target object
target.directory.lastComponent <- "'lastComponent' is deprecated: Use URL type instead of Path
Steps to reproduce
in any plugin code whenever we access any property from any object that conforms to Target we
Swift Package Manager version/commit hash
Swift 6.0.0-dev
Swift & OS version (output of swift --version ; uname -a)
swift-driver version: 1.113 Apple Swift version 6.0 (swiftlang-6.0.0.7.6 clang-1600.0.24.1)
Target: arm64-apple-macosx15.0
Darwin Ibrahims-MacBook-Pro-16-M2.local 24.0.0 Darwin Kernel Version 24.0.0: Wed Jul 31 21:50:55 PDT 2024; root:xnu-11215.0.199.501.2~1/RELEASE_ARM64_T6020 arm64
Is it reproducible with SwiftPM command-line tools:
swift build
,swift test
,swift package
etc?swift build
,swift test
,swift package
etc.Description
The Path type in Swift Package Manager plugins has been deprecated in favor of URL. However, the Target protocol still uses Path for the directory property:
When accessing any property of directory, we receive a deprecation warning:
"'property' is deprecated: Use
URLtype instead of
Path. but we dont have access to URL.
The issue is that we don't have access to an equivalent URL property or a way to convert Path to URL within the plugin context.
when you run from terminal we get:
- warning: 'propertyName' is deprecated: Use
URLtype instead of
Path`.Expected behavior
We should have a way to access the target's directory as a URL or a method to convert Path to URL without triggering deprecation warnings.
let target = any Target object
target.directoryURL.lastComponent
Actual behavior
Currently, we must use the deprecated Path properties, leading to warnings and potential future incompatibilities. let target = any Target object
target.directory.lastComponent
<- "'lastComponent' is deprecated: UseURL
type instead ofPath
Steps to reproduce
in any plugin code whenever we access any property from any object that conforms to Target we
Swift Package Manager version/commit hash
Swift 6.0.0-dev
Swift & OS version (output of
swift --version ; uname -a
)swift-driver version: 1.113 Apple Swift version 6.0 (swiftlang-6.0.0.7.6 clang-1600.0.24.1) Target: arm64-apple-macosx15.0 Darwin Ibrahims-MacBook-Pro-16-M2.local 24.0.0 Darwin Kernel Version 24.0.0: Wed Jul 31 21:50:55 PDT 2024; root:xnu-11215.0.199.501.2~1/RELEASE_ARM64_T6020 arm64