Swift bindings generator for Epic Online Services framework.
This tool takes the C language EOSSDK.framework as input and generates object oriented Swift bindings for the C SDK.
The Swift API uses only Swift types. All pointers required by the C SDK are managed internally.
./Temp/EOS-SDK-IOS-16697186-v1/EOSSDK.xcframework
The outputted macos-x86_64
framework is currently just for non-prod unit test purposes, as the iOS one is currently available for ios-arm64
, which doesn't allow launching unit tests.
First, Download the iOS and C version of EOS SDK from https://dev.epicgames.com/portal/
Place the contents of the archives parallel to this source code repository, ie:
/Users/username/repositories/EOS-SDK-IOS-16697186-v1/SDK/Bin/IOS/EOSSDK.framework
/Users/username/repositories/EOS-SDK-16697186-v1/SDK/Bin/libEOSSDK-Mac-Shipping
/Users/username/repositories/swift-eos-build/
Then, edit eos-version.txt
and eos-version.macos.txt
if needed so that it contains the versions/names of the folders above, ie EOS-SDK-IOS-16697186-v1
and EOS-SDK-16697186-v1
There are two ways you can launch it:
This will allow you to debug and see all the log messages. You will need to perform some setup manually.
./Scripts/build-clang-module
to create a patched version of the SDK./Scripts/dump-eossdk-ast.sh
to get the AST of SDK headersPackage.swift
in Xcode, change the scheme to swift-eos-build
, and device to MacOS
The script steps are needed only once for each version of SDK.
This will perform the two steps above, then compile and launch the tool.
swift-eos-build.command
from commandline or FinderTo see the debug logs from commandline output, open Console.app
before launching then search or filter for subsystem dev.roman.eos
I recommend launching from Xcode as this is still under development.
The bindings will be in ./Temp/EOS-SDK-IOS-16697186-v1/Bindings
subdirectory of the repo.
You can use them as Swift package, or copy them all (or some) to your project.
Binding depend on the emitter ./Temp/EOS-SDK-IOS-16697186-v1/EOSSDK.xcframework
bundle. For local development you can symlink it into your package directory.
By default nothing will be overwritten, so if you try to launch it again you'll get an error.
To move automatically the generated output to trash, add --allow-delete
to Xcode scheme's arguments, or to the swift-eos-build.sh
commandline.
./Scripts/build-clang-module
Patches the C EOSSDK.framework so that it can be imported into Swift projects
./Scripts/dump-eossdk-ast.sh
Outputs clang AST of the EOS SDK, including comment nodes, for use by SwiftEOSBuild
SwiftEOSBuild
Outputs Swift API for EOS SDK, including all neccesary memory management code
By default, scripts expect the official EOS SDK to be placed in ../SDK/<EOS Version>/EOSSDK.framework
folder, relative to the repository.
Temp/<EOS Version>/Bindings/EOS
./Temp/<EOS Version>/EOSSDK.framework
./Temp/<EOS Version>/EOSSDK.xcframework
./Temp/AST
./Temp/<EOS Version>/TestableEOSSDK
link |
Stars: 0 |
Last commit: 2 years ago |
EOS SDK repackaged as Swift-compatible xcframework
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics