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
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ let package = Package(
platforms: [.iOS(.v13)],
products: [
.library(name: "WalletCore", targets: ["WalletCore"]),
.library(name: "SwiftProtobuf", targets: ["SwiftProtobuf"])
.library(name: "WalletCoreSwiftProtobuf", targets: ["WalletCoreSwiftProtobuf"])
],
dependencies: [],
targets: [
Expand All @@ -16,7 +16,7 @@ let package = Package(
checksum: "651894a9418fdd33ae5374367a6a64a57fa92b6e6ffb2d6723c319da97472cb4"
),
.binaryTarget(
name: "SwiftProtobuf",
name: "WalletCoreSwiftProtobuf",
url: "https://github.com/trustwallet/wallet-core/releases/download/4.2.9/SwiftProtobuf.xcframework.zip",
checksum: "946efd4b0132b92208335902e0b65e0aba2d11b9dd6f6d79cc8318e2530c9ae0"
)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Then add libraries to target's `dependencies`:

```swift
.product(name: "WalletCore", package: "WalletCore"),
.product(name: "SwiftProtobuf", package: "WalletCore"),
.product(name: "WalletCoreSwiftProtobuf", package: "WalletCore"),
```

### CocoaPods
Expand Down
22 changes: 22 additions & 0 deletions WalletCoreSwiftProtobuf.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Original podspec:
# https://github.com/apple/swift-protobuf/blob/main/SwiftProtobuf.podspec
Pod::Spec.new do |s|
s.name = 'WalletCoreSwiftProtobuf'
s.version = '1.29.0'
s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
s.summary = 'Swift Protobuf Runtime Library'
s.homepage = 'https://github.com/apple/swift-protobuf'
s.author = 'Apple Inc.'
s.source = { :git => 'https://github.com/apple/swift-protobuf.git', :tag => s.version }

s.requires_arc = true
s.ios.deployment_target = '11.0'
s.osx.deployment_target = '10.13'

s.cocoapods_version = '>= 1.13.0'

s.source_files = 'Sources/SwiftProtobuf/**/*.swift'
s.resource_bundle = {'WalletCoreSwiftProtobuf' => ['Sources/SwiftProtobuf/PrivacyInfo.xcprivacy']}

s.swift_versions = ['5.0']
end
2 changes: 1 addition & 1 deletion swift/Playground.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import UIKit
import TrustWalletCore
import SwiftProtobuf
import WalletCoreSwiftProtobuf

enum PlaygroundError: Error {
case invalidHexString
Expand Down
2 changes: 1 addition & 1 deletion swift/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ project 'TrustWalletCore.xcodeproj'
target 'WalletCore' do
use_frameworks!

pod 'SwiftProtobuf'
pod 'WalletCoreSwiftProtobuf'

target 'WalletCoreTests'
end
Expand Down
10 changes: 5 additions & 5 deletions swift/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
PODS:
- SwiftProtobuf (1.13.0)
- WalletCoreSwiftProtobuf (1.29.0)

DEPENDENCIES:
- SwiftProtobuf
- WalletCoreSwiftProtobuf

SPEC REPOS:
trunk:
- SwiftProtobuf
- WalletCoreSwiftProtobuf

SPEC CHECKSUMS:
SwiftProtobuf: fd4693388a96c8c2df35d3b063272b0e7c499d00
WalletCoreSwiftProtobuf: a4798576a2d309511fc45f81843d348732ec571d

PODFILE CHECKSUM: aac2324ba35cdd5631cb37618cd483887bab9cfd
PODFILE CHECKSUM: 1112f54f83017d2c0c1d9d4bf5c21f65c5187d0e

COCOAPODS: 1.16.2
6 changes: 3 additions & 3 deletions swift/Sources/AnySigner.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// file LICENSE at the root of the source code distribution tree.

import Foundation
import SwiftProtobuf
import WalletCoreSwiftProtobuf

public typealias SigningInput = Message
public typealias SigningOutput = Message
Expand All @@ -22,7 +22,7 @@ public final class AnySigner {
public static func sign<SigningOutput: Message>(input: SigningInput, coin: CoinType) -> SigningOutput {
do {
let outputData = nativeSign(data: try input.serializedData(), coin: coin)
return try SigningOutput(serializedData: outputData)
return try SigningOutput(serializedBytes: outputData)
} catch let error {
fatalError(error.localizedDescription)
}
Expand Down Expand Up @@ -72,7 +72,7 @@ public final class AnySigner {
public static func plan<TransactionPlan: Message>(input: SigningInput, coin: CoinType) -> TransactionPlan {
do {
let outputData = nativePlan(data: try input.serializedData(), coin: coin)
return try TransactionPlan(serializedData: outputData)
return try TransactionPlan(serializedBytes: outputData)
} catch let error {
fatalError(error.localizedDescription)
}
Expand Down
2 changes: 1 addition & 1 deletion swift/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ platform :ios do
lane :swift_protobuf_xcframework do
create_xcframework(
workspace: 'TrustWalletCore.xcworkspace',
scheme: 'SwiftProtobuf',
scheme: 'WalletCoreSwiftProtobuf',
destinations: ['iOS'],
xcframework_output_directory: 'build',
enable_bitcode: false
Expand Down
3 changes: 3 additions & 0 deletions tools/generate-files
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ tools/doxygen_convert_comments

if [ -x "$(command -v protoc-gen-swift)" ] && isTargetSpecified "ios"; then
"$PROTOC" -I=$PREFIX/include -I=src/proto --cpp_out=src/proto --java_out=lite:jni/proto --swift_out=swift/Sources/Generated/Protobuf --swift_opt=Visibility=Public src/proto/*.proto
# Replace SwiftProtobuf with WalletCoreSwiftProtobuf
find swift/Sources/Generated/Protobuf -name "*.swift" -exec sed -i '' 's/import SwiftProtobuf/import WalletCoreSwiftProtobuf/g' {} \;
find swift/Sources/Generated/Protobuf -name "*.swift" -exec sed -i '' 's/SwiftProtobuf./WalletCoreSwiftProtobuf./g' {} \;
else
"$PROTOC" -I=$PREFIX/include -I=src/proto --cpp_out=src/proto --java_out=lite:jni/proto src/proto/*.proto
fi
Expand Down
2 changes: 1 addition & 1 deletion tools/ios-release
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Pod::Spec.new do |s|
'Sources/Types/*.swift',
'Sources/Generated/Enums/*.swift',
'Sources/Generated/Protobuf/*.swift'
ss.dependency 'SwiftProtobuf'
ss.dependency 'WalletCoreSwiftProtobuf'
end
s.subspec 'Core' do |ss|
ss.vendored_frameworks = '*.xcframework'
Expand Down
2 changes: 1 addition & 1 deletion tools/ios-xcframework
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
#
# This script builds dynamic WalletCore and SwiftProtobuf xcframework for SPM and CocoaPods
# This script builds dynamic WalletCore and WalletCoreSwiftProtobuf xcframework for SPM and CocoaPods
#

set -e
Expand Down
12 changes: 6 additions & 6 deletions tools/ios-xcframework-release
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ pushd ${base_dir}/../swift/build
# archive xcframeworks
core_zip_filename="WalletCore.xcframework.zip"
core_dsyms_filename="WalletCore.xcframework.dSYM.zip"
protobuf_zip_filename="SwiftProtobuf.xcframework.zip"
protobuf_dsyms_filename="SwiftProtobuf.xcframework.dSYM.zip"
protobuf_zip_filename="WalletCoreSwiftProtobuf.xcframework.zip"
protobuf_dsyms_filename="WalletCoreSwiftProtobuf.xcframework.dSYM.zip"

rm -rf ${core_zip_filename} ${core_dsyms_filename} ${protobuf_zip_filename} ${protobuf_dsyms_filename}

Expand All @@ -26,9 +26,9 @@ zip -r ${core_dsyms_filename} WalletCore.dSYMs
zip -r ${core_zip_filename} WalletCore.xcframework
core_hash=$(/usr/bin/shasum -a 256 ${core_zip_filename} | awk '{printf $1}')

zip -r ${protobuf_dsyms_filename} SwiftProtobuf.dSYMs
zip -r ${protobuf_dsyms_filename} WalletCoreSwiftProtobuf.dSYMs

zip -r ${protobuf_zip_filename} SwiftProtobuf.xcframework
zip -r ${protobuf_zip_filename} WalletCoreSwiftProtobuf.xcframework
protobuf_hash=$(/usr/bin/shasum -a 256 ${protobuf_zip_filename} | awk '{printf $1}')

# upload to release
Expand All @@ -52,7 +52,7 @@ let package = Package(
platforms: [.iOS(.v13)],
products: [
.library(name: "WalletCore", targets: ["WalletCore"]),
.library(name: "SwiftProtobuf", targets: ["SwiftProtobuf"])
.library(name: "WalletCoreSwiftProtobuf", targets: ["WalletCoreSwiftProtobuf"])
],
dependencies: [],
targets: [
Expand All @@ -62,7 +62,7 @@ let package = Package(
checksum: "${core_hash}"
),
.binaryTarget(
name: "SwiftProtobuf",
name: "WalletCoreSwiftProtobuf",
url: ${protobuf_download_url},
checksum: "${protobuf_hash}"
)
Expand Down
Loading