Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let tag = "v0.1.0"
let checksum = "fd9eb84a478402af8f790519a463b6e1bf6ab3987f5951cd8375afb9d39e7a4b"
let url = "https://github.com/synonymdev/bitkit-core/releases/download/\(tag)/BitkitCore.xcframework.zip"

let package = Package(
name: "bitkitcore",
platforms: [
.iOS(.v15),
.macOS(.v12),
],
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "BitkitCore",
targets: ["BitkitCoreFFI", "BitkitCore"]),
],
targets: [
.target(
name: "BitkitCore",
dependencies: ["BitkitCoreFFI"],
path: "./bindings/ios",
sources: ["bitkitcore.swift"]
),
.binaryTarget(
name: "BitkitCoreFFI",
url: url,
checksum: checksum
)
]
)
13 changes: 12 additions & 1 deletion build_ios.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,15 @@ echo "Cleaning up temporary directories..."
rm -rf "bindings/ios/ios-arm64"
rm -rf "bindings/ios/ios-arm64-sim"

echo "iOS build process completed successfully!"
# Create zip file for distribution and checksum calculation
echo "Creating XCFramework zip file..."
rm -f ./bindings/ios/BitkitCore.xcframework.zip
ditto -c -k --sequesterRsrc --keepParent ./bindings/ios/BitkitCore.xcframework ./bindings/ios/BitkitCore.xcframework.zip || { echo "Failed to create zip file"; exit 1; }

# Compute checksum
echo "Computing checksum..."
CHECKSUM=`swift package compute-checksum ./bindings/ios/BitkitCore.xcframework.zip` || { echo "Failed to compute checksum"; exit 1; }
echo "New checksum: $CHECKSUM"

echo "iOS build process completed successfully!"
echo "Update Package.swift with the new checksum: $CHECKSUM"