Skip to content
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

Merged
merged 1 commit into from
Mar 19, 2019
Merged

Xcode project for Carthage #427

merged 1 commit into from
Mar 19, 2019

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Mar 19, 2019

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.

Xcode project structure

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.

Info.plist and code signing

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):

carthage bootstrap

After that you can proceed with building via Xcode.

Alternatively, you can use Carthage for testing the command-line build:

carthage build --no-skip-current

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 dependencies
  • Cartfile.resolved — 'lock file' that pins specific versions of dependencies
  • Themis.xcodeproj/ — directory with all Xcode project stuff
  • src/wrappers/themis/Obj-C/Themis/Info.plist — framework Info.plist file
  • src/wrappers/themis/Obj-C/Themis/themis.h — framework umbrella header file

If you wish to update dependencies:

  • you may need to update Cartfile
  • run carthage update to pull in new versions and update the lock file
  • commit both Cartfile and Cartfile.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.

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).
@ilammy ilammy added enhancement O-iOS 📱 Operating system: iOS O-macOS 💻 Operating system: macOS W-SwiftThemis 🔶 Wrapper: SwiftThemis, Swift API infrastructure Automated building and packaging labels Mar 19, 2019
@ilammy ilammy requested a review from vixentael March 19, 2019 13:36
@ilammy ilammy requested a review from Lagovas as a code owner March 19, 2019 13:36
@@ -0,0 +1 @@
github "ilammy/OpenSSL" ~> 1.0.2
Copy link
Collaborator

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?

Copy link
Contributor

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

krzyzanowskim/OpenSSL#55

if this will happen soon – this dependency will be re-linked to the original repo.

otherwise, we will fork openssl into cossacklabs/*

Copy link
Collaborator Author

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.

@ilammy ilammy merged commit a415c1d into cossacklabs:master Mar 19, 2019
@ilammy ilammy deleted the carthage branch March 19, 2019 17:17
@ilammy ilammy mentioned this pull request Mar 14, 2020
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement infrastructure Automated building and packaging O-iOS 📱 Operating system: iOS O-macOS 💻 Operating system: macOS W-SwiftThemis 🔶 Wrapper: SwiftThemis, Swift API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants