-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add SPM support with XCF #789
Merged
Merged
Changes from 1 commit
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8bb38e1
add SPM support with XCF
julepka 42d29fd
add swift SPM test project
julepka f7c8b8d
add macOS swift SPM example, updated iOS one
julepka ef2db35
updates per pr comments
julepka d2967bf
Merge branch 'master' into spm-xcf-support
julepka f81f9e8
removed cl-openssl from Themis.xcodeproj + edits per pr comments + ex…
julepka acd55c6
removed example projects
julepka 7f1bfd3
updated xcodeproj version
julepka 5b3f333
updated Package.swift
julepka 055dd49
updated changelog
julepka 3bcd864
Update CHANGELOG.md
julepka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// swift-tools-version:5.3 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "themis", | ||
products: [ | ||
.library( | ||
name: "themis", | ||
targets: ["themis"]), | ||
], | ||
dependencies: [], | ||
targets: [ | ||
// Targets are the basic building blocks of a package. A target can define a module or a test suite. | ||
// Targets can depend on other targets in this package, and on products in packages this package depends on. | ||
ilammy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.binaryTarget(name: "themis", | ||
url: "https://github.com/julepka/themis/releases/download/2.2.1/themis.xcframework.zip", | ||
// $swift package compute-checksum output/themis.xcframework.zip | ||
checksum: "b4a8d8868cbd09499d75a10315d1231281d40dee11d1fe549cf4893967f3ee38"), | ||
|
||
] | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -3,10 +3,12 @@ | |||||
archiveVersion = 1; | ||||||
classes = { | ||||||
}; | ||||||
objectVersion = 50; | ||||||
objectVersion = 52; | ||||||
objects = { | ||||||
|
||||||
/* Begin PBXBuildFile section */ | ||||||
6D0A527E25FA2E7000C49E55 /* cl-openssl in Frameworks */ = {isa = PBXBuildFile; productRef = 6D0A527D25FA2E7000C49E55 /* cl-openssl */; }; | ||||||
6D0A528025FA2E8300C49E55 /* cl-openssl in Frameworks */ = {isa = PBXBuildFile; productRef = 6D0A527F25FA2E8300C49E55 /* cl-openssl */; }; | ||||||
9F00E8E2223C1A3300EC1EF3 /* objcthemis.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F4A24B5223A8FA8005CB63A /* objcthemis.h */; settings = {ATTRIBUTES = (Public, ); }; }; | ||||||
9F00E8E3223C1A3300EC1EF3 /* scell_context_imprint.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F4A24B9223A8FA8005CB63A /* scell_context_imprint.h */; settings = {ATTRIBUTES = (Public, ); }; }; | ||||||
9F00E8E4223C1A3300EC1EF3 /* scell_seal.h in Headers */ = {isa = PBXBuildFile; fileRef = 9F4A24BC223A8FA8005CB63A /* scell_seal.h */; settings = {ATTRIBUTES = (Public, ); }; }; | ||||||
|
@@ -519,6 +521,7 @@ | |||||
isa = PBXFrameworksBuildPhase; | ||||||
buildActionMask = 2147483647; | ||||||
files = ( | ||||||
6D0A528025FA2E8300C49E55 /* cl-openssl in Frameworks */, | ||||||
9F00E941223C1AFA00EC1EF3 /* openssl.framework in Frameworks */, | ||||||
); | ||||||
runOnlyForDeploymentPostprocessing = 0; | ||||||
|
@@ -527,6 +530,7 @@ | |||||
isa = PBXFrameworksBuildPhase; | ||||||
buildActionMask = 2147483647; | ||||||
files = ( | ||||||
6D0A527E25FA2E7000C49E55 /* cl-openssl in Frameworks */, | ||||||
9FBD853D223BFB5E009EAEB3 /* openssl.framework in Frameworks */, | ||||||
); | ||||||
runOnlyForDeploymentPostprocessing = 0; | ||||||
|
@@ -947,6 +951,9 @@ | |||||
dependencies = ( | ||||||
); | ||||||
name = "Themis (macOS)"; | ||||||
packageProductDependencies = ( | ||||||
6D0A527F25FA2E8300C49E55 /* cl-openssl */, | ||||||
); | ||||||
productName = "Themis (macOS)"; | ||||||
productReference = 9F00E8D7223C197900EC1EF3 /* themis.framework */; | ||||||
productType = "com.apple.product-type.framework"; | ||||||
|
@@ -964,6 +971,9 @@ | |||||
dependencies = ( | ||||||
); | ||||||
name = "Themis (iOS)"; | ||||||
packageProductDependencies = ( | ||||||
6D0A527D25FA2E7000C49E55 /* cl-openssl */, | ||||||
); | ||||||
productName = Themis; | ||||||
productReference = 9F4A24A1223A8D7F005CB63A /* themis.framework */; | ||||||
productType = "com.apple.product-type.framework"; | ||||||
|
@@ -1077,6 +1087,9 @@ | |||||
Base, | ||||||
); | ||||||
mainGroup = 738B81052239809D00A9947C; | ||||||
packageReferences = ( | ||||||
6D0A527C25FA2E7000C49E55 /* XCRemoteSwiftPackageReference "openssl-apple" */, | ||||||
); | ||||||
productRefGroup = 738B81102239809D00A9947C /* Products */; | ||||||
projectDirPath = ""; | ||||||
projectRoot = ""; | ||||||
|
@@ -1874,6 +1887,30 @@ | |||||
defaultConfigurationName = Release; | ||||||
}; | ||||||
/* End XCConfigurationList section */ | ||||||
|
||||||
/* Begin XCRemoteSwiftPackageReference section */ | ||||||
6D0A527C25FA2E7000C49E55 /* XCRemoteSwiftPackageReference "openssl-apple" */ = { | ||||||
isa = XCRemoteSwiftPackageReference; | ||||||
repositoryURL = "https://github.com/julepka/openssl-apple"; | ||||||
requirement = { | ||||||
kind = upToNextMajorVersion; | ||||||
ilammy marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
minimumVersion = 1.1.1080202; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
TODO: re-define version after merging cossacklabs/openssl-apple#22 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, and the link will point to the cosacklabs repo. |
||||||
}; | ||||||
}; | ||||||
/* End XCRemoteSwiftPackageReference section */ | ||||||
|
||||||
/* Begin XCSwiftPackageProductDependency section */ | ||||||
6D0A527D25FA2E7000C49E55 /* cl-openssl */ = { | ||||||
isa = XCSwiftPackageProductDependency; | ||||||
package = 6D0A527C25FA2E7000C49E55 /* XCRemoteSwiftPackageReference "openssl-apple" */; | ||||||
productName = "cl-openssl"; | ||||||
}; | ||||||
6D0A527F25FA2E8300C49E55 /* cl-openssl */ = { | ||||||
isa = XCSwiftPackageProductDependency; | ||||||
package = 6D0A527C25FA2E7000C49E55 /* XCRemoteSwiftPackageReference "openssl-apple" */; | ||||||
productName = "cl-openssl"; | ||||||
}; | ||||||
/* End XCSwiftPackageProductDependency section */ | ||||||
}; | ||||||
rootObject = 738B81062239809D00A9947C /* Project object */; | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
mkdir output | ||
mkdir output/archives | ||
mkdir output/iphoneos | ||
mkdir output/macosx | ||
ilammy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
xcodebuild archive \ | ||
-scheme "Themis (iOS)" \ | ||
-destination="iOS" \ | ||
-archivePath output/archives/ios.xcarchive \ | ||
-derivedDataPath output/iphoneos \ | ||
-sdk iphoneos \ | ||
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | ||
ilammy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
xcodebuild archive \ | ||
-scheme "Themis (iOS)" \ | ||
-destination="iOS Simulator" \ | ||
-archivePath output/archives/iossimulator.xcarchive \ | ||
-derivedDataPath output/iphoneos \ | ||
-sdk iphonesimulator \ | ||
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | ||
|
||
xcodebuild archive \ | ||
-scheme "Themis (macOS)" \ | ||
-destination="macOS" \ | ||
-archivePath output/archives/macosx.xcarchive \ | ||
-derivedDataPath output/macosx \ | ||
-sdk macosx \ | ||
SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES | ||
|
||
xcodebuild -create-xcframework \ | ||
-framework output/archives/ios.xcarchive/Products/Library/Frameworks/themis.framework \ | ||
-framework output/archives/iossimulator.xcarchive/Products/Library/Frameworks/themis.framework \ | ||
-framework output/archives/macosx.xcarchive/Products/Library/Frameworks/themis.framework \ | ||
-output output/themis.xcframework | ||
|
||
rm -rf output/archives | ||
rm -rf output/iphoneos | ||
rm -rf output/macosx | ||
|
||
cd output | ||
zip -r themis.xcframework.zip themis.xcframework | ||
|
||
rm -rf themis.xcframework | ||
|
||
cd .. | ||
echo "XCF Chechsum:" | ||
ilammy marked this conversation as resolved.
Show resolved
Hide resolved
|
||
swift package compute-checksum output/themis.xcframework.zip |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
At first I wanted to ask, “Where is
cl-openssl
?“ But then I realized that it's not here because themis.xcframework will be statically linked to openssl.xcframework, hence users of themis.xcframework don't need to install shared OpenSSL.