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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iOS wrapper header structure to compile Swift framework #415

Merged
merged 6 commits into from Mar 6, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to鈥
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -15,6 +15,7 @@
#

source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/cossacklabs/Podspecs.git'

platform :ios, '8.0'
project 'ThemisSwift/ThemisSwift.xcodeproj'
@@ -23,7 +24,7 @@ use_frameworks!

target :"ThemisSwift" do

pod 'themis', '0.10.3'
pod 'themis', '0.10.4'

end

@@ -1,29 +1,30 @@
PODS:
- GRKOpenSSLFramework (1.0.2.16)
- themis (0.10.3):
- themis/themis-openssl (= 0.10.3)
- themis/themis-openssl (0.10.3):
- themis (0.10.4):
- themis/themis-openssl (= 0.10.4)
- themis/themis-openssl (0.10.4):
- GRKOpenSSLFramework (~> 1.0.1)
- themis/themis-openssl/core (= 0.10.3)
- themis/themis-openssl/objcwrapper (= 0.10.3)
- themis/themis-openssl/core (0.10.3):
- themis/themis-openssl/core (= 0.10.4)
- themis/themis-openssl/objcwrapper (= 0.10.4)
- themis/themis-openssl/core (0.10.4):
- GRKOpenSSLFramework (~> 1.0.1)
- themis/themis-openssl/objcwrapper (0.10.3):
- themis/themis-openssl/objcwrapper (0.10.4):
- GRKOpenSSLFramework (~> 1.0.1)
- themis/themis-openssl/core

DEPENDENCIES:
- themis (= 0.10.3)
- themis (= 0.10.4)

SPEC REPOS:
https://github.com/cocoapods/specs.git:
- GRKOpenSSLFramework
https://github.com/cossacklabs/Podspecs.git:
- themis

SPEC CHECKSUMS:
GRKOpenSSLFramework: 35944e317e6336b2944ad70b059d84db6b2d8532
themis: bdbb1d0baeee19ff213dc7355e9e2b48debea359
themis: 7e0ee3b12ba243c11ac95f25f552df6481740ce0

PODFILE CHECKSUM: f5f6e45353fa284e162f817a401303a38430bc12
PODFILE CHECKSUM: 2ce293e8232afcf7e23e5943358ba0e39583e2a0

