-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode project for Carthage #427
Conversation
This adds an Xcode project to build Themis, enabling distribution via Carthage. This requires an Xcode project in the root repo directory with shared build schemes. As it was easier to do, and as it probably provides better debug information for Xcode users, Themis build for Xcode is a completely new one. We *do not* (re)use existing Makefiles, but this should be possible in theory. However, currently the Xcode project replicates the existing build and compiles Soter, Themis, and Obj-C Themis files manually. Themis is compiled with OpenSSL as a backend. We pull in the dependency via Carthage as well. Currently we use our own fork of the library, but later it will be updated to the proper upstream once Carthage support lands there. The project file provides two distinct targets and build schemes: for macOS and iOS, and their frameworks have slightly different structure. Though, we reuse as many files as possible. For example, the umbrella header Themis.h is the same for both platforms. Note that the build schemes are *shared*. This is important for Cartage. Actual framework names are in lowercase: themis.framework. This is for compatibility with existing CocoaPods builds which use such naming. We do not code-sign the resulting frameworks. It is expected that the applications using Themis will sign all external framework code that they use. Finally, framework bundles use 'stuttering' identifiers like "com.cossacklabs.themis.Themis". This is because later we will need to name our documentation examples and it would be nice to put them under the same namespace "com.cossacklabs.themis". The framework version is provisional 0.10.5 (which is actually preview of 0.11).
@@ -0,0 +1 @@ | |||
github "ilammy/OpenSSL" ~> 1.0.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we need some fork of openssl, maybe fork it to cossacklabs/* and use from same organization repositories?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we hope that Marcin will merge our PR
if this will happen soon – this dependency will be re-linked to the original repo.
otherwise, we will fork openssl into cossacklabs/*
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirming that's the plan. We'll do a proper fork before releasing 0.11 if we are not able to use upstream by that time.
This adds an Xcode project to build Themis, enabling distribution via Carthage. This requires an Xcode project in the root repo directory with shared build schemes.
Build structure
As it was easier to do, and as it probably provides better debug information for Xcode users, Themis build for Xcode is a completely new one. We do not (re)use existing Makefiles, but this should be possible in theory. However, currently the Xcode project replicates the existing build and compiles Soter, Themis, and Obj-C Themis files manually.
Themis is compiled with OpenSSL as a backend. We pull in the dependency via Carthage as well. Currently we use our own fork of the library, but later it will be updated to the proper upstream once Carthage support lands there.
The project file provides two distinct targets and build schemes: for macOS and iOS, and their frameworks have slightly different structure. Though, we reuse as many files as possible. For example, the umbrella header Themis.h is the same for both platforms. Note that the build schemes are shared. This is important for Cartage.
Actual framework names are in lowercase: themis.framework. This is for compatibility with existing CocoaPods builds which use such naming.
We do not code-sign the resulting frameworks. It is expected that the applications using Themis will sign all external framework code that they use.
Finally, framework bundles use 'stuttering' identifiers
com.cossacklabs.themis.Themis
. This is because later we will need to name our documentation examples and it would be nice to put them under the same namespace "com.cossacklabs.themis".The framework version is provisional 0.10.5 (which is actually a preview of 0.11).
How to test this
Before building Themis you have to pull in dependencies (OpenSSL):
After that you can proceed with building via Xcode.
Alternatively, you can use Carthage for testing the command-line build:
Examples that actually use Carthage build will be added soon in a separate PR.
File layout and maintenance
New files and their functions:
Cartfile
— list of our Carthage dependenciesCartfile.resolved
— 'lock file' that pins specific versions of dependenciesThemis.xcodeproj/
— directory with all Xcode project stuffsrc/wrappers/themis/Obj-C/Themis/Info.plist
— framework Info.plist filesrc/wrappers/themis/Obj-C/Themis/themis.h
— framework umbrella header fileIf you wish to update dependencies:
Cartfile
carthage update
to pull in new versions and update the lock fileCartfile
andCartfile.resolved
If you wish to update Themis framework version then edit it in
Info.plist
.Carthage uses git tags to manage package versions, so every official Themis release is simultaneously a new Carthage version.