-
Notifications
You must be signed in to change notification settings - Fork 40
/
Makefile
92 lines (79 loc) · 3.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
VERSION=`git describe --tags --dirty`
DATE=`date +%FT%T%z`
outdir=out
module=github.com/coming-chat/wallet-SDK
pkgCore = ${module}/core
pkgBase = ${pkgCore}/base
pkgWallet = ${pkgCore}/wallet
pkgPolka = ${pkgCore}/polka
pkgBtc = ${pkgCore}/btc
pkgEth = $(pkgCore)/eth
pkgCosmos = $(pkgCore)/cosmos
pkgDoge = $(pkgCore)/doge
pkgSolana = $(pkgCore)/solana
pkgAptos = $(pkgCore)/aptos
pkgSui = $(pkgCore)/sui
pkgStarcoin = $(pkgCore)/starcoin
pkgStarknet = $(pkgCore)/starknet
pkgMSCheck = ${pkgCore}/multi-signature-check
pkgAll = ${pkgBase} ${pkgWallet} ${pkgPolka} ${pkgBtc} ${pkgEth} ${pkgCosmos} ${pkgMSCheck} ${pkgDoge} ${pkgSolana} ${pkgAptos} ${pkgSui} ${pkgStarcoin} ${pkgStarknet}
# pkgAll = ${module}/ggtest
iosPackageName=Wallet.xcframework
buildAllSDKAndroid:
gomobile bind -ldflags "-s -w" -target=android/arm,android/arm64 -o=${outdir}/wallet.aar ${pkgAll}
buildAllSDKIOS:
GOOS=ios gomobile bind -ldflags "-s -w" -v -target=ios/arm64 -o=${outdir}/${iosPackageName} ${pkgAll}
# If you want to quickly verify some features of the gomobile, you can just package a little file test.
buildIOSBase:
GOOS=ios gomobile bind -ldflags "-s -w" -v -target=ios/arm64 -o=${outdir}/${iosPackageName} ${pkgBase} ${pkgBtc} ${pkgWallet}
# 使用: make packageAll v=1.4
# 结果: out 目录下将产生两个压缩包 wallet-SDK-ios.1.4.zip 和 wallet-SDK-android.1.4.zip
iosZipName=wallet-SDK-ios
andZipName=wallet-SDK-android
packageAll:
# rm -rf ${outdir}/*
@cd ${outdir} && rm -f wallet-SDK-*.zip && rm -rf ${andZipName}.${v}
@make buildAllSDKIOS && make buildAllSDKAndroid
@cd ${outdir} && zip -ry ${iosZipName}.${v}.zip Wallet.xcframework
@cd ${outdir} && mkdir ${andZipName}.${v} && mv -f wallet.aar wallet-sources.jar ${andZipName}.${v}
@cd ${outdir} && zip -ry ${andZipName}.${v}.zip ${andZipName}.${v}
@cd ${outdir} && open .
# 给打包机打包归档用的
# ❯ ssh -T coming@192.168.3.84 << EOF
# ❯ cdsdk_wallet
# ❯ make archiveSDK v=0.0.2
# ❯ EOF
archiveSDK:
@git reset --hard && git clean -id && git checkout -f main && git pull --rebase
@make packageAll ${v}
@cd ${outdir} && rm -rf ${v} && mkdir ${v}
@cd ${outdir} && mv ${andZipName}.${v}.zip ${iosZipName}.${v}.zip ${v}
@cd ${outdir}/${v} && echo `git log -1` > info.md
@cd ${outdir}/${v} && echo "\n归档时间: " >> info.md
@cd ${outdir}/${v} && echo `date +%FT%T%z` >> info.md
@say '归档完成'
iosReposity=${outdir}/Wallet-iOS
iosCopySdk:
@cd ${iosReposity} \
&& rm -rf Sources/* \
&& cp -Rf ../${iosPackageName} Sources \
&& cp -Rf ../${iosPackageName}/ios-arm64/Wallet.framework/Versions/A/Headers Sources
iosPublishVersion:
ifndef v
@echo 发布 iOS 包需要指定一个版本,例如 make publishIOSVersion v=1.0.1
@exit 1
endif
@make iosCopySdk
@cd ${iosReposity} \
&& git add --all \
&& git commit -m 'Auto Publish ${v}' -m "refer to `git rev-parse HEAD`" \
&& git tag -f ${v} \
&& git push origin main tag ${v} --force
@make iosPublishMain
iosPublishMain:
@make iosCopySdk
@cd ${iosReposity} \
&& rm -rf Sources/Wallet.xcframework/ios-arm64_x86_64-simulator \
&& git add --all \
&& git commit -m 'Auto Publish Develop SDK' \
&& git push origin main