Although OS X is not a deployment platform for Swift Foundation, it is useful for development and test purposes.
In order to build on OS X, you will need:
- The latest version of Xcode
- The latest version of the OS X SDK (at this time: 10.11)
Build steps:
- Open
Foundation.xcodeproj
- Build the Foundation target
Testing steps:
- Create a new Xcode workspace that includes both
Foundation.xcodeproj
andXCTest.xcodeproj
(from the swift-corelibs-xctest repository). The Swift Core Libraries XCTest project is not the same as the one that comes with Xcode itself. - Run (Cmd-R) the TestFoundation target
You will need:
- A supported distribution of Linux. At this time, we support Ubuntu 14.04 and Ubuntu 15.10.
To get started, follow the instructions on how to build Swift. Foundation requires use of the version of swiftc
and clang
built with the overall project.
The default build script does not include Foundation. To build Foundation as well, pass --foundation
to the build script.
swift/utils/build-script --foundation -t
This will build and run the Foundation tests.
After the complete Swift build has finished, you can iterate quickly on Foundation itself by simply invoking ninja
in the Foundation directory.
cd Foundation
ninja
This will build Foundation. To build and run the tests, use the test
target:
ninja test
The script will also output some help on how to run the tests under the debugger. The exact library path to use will depend on how Foundation itself was configured.