Hate to ask this way, but rust has cargo add pkgname
does swift have something similar, or is there another "easy" way to add remote dependencies?
Not sure if this is important, but I am trying to see what developing server side apps using swift on linux.
There's nothing built-in that does that sort of action. Right now it's a manual process to add the packages and set up any target dependencies. It gets a little trickier to tweak Package.swift
because it's IN the Swift language (and there's the support for multiple iterations of it where the swift language has morphed) - making full support for something like this notably more challenging in the complete sense.
There is a Swift Evolution Proposal for such a thing (swift-evolution/proposals/0301-package-editing-commands.md at main · apple/swift-evolution · GitHub) and it was accepted and implemented (https://github.com/apple/swift-package-manager/pull/5802) but it’s not yet merged.
Luckily it’s not too hard to manually add a package via editing the package manifest.
Thanks for the info, I am trying to see what getting a swift toolchain and dev environ is like for linux.