This file describes how to build Ice for Swift from source and how to test the resulting build.
-
Swift and Xcode
You need Swift 5 or later with a recent version of Xcode for macOS. -
Ice C++ XCFrameworks
Building Ice for Swift requires having first built Ice for C++ from thecpp
directory. The Ice for C++ build creates the following C++XCFrameworks
:Ice.xcframework
IceDiscovery.xcframework
IceLocatorDiscovery.xcframework
If you want to create binaries for iOS or the iOS simulator, build the C++ XCFrameworks with
PLATFORMS=all
:make -C ../cpp -j12 PLATFORMS=all
Run the following command from the swift
directory:
make
Add PLATFORMS='macosx iphonesimulator'
to include the iOS test controller in your build:
make PLATFORMS='macosx iphonesimulator'
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:
python allTests.py --all --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:
python allTests.py --all --config Debug --platform iphoneos
or
python allTests.py --all --config Debug --platform iphonesimulator
depending on your target.