This file describes how to build Ice for Swift from source and how to test the resulting build.
Ice for Swift builds and runs on macOS and is supported on the platforms listed on the supported platforms page.
Ice for Swift requires Swift 5 or later.
Ice for Swift is built using the Swift Package Manager. The Swift Package Manager is included in the Swift toolchain, which is included with Xcode.
Building Ice for Swift requires having first built Ice for C++ from the cpp
directory. This builds the required
C++ XCFrameworks
:
Ice.xcframework
IceDiscovery.xcframework
IceLocatorDiscovery.xcframework
If targeting Swift for iOS (or iOS simulator), the XCFrameworks must also be built to include the iOS architectures:
cd cpp
make PLATFORM=all
To build Ice for Swift and its corresponding tests, run the following command from the swift
directory:
make
The PLATFORMS
argument can be used to include the iOS test controller:
make PLATFORM=all
Package.swift (Ice for Swift source code), test/Package.swift (Ice for Swift tests), and TestDriverApp.xcodeproj (iOS test controller) can be opened and built using Xcode.
Python is required to run the test suite.
After a successful build, you can run the tests as follows:
python3 allTests.py --config Debug
If everything worked out, you should see lots of ok
messages. In case of a
failure, the tests abort with failed
.
Start the TestDriver iOS
application on your iOS device or simulator, from
Xcode.
Then on your mac, run:
python3 allTests.py --config Debug --platform iphoneos
or
python3 allTests.py --config Debug --platform iphonesimulator
depending on your target.