COCOAPODS: 1.5.3
@@ -7,7 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
2B98B674D47479213A83A406 /* Pods_ThemisSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C6670E03033C41A0938AC23 /* Pods_ThemisSwift.framework */; };
41F501C19293A5218A2CACC3 /* Pods_ThemisSwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B291DA89A51E7B7AAE3842C /* Pods_ThemisSwift.framework */; };
7399813E1CC449010095138F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7399812E1CC449010095138F /* AppDelegate.swift */; };
7399813F1CC449010095138F /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7399812F1CC449010095138F /* ViewController.swift */; };
739981401CC449010095138F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 739981311CC449010095138F /* Assets.xcassets */; };
@@ -20,8 +20,6 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
249F8D1DB897120A883BB860 /* Pods-ThemisSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThemisSwift.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-ThemisSwift/Pods-ThemisSwift.debug.xcconfig"; sourceTree = "<group>"; };
3C6670E03033C41A0938AC23 /* Pods_ThemisSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ThemisSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
739981171CC42C880095138F /* ThemisSwift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ThemisSwift.app; sourceTree = BUILT_PRODUCTS_DIR; };
7399812E1CC449010095138F /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7399812F1CC449010095138F /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@@ -34,28 +32,47 @@
7399813A1CC449010095138F /* server.pub */ = {isa = PBXFileReference; lastKnownFileType = file; path = server.pub; sourceTree = "<group>"; };
739981491CC44ABA0095138F /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
7399814A1CC44ABA0095138F /* ThemisSwift-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "ThemisSwift-Bridging-Header.h"; sourceTree = "<group>"; };
A1BA1DAC1040AFCE77C7D55B /* Pods-ThemisSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThemisSwift.release.xcconfig"; path = "../Pods/Target Support Files/Pods-ThemisSwift/Pods-ThemisSwift.release.xcconfig"; sourceTree = "<group>"; };
8788D92E22F2833AB53570F4 /* Pods-ThemisSwift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThemisSwift.release.xcconfig"; path = "../Pods/Target Support Files/Pods-ThemisSwift/Pods-ThemisSwift.release.xcconfig"; sourceTree = "<group>"; };
8B291DA89A51E7B7AAE3842C /* Pods_ThemisSwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_ThemisSwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A491A87A0EF08ACAC0FF89D8 /* Pods-ThemisSwift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-ThemisSwift.debug.xcconfig"; path = "../Pods/Target Support Files/Pods-ThemisSwift/Pods-ThemisSwift.debug.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
739981141CC42C880095138F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
2B98B674D47479213A83A406 /* Pods_ThemisSwift.framework in Frameworks */,
41F501C19293A5218A2CACC3 /* Pods_ThemisSwift.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
0DA459D5C948C35F4334C335 /* Frameworks */ = {
isa = PBXGroup;
children = (
8B291DA89A51E7B7AAE3842C /* Pods_ThemisSwift.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
6B51EDA757BE91C0E85571E3 /* Pods */ = {
isa = PBXGroup;
children = (
A491A87A0EF08ACAC0FF89D8 /* Pods-ThemisSwift.debug.xcconfig */,
8788D92E22F2833AB53570F4 /* Pods-ThemisSwift.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
7399810E1CC42C880095138F = {
isa = PBXGroup;
children = (
739981191CC42C880095138F /* ThemisSwift */,
739981181CC42C880095138F /* Products */,
DF643A7268BE1985F1F32BA6 /* Pods */,
74CE1841A757C1D673A397C2 /* Frameworks */,
6B51EDA757BE91C0E85571E3 /* Pods */,
0DA459D5C948C35F4334C335 /* Frameworks */,
);
sourceTree = "<group>";
};
@@ -117,36 +134,19 @@
name = "Supporting Files";
sourceTree = "<group>";
};
74CE1841A757C1D673A397C2 /* Frameworks */ = {
isa = PBXGroup;
children = (
3C6670E03033C41A0938AC23 /* Pods_ThemisSwift.framework */,
);
name = Frameworks;
sourceTree = "<group>";
};
DF643A7268BE1985F1F32BA6 /* Pods */ = {
isa = PBXGroup;
children = (
249F8D1DB897120A883BB860 /* Pods-ThemisSwift.debug.xcconfig */,
A1BA1DAC1040AFCE77C7D55B /* Pods-ThemisSwift.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
739981161CC42C880095138F /* ThemisSwift */ = {
isa = PBXNativeTarget;
buildConfigurationList = 739981291CC42C880095138F /* Build configuration list for PBXNativeTarget "ThemisSwift" */;
buildPhases = (
D3D33A5514B8D3BF6E9B871F /* [CP] Check Pods Manifest.lock */,
C4843E32EE3360C6B7E35650 /* [CP] Check Pods Manifest.lock */,
739981131CC42C880095138F /* Sources */,
739981141CC42C880095138F /* Frameworks */,
739981151CC42C880095138F /* Resources */,
73688AFE1CC4504F00D3C430 /* ShellScript */,
BF36FB0676CC14527D294FFC /* [CP] Embed Pods Frameworks */,
3F7435D4E70C63CC9E5AFF52 /* [CP] Embed Pods Frameworks */,
);
buildRules = (
);
@@ -211,20 +211,7 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
73688AFE1CC4504F00D3C430 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n# uncomment for autocorrection\n# swiftlint autocorrect\n swiftlint lint --quiet\nelse\n echo \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
};
BF36FB0676CC14527D294FFC /* [CP] Embed Pods Frameworks */ = {
3F7435D4E70C63CC9E5AFF52 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -248,7 +235,20 @@
shellScript = "\"${SRCROOT}/../Pods/Target Support Files/Pods-ThemisSwift/Pods-ThemisSwift-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
D3D33A5514B8D3BF6E9B871F /* [CP] Check Pods Manifest.lock */ = {
73688AFE1CC4504F00D3C430 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if which swiftlint >/dev/null; then\n# uncomment for autocorrection\n# swiftlint autocorrect\n swiftlint lint --quiet\nelse\n echo \"SwiftLint does not exist, download from https://github.com/realm/SwiftLint\"\nfi";
};
C4843E32EE3360C6B7E35650 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
@@ -406,7 +406,7 @@
};
7399812A1CC42C880095138F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 249F8D1DB897120A883BB860 /* Pods-ThemisSwift.debug.xcconfig */;
baseConfigurationReference = A491A87A0EF08ACAC0FF89D8 /* Pods-ThemisSwift.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
@@ -428,7 +428,7 @@
};
7399812B1CC42C880095138F /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = A1BA1DAC1040AFCE77C7D55B /* Pods-ThemisSwift.release.xcconfig */;
baseConfigurationReference = 8788D92E22F2833AB53570F4 /* Pods-ThemisSwift.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "iPhone Developer";
@@ -7,13 +7,13 @@
//
import UIKit
import themis

This comment has been minimized.

Copy link
@vixentael

vixentael Mar 6, 2019

Author Member

line that triggers compiling Swift framework :)


@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {

@@ -1,14 +1,14 @@
#ifndef _OBJCTHEMIS_
#define _OBJCTHEMIS_

#import <objcthemis/scell_seal.h>

This comment has been minimized.

Copy link
@vixentael

vixentael Mar 6, 2019

Author Member

real changes start from here

#import <objcthemis/scell_token.h>
#import <objcthemis/scell_context_imprint.h>
#import <objcthemis/skeygen.h>
#import <objcthemis/smessage.h>
#import <objcthemis/scomparator.h>
#import <objcthemis/ssession.h>
#import <objcthemis/serror.h>
#import "scell_seal.h"
#import "scell_token.h"
#import "scell_context_imprint.h"
#import "skeygen.h"
#import "smessage.h"
#import "scomparator.h"
#import "ssession.h"
#import "serror.h"

This comment has been minimized.

Copy link
@ilammy

ilammy Mar 6, 2019

Contributor

I'm a bit confused wrt the usage of <objcthemis/serror.h> vs "serror.h". Shouldn't it be backwards instead?

  • <objcthemis/serror.h> should be used in header files as that's what included into the user code
  • "serror.h" should be used in source files to ensure that we compile with headers that are nearby

This comment has been minimized.

Copy link
@vixentael

vixentael Mar 6, 2019

Author Member

Are you confused with any of this change <objcthemis/smessage.h> vs "smessage.h" or only with serror.h?
Because for me it's also a bit weird: this thing is working properly for ObjC, but these headers are "non-modulars" for Swift frameworks.

This comment has been minimized.

Copy link
@ilammy

ilammy Mar 6, 2019

Contributor

All of them, not just serror.h.

I have a feeling that we have to use "serror.h" style here because we copy the headers as a flat list when constructing the framework. I remember seeing in Xcode that all of the files are just dumped into the framework source without preserving the subdirectories. Though, we seem to use this 'subspec' thing of Cocoapods which should group files properly...

This comment has been minimized.

Copy link
@vixentael

vixentael Mar 6, 2019

Author Member

yes, somehow Xcode/Cocoapods don't pay attention on subdirectories, and "umbrella" header also consists of "flat" headers 炉_(銉)_/炉
well, that's what we have here..


#endif /* _OBJCTHEMIS_ */

@@ -20,8 +20,7 @@
*/

#import <Foundation/Foundation.h>
#import <themis/themis.h>
#import <objcthemis/scell.h>
#import "scell.h"

/**
* @addtogroup WRAPPERS
@@ -16,7 +16,7 @@

#import <objcthemis/scell_context_imprint.h>
#import <objcthemis/serror.h>

#import <themis/themis.h>

@implementation TSCellContextImprint

@@ -20,8 +20,7 @@
*/

#import <Foundation/Foundation.h>
#import <themis/themis.h>
#import <objcthemis/scell.h>
#import "scell.h"

/**
* @addtogroup WRAPPERS
@@ -16,7 +16,7 @@

#import <objcthemis/scell_seal.h>
#import <objcthemis/serror.h>

#import <themis/themis.h>

@implementation TSCellSeal

@@ -20,8 +20,7 @@
*/

#import <Foundation/Foundation.h>
#import <themis/themis.h>
#import <objcthemis/scell.h>
#import "scell.h"

/**
* @addtogroup WRAPPERS
@@ -16,7 +16,7 @@

#import <objcthemis/scell_token.h>
#import <objcthemis/serror.h>

#import <themis/themis.h>

@implementation TSCellTokenEncryptedData

@@ -19,7 +19,7 @@
* @brief secure comparator interface
*/

#import <themis/themis.h>
#import <Foundation/Foundation.h>

/**
* @addtogroup WRAPPERS
@@ -16,7 +16,7 @@

#import <objcthemis/scomparator.h>
#import <objcthemis/serror.h>

#import <themis/themis.h>

@interface TSComparator ()

@@ -20,7 +20,6 @@
*/

#import <Foundation/Foundation.h>
#import <themis/themis.h>

/**
* @addtogroup WRAPPERS
@@ -16,7 +16,7 @@

#import <objcthemis/skeygen.h>
#import <objcthemis/serror.h>

#import <themis/themis.h>

@interface TSKeyGen ()

@@ -20,7 +20,6 @@
*/

#import <Foundation/Foundation.h>
#import <themis/themis.h>

/**
* @addtogroup WRAPPERS
@@ -16,7 +16,7 @@

#import <objcthemis/smessage.h>
#import <objcthemis/serror.h>

#import <themis/themis.h>

@interface TSMessage ()

@@ -19,8 +19,7 @@
* @brief secure session interface
*/

#import <objcthemis/ssession_transport_interface.h>
#import <themis/themis.h>
#import "ssession_transport_interface.h"

/**
* @addtogroup WRAPPERS
@@ -16,7 +16,7 @@

#import <objcthemis/ssession.h>
#import <objcthemis/serror.h>

#import <themis/themis.h>

@interface TSSession ()

ProTip! Use n and p to navigate between commits in a pull request.
You can鈥檛 perform that action at this time.