Skip to content

Commit cb2a527

Browse files
committed
Rename dependency SwiftProtobuf to TWSwiftProtobuf
1 parent eb3f6a4 commit cb2a527

File tree

8 files changed

+44
-17
lines changed

8 files changed

+44
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Then add libraries to target's `dependencies`:
7373

7474
```swift
7575
.product(name: "WalletCore", package: "WalletCore"),
76-
.product(name: "SwiftProtobuf", package: "WalletCore"),
76+
.product(name: "TWSwiftProtobuf", package: "WalletCore"),
7777
```
7878

7979
### CocoaPods

swift/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ project 'TrustWalletCore.xcodeproj'
99
target 'WalletCore' do
1010
use_frameworks!
1111

12-
pod 'SwiftProtobuf'
12+
pod 'TWSwiftProtobuf', podspec: 'TWSwiftProtobuf.podspec'
1313

1414
target 'WalletCoreTests'
1515
end

swift/Podfile.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
PODS:
2-
- SwiftProtobuf (1.13.0)
2+
- TWSwiftProtobuf (1.28.2)
33

44
DEPENDENCIES:
5-
- SwiftProtobuf
5+
- TWSwiftProtobuf (from `TWSwiftProtobuf.podspec`)
66

7-
SPEC REPOS:
8-
trunk:
9-
- SwiftProtobuf
7+
EXTERNAL SOURCES:
8+
TWSwiftProtobuf:
9+
:podspec: TWSwiftProtobuf.podspec
1010

1111
SPEC CHECKSUMS:
12-
SwiftProtobuf: fd4693388a96c8c2df35d3b063272b0e7c499d00
12+
TWSwiftProtobuf: 6ce3d3b3899a76ae9219a87d3e980a896bbf0f6b
1313

14-
PODFILE CHECKSUM: aac2324ba35cdd5631cb37618cd483887bab9cfd
14+
PODFILE CHECKSUM: 3f07a34852b9957137f600a69cfb61f90652ddd9
1515

1616
COCOAPODS: 1.16.2

swift/Sources/AnySigner.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// file LICENSE at the root of the source code distribution tree.
66

77
import Foundation
8-
import SwiftProtobuf
8+
import TWSwiftProtobuf
99

1010
public typealias SigningInput = Message
1111
public typealias SigningOutput = Message

swift/TWSwiftProtobuf.podspec

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Original podspec:
2+
# https://github.com/apple/swift-protobuf/blob/main/SwiftProtobuf.podspec
3+
Pod::Spec.new do |s|
4+
s.name = 'TWSwiftProtobuf'
5+
s.version = '1.28.2'
6+
s.license = { :type => 'Apache 2.0', :file => 'LICENSE.txt' }
7+
s.summary = 'Swift Protobuf Runtime Library'
8+
s.homepage = 'https://github.com/apple/swift-protobuf'
9+
s.author = 'Apple Inc.'
10+
s.source = { :git => 'https://github.com/apple/swift-protobuf.git', :tag => s.version }
11+
12+
s.requires_arc = true
13+
s.ios.deployment_target = '11.0'
14+
s.osx.deployment_target = '10.13'
15+
s.tvos.deployment_target = '11.0'
16+
s.watchos.deployment_target = '4.0'
17+
18+
s.cocoapods_version = '>= 1.7.0'
19+
20+
s.source_files = 'Sources/SwiftProtobuf/**/*.swift'
21+
s.resource_bundle = {'TWSwiftProtobuf' => ['Sources/SwiftProtobuf/PrivacyInfo.xcprivacy']}
22+
23+
s.swift_versions = ['5.0']
24+
end

swift/fastlane/Fastfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ platform :ios do
2323
lane :swift_protobuf_xcframework do
2424
create_xcframework(
2525
workspace: 'TrustWalletCore.xcworkspace',
26-
scheme: 'SwiftProtobuf',
26+
scheme: 'TWSwiftProtobuf',
2727
destinations: ['iOS'],
2828
xcframework_output_directory: 'build',
2929
enable_bitcode: false

tools/generate-files

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ tools/rust-bindgen "$@"
6969

7070
if [ -x "$(command -v protoc-gen-swift)" ] && isTargetSpecified "ios"; then
7171
"$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
72+
# Replace SwiftProtobuf with TWSwiftProtobuf
73+
find swift/Sources/Generated/Protobuf -name "*.swift" -exec sed -i '' 's/import SwiftProtobuf/import TWSwiftProtobuf/g' {} \;
74+
find swift/Sources/Generated/Protobuf -name "*.swift" -exec sed -i '' 's/SwiftProtobuf./TWSwiftProtobuf./g' {} \;
7275
else
7376
"$PROTOC" -I=$PREFIX/include -I=src/proto --cpp_out=src/proto --java_out=lite:jni/proto src/proto/*.proto
7477
fi

tools/ios-xcframework-release

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ pushd ${base_dir}/../swift/build
1818
# archive xcframeworks
1919
core_zip_filename="WalletCore.xcframework.zip"
2020
core_dsyms_filename="WalletCore.xcframework.dSYM.zip"
21-
protobuf_zip_filename="SwiftProtobuf.xcframework.zip"
22-
protobuf_dsyms_filename="SwiftProtobuf.xcframework.dSYM.zip"
21+
protobuf_zip_filename="TWSwiftProtobuf.xcframework.zip"
22+
protobuf_dsyms_filename="TWSwiftProtobuf.xcframework.dSYM.zip"
2323

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

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

31-
zip -r ${protobuf_dsyms_filename} SwiftProtobuf.dSYMs
31+
zip -r ${protobuf_dsyms_filename} TWSwiftProtobuf.dSYMs
3232

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

3636
# upload to release
@@ -52,7 +52,7 @@ let package = Package(
5252
platforms: [.iOS(.v13)],
5353
products: [
5454
.library(name: "WalletCore", targets: ["WalletCore"]),
55-
.library(name: "SwiftProtobuf", targets: ["SwiftProtobuf"])
55+
.library(name: "TWSwiftProtobuf", targets: ["TWSwiftProtobuf"])
5656
],
5757
dependencies: [],
5858
targets: [
@@ -62,7 +62,7 @@ let package = Package(
6262
checksum: "${core_hash}"
6363
),
6464
.binaryTarget(
65-
name: "SwiftProtobuf",
65+
name: "TWSwiftProtobuf",
6666
url: ${protobuf_download_url},
6767
checksum: "${protobuf_hash}"
6868
)

0 commit comments

Comments
 (0)