Which version of SwiftPM is included with Xcode?

Hi everyone!

What's the easiest way to figure out which version/tag of SwiftPM is included in an Xcode version (say, Xcode 11 GM seed 2)?

Thanks :slight_smile:

swift package --version

1 Like

That makes... perfect sense :sweat_smile: thank you!

There are actually two separate groups of versioning numbers:

  1. The version of the swift package command line tool. It has so far been in lockstep with the compiler version number. As @Lantua stated, you can query for it with swift package --version. These are the numbers you need when specifying // swift-tools-version:x.x in a package manifest.

  2. The version of the SwiftPM package. This is what you need if you want to declare SwiftPM as a package dependency. This does not even map oneโ€toโ€one with the versions of the command line tool. To figure out how the two correspond, you pretty much have to ask. (There is no version for Xcode 11 GM Seed 2; Xcode 11 proper will probably be paired with 0.5.0, which does not exist yet.)

2 Likes

I'm on macOS Mojave 10.14.6 with Xcode 10.3. The SwiftPM comes with the Xcode is not the latest release, right?

Releases of Xcode and Swift have so far always been done in tandem. The latest Xcode has the latest Swift. (And Xcode Betas tend to contain unofficial Betas of Swift.)

At the moment I write, the App Store has Xcode 10.3 (with Swift 5.0.1) listed as latest, which corresponds with swift.orgโ€™s download list. However, by the time you actually read this, Xcode 11 may have come out with Swift 5.1. (This is an outsider prediction based on the release of iOS 13 today, which is not yet supported by any released version of Xcode. Do not expect the prediction to be any more accurate than a weather forecast.)

When will Xcode 11 and Swift 5.1 be released?

Those who know for sure cannot tell. The rest of us can only guess. But it is probably very soon, since the GM Seed 2 is four days stale, and some of the corresponding operating systems are already out. (Confusingly, the release notes say Xcode 11 is already available in the App Store, which is not true.)

Xcode 11 and Swift 5.1 are out now.

2 Likes