Sharing code across Package manifests

We have a codebase with many local Swift Packages in a single repository. In order to better keep dependency URLs and versions synced across all of the Package.swift files, it would be beneficial if we could do something like this:

// global file
extension Package.Dependency {
  static let nuke = .package(name: "Nuke", url: ..., .upToNextMinor(...))
  static let apollo = ...
}
// Package.swift A
let package = Package(..., dependencies: [.nuke, .apollo])
// Package.swift B
let package = Package(..., dependencies: [.apollo])

is this possible in any way?

Hey @davepaul0 , did you find any way to do this?

@mukesh-mt I did not.

I'm not working on the same project anymore, but in hindsight, I probably could have used a code gen tool like Sorcery ( or just scripted some sed commands!) to get our package definitions in a single place, but in a large team with various levels of experience, I'm not sure it'd be worth the additional level of obscurity. :man_shrugging: