[swift-users] Swift setup for different versions

Seán Labastille swift-evolution at lsr.li
Mon Feb 15 00:05:36 CST 2016


Hi Alex,

Since you mentioned you have Xcode 7.2.1 installed I presume you’ll want to have this setup on OS X.

Up until Xcode 7.3 Swift has always been bundled with Xcode (as it was not open sourced yet).

https://swift.org/download/#apple-platforms <https://swift.org/download/#apple-platforms> is the place to look for snapshots from 2.2 onwards.
Here you will find snapshots both for the release branch of 2.2 and development which will contain features intended for 3.0, but not included in 2.2.

You can install multiple of these, and in Xcode 7.3 you get an overview of the versions installed (you can also find them in /Library/Developer/Toolchains) and switch between these easily.

On the command line you can use xcrun to choose which toolchain you want to use:

16-02-15 6:48:03 ➜  ~  xcrun --toolchain org.swift.2220160208a swift build
error: unable to invoke subcommand: /Library/Developer/Toolchains/swift-2.2-SNAPSHOT-2016-02-08-a.xctoolchain/usr/bin/swift-build (No such file or directory)
16-02-15 6:48:26 ➜0  ~  xcrun --toolchain org.swift.3020160208a swift build
error: no Package.swift file found

Notice that you need to use the toolchain’s bundle identifier (check the Info.plist) to identify the toolchain precisely.

For Swift 2.1 you’ll need to use Xcode 7.2 and use xcode-select if you want to use that on the command line, as well as for switching back to 7.3.

I hope this helps,

Seán

> On 13 Feb 2016, at 23:05, alex via swift-users <swift-users at swift.org <mailto:swift-users at swift.org>> wrote:
> 
> Hi,
> 
> I’m a Swift newbie, going through the Swift books (2.1 and 2.2). I’m a bit confused and I’d appreciate your help with setting up a good environment.
> 
> 1. I have Xcode 7.2.1 installed. This seems to correspond to Swift 2.1.1 which I assume is the stable version.
> 
> 2. There are release snapshots for 2.2 available on swift.org <http://swift.org/>.
> 
> Q2.1: can one run in parallel Swift 2.1.1 and 2.2 snapshots? If yes, what setup do I need?
> 
> Q2.2: I read that 2.2 snapshots do not include the Package manager. Can it be installed separately?
> 
> 3. I’ve heard about the upcoming big 3.0 Swift version.
> 
> Q3.1: are there development snapshots available?
> 
> Q3.2: as above, can one run 2.1, 2.2, and 3.0 snapshots in parallel on the same system? (if yes, please do include any links on how the setup looks like)
> 
> thanks a lot for your help,
> 
> :- a
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org <mailto:swift-users at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160215/9555bb5a/attachment.html>


More information about the swift-users mailing list