Skip to content

Commit

Permalink
Fix gomobile compatibility issues
Browse files Browse the repository at this point in the history
  • Loading branch information
iheron committed Aug 14, 2024
1 parent d6c0fde commit 9cc4fb4
Show file tree
Hide file tree
Showing 45 changed files with 159 additions and 6,582 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.2

* Fix gomobile compatibility issues

## 0.6.1

* Add programHash
Expand Down
22 changes: 22 additions & 0 deletions example/ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
/* Begin PBXFileReference section */
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
14A167AB2C69DE92005921C5 /* libresolv.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.tbd; path = usr/lib/libresolv.tbd; sourceTree = SDKROOT; };
14A167AC2C69E141005921C5 /* libresolv.9.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libresolv.9.tbd; path = usr/lib/libresolv.9.tbd; sourceTree = SDKROOT; };
184D8418A5FA039F4B6CBB09 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -74,6 +76,8 @@
6C8FFAAB026B32956DB9C5F0 /* Frameworks */ = {
isa = PBXGroup;
children = (
14A167AC2C69E141005921C5 /* libresolv.9.tbd */,
14A167AB2C69DE92005921C5 /* libresolv.tbd */,
921B9507EB298CF15D4D586D /* Pods_Runner.framework */,
);
name = Frameworks;
Expand Down Expand Up @@ -376,6 +380,12 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-framework",
"\"nkn_sdk_flutter\"",
);
PRODUCT_BUNDLE_IDENTIFIER = org.nkn.sdk;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -517,6 +527,12 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-framework",
"\"nkn_sdk_flutter\"",
);
PRODUCT_BUNDLE_IDENTIFIER = org.nkn.sdk;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -550,6 +566,12 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-framework",
"\"nkn_sdk_flutter\"",
);
PRODUCT_BUNDLE_IDENTIFIER = org.nkn.sdk;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
4 changes: 2 additions & 2 deletions golib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ ANDROID_ARTIFACT=$(ANDROID_BUILDDIR)/nkn.aar
IOS_BUILDDIR=$(BUILDDIR)/ios
IOS_ARTIFACT=$(IOS_BUILDDIR)/Nkn.xcframework

BUILD_PACKAGE=./ ./crypto github.com/nknorg/nkn-sdk-go github.com/nknorg/ncp-go github.com/nknorg/nkn/v2/transaction github.com/nknorg/nkngomobile github.com/nknorg/eth-resolver-go github.com/nknorg/dns-resolver-go
BUILD_PACKAGE=./ ./crypto github.com/nknorg/nkn-sdk-go github.com/nknorg/ncp-go github.com/nknorg/nkn/v2/transaction github.com/nknorg/nkngomobile github.com/nknorg/dns-resolver-go
ANDROID_BUILD_CMD="$(GOBIND) -ldflags $(ANDROID_LDFLAGS) -target=android -androidapi=21 -o $(ANDROID_ARTIFACT) $(BUILD_PACKAGE)"
IOS_BUILD_CMD="$(GOBIND) -ldflags $(LDFLAGS) -target=ios -tags=netgo -o $(IOS_ARTIFACT) $(BUILD_PACKAGE)"
IOS_BUILD_CMD="$(GOBIND) -ldflags $(LDFLAGS) -target=ios -o $(IOS_ARTIFACT) $(BUILD_PACKAGE)"


define build
Expand Down
83 changes: 27 additions & 56 deletions golib/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,81 +2,52 @@ module nkngolib

go 1.22.0

toolchain go1.22.2
toolchain go1.22.6

require (
github.com/nknorg/dns-resolver-go v0.0.0-20230404043755-e50d32d9043a
github.com/nknorg/eth-resolver-go v0.0.0-20230404061427-d0bd773f899f
github.com/nknorg/nkn-sdk-go v1.4.9-0.20240725072249-776f5f4fa62f
github.com/nknorg/nkn/v2 v2.2.2-0.20240715231955-c2862f2d9d16
github.com/nknorg/nkngomobile v0.0.0-20220615081414-671ad1afdfa9
golang.org/x/mobile v0.0.0-20240716161057-1ad2df20a8b6
github.com/pion/webrtc/v4 v4.0.0-beta.17
golang.org/x/mobile v0.0.0-20230301163155-e0f57694e12c
)

require (
github.com/btcsuite/btcd v0.22.0-beta // indirect
github.com/deckarep/golang-set v1.8.0 // indirect
github.com/ethereum/go-ethereum v1.10.15 // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-stack/stack v1.8.1 // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/ipfs/go-cid v0.4.0 // indirect
github.com/itchyny/base58-go v0.2.2 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-multierror v1.0.0 // indirect
github.com/imdario/mergo v0.3.15 // indirect
github.com/itchyny/base58-go v0.0.5 // indirect
github.com/jbenet/go-is-domain v1.0.5 // indirect
github.com/klauspost/cpuid/v2 v2.2.4 // indirect
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multihash v0.2.1 // indirect
github.com/multiformats/go-varint v0.0.7 // indirect
github.com/nknorg/ncp-go v1.0.6 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pbnjay/memory v0.0.0-20210728143218-7b4eea64cf58 // indirect
github.com/pborman/uuid v1.2.1 // indirect
github.com/pion/datachannel v1.5.8 // indirect
github.com/pion/dtls/v2 v2.2.12 // indirect
github.com/pion/dtls/v3 v3.0.0 // indirect
github.com/pion/ice/v3 v3.0.13 // indirect
github.com/pbnjay/memory v0.0.0-20190104145345-974d429e7ae4 // indirect
github.com/pborman/uuid v1.2.0 // indirect
github.com/pion/datachannel v1.5.6 // indirect
github.com/pion/dtls/v2 v2.2.10 // indirect
github.com/pion/ice/v3 v3.0.6 // indirect
github.com/pion/interceptor v0.1.29 // indirect
github.com/pion/logging v0.2.2 // indirect
github.com/pion/mdns/v2 v2.0.7 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/rtcp v1.2.14 // indirect
github.com/pion/rtp v1.8.7 // indirect
github.com/pion/sctp v1.8.19 // indirect
github.com/pion/rtp v1.8.5 // indirect
github.com/pion/sctp v1.8.16 // indirect
github.com/pion/sdp/v3 v3.0.9 // indirect
github.com/pion/srtp/v3 v3.0.3 // indirect
github.com/pion/srtp/v3 v3.0.1 // indirect
github.com/pion/stun/v2 v2.0.0 // indirect
github.com/pion/transport/v2 v2.2.9 // indirect
github.com/pion/transport/v3 v3.0.6 // indirect
github.com/pion/turn/v3 v3.0.3 // indirect
github.com/pion/webrtc/v4 v4.0.0-beta.26 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/rjeczalik/notify v0.9.3 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/tklauser/go-sysconf v0.3.11 // indirect
github.com/tklauser/numcpus v0.6.0 // indirect
github.com/wealdtech/go-ens/v3 v3.5.4 // indirect
github.com/wealdtech/go-multicodec v1.4.0 // indirect
github.com/wlynxg/anet v0.0.3 // indirect
github.com/yusufpapurcu/wmi v1.2.2 // indirect
golang.org/x/crypto v0.25.0 // indirect
golang.org/x/mod v0.19.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.23.0 // indirect
github.com/pion/transport/v2 v2.2.4 // indirect
github.com/pion/transport/v3 v3.0.2 // indirect
github.com/pion/turn/v3 v3.0.2 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.23.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.6.0 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect
lukechampine.com/blake3 v1.1.7 // indirect
)
Loading

0 comments on commit 9cc4fb4

Please sign in to comment.