swiftlang / swift-package-manager

The Package Manager for the Swift Programming Language
Apache License 2.0
9.76k stars 1.35k forks source link

PackagePlugin.Target.dependency property is missing a URL-based counterpart #8044

Open DougGregor opened 1 month ago

DougGregor commented 1 month ago

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

Description

The PackagePlugin.Target.dependency property produces a value of the deprecated type PackagePlugin.Path. However, unlike the other places I've seen Path-based APIs, there is no corresponding URL version.

Expected behavior

With all of the Path APIs being deprecated, I'd like to have a:

    var directoryURL: URL { get }

instead

Actual behavior

Any use of PackagePlugin.Target.dependency introduces deprecation warnings in my plugin.

Steps to reproduce

  1. Check out https://github.com/swiftlang/swift-java/
  2. swift build
  3. Observe warnings with any use of this API

Swift Package Manager version/commit hash

6.0

Swift & OS version (output of swift --version ; uname -a)

% swift --version ; uname -a
swift-driver version: 1.115 Apple Swift version 6.0 (swiftlang-6.0.0.9.10 clang-1600.0.26.2)
Target: arm64-apple-macosx15.0
Darwin Minoc-7.local 24.1.0 Darwin Kernel Version 24.1.0: Mon Oct  7 21:17:34 PDT 2024; root:xnu_development-11215.41.2~2/DEVELOPMENT_ARM64_T6000 arm64
dschaefer2 commented 1 month ago

I think there's is a PR for this already but that's probably on main.