Skip to content

Commit

Permalink
Xcode project for Carthage (#427)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
ilammy committed Mar 19, 2019
1 parent 419d5a3 commit a415c1d
Show file tree
Hide file tree
Showing 10 changed files with 1,460 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ docs/examples/objc/Pods
/target
**/*.rs.bk
Cargo.lock

# Carthage
Carthage/
1 change: 1 addition & 0 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "ilammy/OpenSSL" ~> 1.0.2
1 change: 1 addition & 0 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "ilammy/OpenSSL" "1.0.2.14.1"
1,235 changes: 1,235 additions & 0 deletions Themis.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions Themis.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
80 changes: 80 additions & 0 deletions Themis.xcodeproj/xcshareddata/xcschemes/Themis (iOS).xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F4A24A0223A8D7F005CB63A"
BuildableName = "themis.framework"
BlueprintName = "Themis (iOS)"
ReferencedContainer = "container:Themis.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "738B810E2239809D00A9947C"
BuildableName = "ThemisCore.framework"
BlueprintName = "ThemisCore"
ReferencedContainer = "container:Themis.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F4A24A0223A8D7F005CB63A"
BuildableName = "themis.framework"
BlueprintName = "Themis (iOS)"
ReferencedContainer = "container:Themis.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
80 changes: 80 additions & 0 deletions Themis.xcodeproj/xcshareddata/xcschemes/Themis (macOS).xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1010"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F00E8D6223C197900EC1EF3"
BuildableName = "themis.framework"
BlueprintName = "Themis (macOS)"
ReferencedContainer = "container:Themis.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F00E8D6223C197900EC1EF3"
BuildableName = "themis.framework"
BlueprintName = "Themis (macOS)"
ReferencedContainer = "container:Themis.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "9F00E8D6223C197900EC1EF3"
BuildableName = "themis.framework"
BlueprintName = "Themis (macOS)"
ReferencedContainer = "container:Themis.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
22 changes: 22 additions & 0 deletions src/wrappers/themis/Obj-C/Themis/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.10.5</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
23 changes: 23 additions & 0 deletions src/wrappers/themis/Obj-C/Themis/themis.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (c) 2019 Cossack Labs Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#import <Foundation/Foundation.h>

//! Project version number for Themis.
FOUNDATION_EXPORT double themisVersionNumber;

//! Project version string for Themis.
FOUNDATION_EXPORT const unsigned char themisVersionString[];

#import "objcthemis/objcthemis.h"

0 comments on commit a415c1d

Please sign in to comment.