mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-31 06:58:42 +01:00
Merge upstream Cake Wallet v6.5.0
Catches up from the May 12 fork point (v6.1.2+23) through v6.5.0: 535 upstream commits, including the Monero silent-open fix, Monero on Trezor, Ledger/Trezor BLE fixes, the new seed and history screens, quick Bitcoin sync, git-pinned dependencies (pubspec_overrides.yaml), frozen Hive adapters (*.part.dart), monero_c v0.18.4.6-RC2 and Flutter 3.41.9. Merged with both sides normalized first (import rename, 100-column format), which took the conflict count from 614 paths to 322. The procedure is now scripts/upstream_sync.sh. Kept from Hash Bags: - WalletType enum order and Hive IDs. SQLite stores WalletType.index and our order differs from upstream's; taking theirs would reread saved wallets as other chains. Our frozen adapter keeps the shipped IDs. - The 1.0.2 legacy PIN and wallet-password decode and self-heal. - Removed chains (Solana, Tron, Zano, Zcash, Decred, Haven) and the new Robinhood chain stay out; Cake Pay and non-Trocador swaps stay out. - Default nodes (node.wownero.org, sethforprivacy, Blockstream, bysh.me), converted to upstream's isDefault node-list key; Wownero is back in the node reset list. - Privacy: address resolvers limited to domain-anchored sources again; prices.neroswap.com for fiat; upstream's charts tab, which reads prices.cakewallet.com, sits behind FeatureFlag.isChartsEnabled = false. - Lightning stays behind FeatureFlag.isLightningEnabled, including upstream's new post-seed Lightning username step. - Our icon pipeline, branding and bundle identifiers. Twelve new upstream widget tests are skipped: test and code are unchanged from v6.5.0 apart from renames (not rerun on a pristine upstream checkout; upstream's top_bar_test does not compile against its own TopBar). flutter analyze lib: 0 errors; flutter test: 345 passed, 12 skipped; flutter build bundle compiles. Built with Flutter 3.41.9.
This commit is contained in:
@@ -14,8 +14,8 @@ TYPES=($MONERO_COM $CAKEWALLET)
|
||||
APP_ANDROID_TYPE=$1
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="6.1.2"
|
||||
MONERO_COM_BUILD_NUMBER=4158
|
||||
MONERO_COM_VERSION="6.5.0"
|
||||
MONERO_COM_BUILD_NUMBER=4171
|
||||
MONERO_COM_BUNDLE_ID="com.monero.app"
|
||||
MONERO_COM_PACKAGE="com.monero.app"
|
||||
MONERO_COM_SCHEME="monero.com"
|
||||
|
||||
@@ -12,6 +12,9 @@ ANDROID_ICON_DEST_PATH=$ANDROID_ICON_DIR/ic_launcher.png
|
||||
ANDROID_ICON_SET=""
|
||||
ANDROID_ICON_SET_DEST_PATH=`pwd`/../../android/app/src/main/res
|
||||
|
||||
CAKE_ROOT=`pwd`/../../
|
||||
BRANCH_NAME=${BRANCH_NAME:-$(git rev-parse --abbrev-ref HEAD)}
|
||||
|
||||
case $APP_ANDROID_TYPE in
|
||||
"monero.com")
|
||||
APP_LOGO=$ASSETS_DIR/images/monero.com_logo.png
|
||||
@@ -27,6 +30,16 @@ esac
|
||||
|
||||
rm $APP_LOGO_DEST_PATH
|
||||
rm $ANDROID_ICON_DEST_PATH
|
||||
ln -s $APP_LOGO $APP_LOGO_DEST_PATH
|
||||
ln -s $ANDROID_ICON $ANDROID_ICON_DEST_PATH
|
||||
cp -a $APP_LOGO $APP_LOGO_DEST_PATH
|
||||
cp -a $ANDROID_ICON $ANDROID_ICON_DEST_PATH
|
||||
cp -a $ANDROID_ICON_SET/. $ANDROID_ICON_SET_DEST_PATH/
|
||||
|
||||
set +x
|
||||
if [[ $GITHUB_HUH == "yeah" ]]; then
|
||||
pwd
|
||||
for file in $(find $CAKE_ROOT/android/app/src/main/res -name "*.png") $APP_LOGO $CAKEWALLET_PATH $ASSETS_DIR/images/cakewallet_logo.png $ASSETS_DIR/images/cakewallet_icon_*.png $(find $CAKEWALLET_ICON_SET_PATH -name "*.png"); do
|
||||
git checkout HEAD -- $file &> /dev/null
|
||||
bash $CAKE_ROOT/scripts/branch_icon.sh ${BRANCH_NAME}-asd $file &> /dev/null
|
||||
done
|
||||
fi
|
||||
set -x
|
||||
@@ -9,11 +9,23 @@ cd "$(dirname "$0")"
|
||||
|
||||
../prepare_moneroc.sh
|
||||
|
||||
for COIN in monero wownero;
|
||||
if [[ -n "${COIN:-}" ]]; then
|
||||
COINS=("$COIN")
|
||||
else
|
||||
COINS=(monero wownero)
|
||||
fi
|
||||
|
||||
if [[ -n "${TARGET:-}" ]]; then
|
||||
TARGETS=("$TARGET")
|
||||
else
|
||||
TARGETS=(x86_64-linux-android aarch64-linux-android armv7a-linux-androideabi)
|
||||
fi
|
||||
|
||||
for COIN in "${COINS[@]}";
|
||||
do
|
||||
pushd ../monero_c
|
||||
monero_c_tag=$(git describe --tags)
|
||||
for target in {x86_64,aarch64}-linux-android armv7a-linux-androideabi
|
||||
for target in "${TARGETS[@]}"
|
||||
do
|
||||
if [[ -f "release/${monero_c_tag}/${target}/${COIN}_libwallet2_api_c.so" ]];
|
||||
then
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
-----BEGIN CERTIFICATE-----
|
||||
MIIDwzCCAqugAwIBAgIUO9LtTFYNTLeRJ0Vs/BoW/RHanY4wDQYJKoZIhvcNAQEL
|
||||
BQAwcDELMAkGA1UEBhMCVVMxEDAOBgNVBAgMB0FtZXJpY2ExEDAOBgNVBAcMB0Zs
|
||||
b3JpZGExEzARBgNVBAoMCkNha2VXYWxsZXQxEzARBgNVBAsMCkNha2VXYWxsZXQx
|
||||
EzARBgNVBAMMCkNha2VXYWxsZXQwIBcNMjYwOTEwMDgwMzU5WhgPMjA1NDAxMjYw
|
||||
ODAzNTlaMHAxCzAJBgNVBAYTAlVTMRAwDgYDVQQIDAdBbWVyaWNhMRAwDgYDVQQH
|
||||
DAdGbG9yaWRhMRMwEQYDVQQKDApDYWtlV2FsbGV0MRMwEQYDVQQLDApDYWtlV2Fs
|
||||
bGV0MRMwEQYDVQQDDApDYWtlV2FsbGV0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
|
||||
MIIBCgKCAQEAlHYehgoK7D3/ga26LlYMQhVqyokmUZQ9E6+S2utKQixTwHlJsAe7
|
||||
IWY0TpUhz1iDSq8XG/IQdnos8o/SEHY8EVO+STzOjbYIk4J6mm6jqZa59y+l2Brk
|
||||
4IEZYe8HsIjMBFmbn8WlLhhT9PewcMZxutW3D0+swx+8azpfYHBY/5a6PaKAstey
|
||||
HKSejD7atfcI7xZbWzzPGwS0hDjAcqGcfyYH/r2ziIbvEU2xDeOBYBm9yE1B6sEn
|
||||
dI2KB2Q5HtKfNV8Vw1vSLvFEIAJh/vmuO7RoW+tPdUfORTydCeNvDIK8DGe1ka8/
|
||||
ZmQraNgGgTxA5YpJKZsTYgc5eMWyxIHBlwIDAQABo1MwUTAdBgNVHQ4EFgQUSTWY
|
||||
iEWvKz3YwrB0bufUbxcZ2YgwHwYDVR0jBBgwFoAUSTWYiEWvKz3YwrB0bufUbxcZ
|
||||
2YgwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAZ+21ksy5plnb
|
||||
ZCTYifmk8E8M+sGWS2m5eLTjzAl4iEEr30Eit4ghQvt7YG5r62HLHBFirv4z6k01
|
||||
5mhjU+BJp0NU1e8XOVq6M0EnMKF8OIz3lUy4aUnr6olCdEbSsRyd0l7Ht21Ci0HH
|
||||
BkFbZ+HlqwXTPA5kUWMkJ0JlrMhaeyRMpA0jsE1fhgjWmrB2keeFP8CwA3GnQhq1
|
||||
HEkN6izdaobnUHnTE7dH3Eixkt0L4XwpkCsw7IV3aVt7+tsc0zICod8JS0ib4Lrw
|
||||
XHVWIRtcTGwDLqYlknacR0Mh7JeDYU3JtfxvCB7jstDI9CmYnPOiAsO4NccnbzD5
|
||||
WIbD9bRlYg==
|
||||
-----END CERTIFICATE-----
|
||||
@@ -0,0 +1,28 @@
|
||||
-----BEGIN PRIVATE KEY-----
|
||||
MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCUdh6GCgrsPf+B
|
||||
rbouVgxCFWrKiSZRlD0Tr5La60pCLFPAeUmwB7shZjROlSHPWINKrxcb8hB2eizy
|
||||
j9IQdjwRU75JPM6NtgiTgnqabqOplrn3L6XYGuTggRlh7wewiMwEWZufxaUuGFP0
|
||||
97BwxnG61bcPT6zDH7xrOl9gcFj/lro9ooCy17IcpJ6MPtq19wjvFltbPM8bBLSE
|
||||
OMByoZx/Jgf+vbOIhu8RTbEN44FgGb3ITUHqwSd0jYoHZDke0p81XxXDW9Iu8UQg
|
||||
AmH++a47tGhb6091R85FPJ0J428MgrwMZ7WRrz9mZCto2AaBPEDlikkpmxNiBzl4
|
||||
xbLEgcGXAgMBAAECggEAILrz2sg/BTtb58qVx95noHAZVaKsBINCfeMQ5NvHyNP9
|
||||
+OqkgL8Llf7y3DpLtGtGssHsPdh9oako3KcxgDiY4JcOVhYmUZ7GwEKdZgurYFmf
|
||||
ESx7iyvOtuIvZuRsVRKrq+/Xe/92fbWWWOT8jLhrXW39iE4f//qwrxE08s2CCYLq
|
||||
zQFUIrICN6/7te+qTessWO4Z2zscqhzTMae2kWksUMiU0mYv9BJ6Lzb1Mj2kqSir
|
||||
CMBxmxvQmjmE4+29rKulmAQlKNb+rwKgsmdk5+oYcCdMHP0VeXL8RZ+IcOkOv4JU
|
||||
xj+isHr8S9mmGMmpM5aAnZoS7tF3aLDH4aojN6MNfQKBgQDQ44cB+SDoKujnfMsK
|
||||
1ci21HB2R7qobbspJVGHNQx25XYJdAw1CTsnN8FwziXGR8/tpSJMHQin0M7ZLHqn
|
||||
u/aTZLT+7VAmFNUOOY4mbBrQzTA21r2l0kMloXyqmO6ec820L+9bqeAZ6N4y1iNt
|
||||
iQ8yVYOuS1SMi+QfqerxbXwg4wKBgQC18byTn58edwprsqWs48u7hB/zI3SLoXOn
|
||||
qHPke9uCo4ynV6yEmLa/yN9iyXL2UjY7KjzbpFLhrFYE5JxXfCfCgOk3N1nF8953
|
||||
2K95/3uFrasbRSRDi2ROVmDYD1stqN+euHfx3N15uZ/E/Ol8e7GhBMIWo9WIyqJ7
|
||||
3GiU9ce+vQKBgDmTfVL96CQWL7wemZiS9I/wXk871ic2l6/vqVkrNhRPiwlwAy1b
|
||||
LgLRS3BcYe0VPiqyqZFxL0GSPHF/4Q76sCxQRdM+dikI9PDGzHeqtHl5FSEIb52V
|
||||
JwzoRgR/wsXKBZj03XTWjf6WQSih/YHjlVy6VWFlQhi7NlXD8A47r0shAoGAX+Pj
|
||||
qzn5NqkuiMxCnPgBq/ZakF4jUmPo/He/fK/6ZMOloZyHg+qohjNr6Dibqk5x3oTI
|
||||
Rko4lE+rljCWZVU97zjZsQwu+DErEqbU9Ms9YprBD0JFdoPEfbTwnW6ac1oJYTF/
|
||||
pazt3PWDyuIwfDcEywQi9qOqKsoBEJ59T+SpPVECgYBzT9XnT01Eh5MGYxoC/8cu
|
||||
c19gWNqHNnvTeUYNI6y8+bUSSbP3vJ8Bytb0VuBega5QQYrT9EYILJIVu9oKSHJE
|
||||
v5rSGMmM9hNbWmROGEad/afO82AilvfOR0fx6Tmyk3Sf3tg3JltA3tAzPgo/BOlc
|
||||
GqVhDf37ULi8YBLGLkNOZA==
|
||||
-----END PRIVATE KEY-----
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM --platform=linux/amd64 ghcr.io/cake-tech/cake_wallet:debian13-flutter3.32.0-ndkr28-go1.24.1-ruststablenightly
|
||||
FROM --platform=linux/amd64 ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly
|
||||
|
||||
WORKDIR /w
|
||||
|
||||
@@ -1,9 +1,23 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
RUN mkdir -p /w/scripts/android
|
||||
COPY scripts/functions.sh /w/scripts/functions.sh
|
||||
COPY scripts/prepare_moneroc.sh /w/scripts/prepare_moneroc.sh
|
||||
COPY scripts/android/build_monero_all.sh /w/scripts/android/build_monero_all.sh
|
||||
|
||||
ARG UID=10001
|
||||
ARG GID=10001
|
||||
ARG USER=builder
|
||||
RUN groupadd -g "$GID" "$USER" && \
|
||||
useradd -m -u "$UID" -g "$GID" -s /bin/bash "$USER"
|
||||
|
||||
RUN sudo chown $UID:$GID -R /w /root
|
||||
USER builder
|
||||
|
||||
ARG COIN
|
||||
ARG TARGET
|
||||
ENV COIN=$COIN
|
||||
ENV TARGET=$TARGET
|
||||
RUN /w/scripts/android/build_monero_all.sh \
|
||||
&& rm -rf /w/scripts/monero_c/contrib \
|
||||
/w/scripts/monero_c/.git \
|
||||
|
||||
@@ -3,6 +3,8 @@ FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
RUN mkdir -p /w/scripts/android
|
||||
COPY pubspec_base.yaml /w/pubspec.yaml
|
||||
COPY pubspec_overrides.yaml /w/pubspec_overrides.yaml
|
||||
COPY pubspec_overrides.yaml /w/cw_mweb/pubspec_overrides.yaml
|
||||
COPY cw_mweb/pubspec.yaml /w/cw_mweb/pubspec.yaml
|
||||
COPY cw_mweb/ffigen_config.yaml /w/cw_mweb/ffigen_config.yaml
|
||||
COPY cw_mweb/go /w/cw_mweb/go
|
||||
|
||||
@@ -4,6 +4,7 @@ FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
RUN mkdir -p /w/scripts/android
|
||||
COPY scripts/prepare_reown.sh /w/scripts/prepare_reown.sh
|
||||
COPY scripts/android/build_reown_deps.sh /w/scripts/android/build_reown_deps.sh
|
||||
RUN cd $(dirname $(which flutter)) && git checkout 3.32.0
|
||||
RUN /w/scripts/android/build_reown_deps.sh \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_core/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_sign/.dart_tool \
|
||||
|
||||
@@ -4,7 +4,22 @@ FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
COPY scripts/prepare_torch.sh /w/scripts/prepare_torch.sh
|
||||
COPY scripts/android/build_torch.sh /w/scripts/android/build_torch.sh
|
||||
RUN /w/scripts/android/build_torch.sh && rm -rf /w/scripts/torch_dart/simplybs
|
||||
ARG UID=10001
|
||||
ARG GID=10001
|
||||
ARG USER=builder
|
||||
RUN groupadd -g "$GID" "$USER" && \
|
||||
useradd -m -u "$UID" -g "$GID" -s /bin/bash "$USER"
|
||||
|
||||
RUN sudo chown $UID:$GID -R /w /root
|
||||
USER builder
|
||||
|
||||
ARG TARGET
|
||||
RUN if [ -n "$TARGET" ]; then \
|
||||
/w/scripts/android/build_torch.sh "$TARGET"; \
|
||||
else \
|
||||
/w/scripts/android/build_torch.sh; \
|
||||
fi \
|
||||
&& rm -rf /w/scripts/torch_dart/simplybs
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
COPY --from=build /w /w
|
||||
|
||||
Executable
+45
@@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
STORE_PASS="${STORE_PASS:-test@cake_wallet}"
|
||||
KEY_PASS="${KEY_PASS:-test@cake_wallet}"
|
||||
DEST="${1:-}"
|
||||
|
||||
if [[ -z "$DEST" ]]; then
|
||||
DEST="$(cd ../.. && pwd)/android/app/key.jks"
|
||||
elif [[ "$DEST" != /* ]]; then
|
||||
DEST="$(cd ../.. && pwd)/$DEST"
|
||||
fi
|
||||
|
||||
P12="$(mktemp /tmp/cakewallet-dev-XXXXXX.p12)"
|
||||
cleanup() { rm -f "$P12"; }
|
||||
trap cleanup EXIT
|
||||
|
||||
openssl pkcs12 -export \
|
||||
-inkey "$PWD/dev-test-key.pem" \
|
||||
-in "$PWD/dev-test-key.crt" \
|
||||
-out "$P12" \
|
||||
-name testKey \
|
||||
-passout "pass:${STORE_PASS}" \
|
||||
-certpbe PBE-SHA1-3DES \
|
||||
-keypbe PBE-SHA1-3DES \
|
||||
-macalg sha1
|
||||
|
||||
mkdir -p "$(dirname "$DEST")"
|
||||
rm -f "$DEST"
|
||||
|
||||
keytool -importkeystore \
|
||||
-srckeystore "$P12" \
|
||||
-srcstoretype PKCS12 \
|
||||
-srcstorepass "$STORE_PASS" \
|
||||
-destkeystore "$DEST" \
|
||||
-deststoretype JKS \
|
||||
-deststorepass "$STORE_PASS" \
|
||||
-destkeypass "$KEY_PASS" \
|
||||
-srcalias testKey \
|
||||
-destalias testKey \
|
||||
-noprompt
|
||||
|
||||
echo "Wrote $DEST"
|
||||
Executable
+88
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
INPUT_STRING="${1:?Usage: $0 <seed_string> <result.png>}"
|
||||
OUTPUT="${2:?Usage: $0 <seed_string> <result.png>}"
|
||||
|
||||
if [[ ! -f "$OUTPUT" ]]; then
|
||||
echo "Error: '$OUTPUT' not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
read -r IMG_W IMG_H < <(
|
||||
ffprobe -v error \
|
||||
-select_streams v:0 \
|
||||
-show_entries stream=width,height \
|
||||
-of csv=p=0 \
|
||||
"$OUTPUT" | tr ',' ' '
|
||||
)
|
||||
|
||||
if [[ -z "$IMG_W" || -z "$IMG_H" ]]; then
|
||||
echo "Error: could not read dimensions from '$OUTPUT'." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
HASH=$(printf '%s' "$INPUT_STRING" | sha256sum | awk '{print $1}')
|
||||
|
||||
chunk1=$(( 16#${HASH:0:8} ))
|
||||
chunk2=$(( 16#${HASH:8:8} ))
|
||||
chunk3=$(( 16#${HASH:16:8} ))
|
||||
chunk4=$(( 16#${HASH:24:8} ))
|
||||
|
||||
R=$(( chunk1 % 256 ))
|
||||
G=$(( chunk2 % 256 ))
|
||||
B=$(( chunk3 % 256 ))
|
||||
|
||||
ROTATION=$(( chunk4 % 360 ))
|
||||
|
||||
R2=$(( (chunk1 / 256) % 256 ))
|
||||
G2=$(( (chunk2 / 256) % 256 ))
|
||||
B2=$(( (chunk3 / 256) % 256 ))
|
||||
|
||||
STRLEN=${#INPUT_STRING}
|
||||
TILE_SIZE=$(( 64 + (STRLEN % 192) ))
|
||||
|
||||
GEQ_R="between(mod((X+Y),${TILE_SIZE}),0,$(( TILE_SIZE / 2 )))*${R} + between(mod((X+Y),${TILE_SIZE}),$(( TILE_SIZE / 2 + 1 )),${TILE_SIZE})*${R2}"
|
||||
GEQ_G="between(mod((X+Y),${TILE_SIZE}),0,$(( TILE_SIZE / 2 )))*${G} + between(mod((X+Y),${TILE_SIZE}),$(( TILE_SIZE / 2 + 1 )),${TILE_SIZE})*${G2}"
|
||||
GEQ_B="between(mod((X+Y),${TILE_SIZE}),0,$(( TILE_SIZE / 2 )))*${B} + between(mod((X+Y),${TILE_SIZE}),$(( TILE_SIZE / 2 + 1 )),${TILE_SIZE})*${B2}"
|
||||
|
||||
ROTATION_RAD=$(awk "BEGIN { printf \"%.6f\", ${ROTATION} * 3.14159265358979 / 180 }")
|
||||
|
||||
TMPFILE=$(mktemp "${OUTPUT}.tmp.XXXXXX.png")
|
||||
trap 'rm -f "$TMPFILE"' EXIT
|
||||
|
||||
ffmpeg -y \
|
||||
-f lavfi -i "nullsrc=size=${IMG_W}x${IMG_H}:rate=1" \
|
||||
-i "$OUTPUT" \
|
||||
-filter_complex "
|
||||
[0:v]geq=
|
||||
r='${GEQ_R}':
|
||||
g='${GEQ_G}':
|
||||
b='${GEQ_B}':
|
||||
a=255,
|
||||
format=rgba[bg];
|
||||
|
||||
[1:v]format=rgba,
|
||||
geq=
|
||||
r='r(X,Y)':
|
||||
g='g(X,Y)':
|
||||
b='b(X,Y)':
|
||||
a='if(gte(r(X,Y)+g(X,Y)+b(X,Y),720),0,if(lte(r(X,Y)+g(X,Y)+b(X,Y),15)*gte(alpha(X,Y),250),0,alpha(X,Y)))',
|
||||
rotate=
|
||||
angle=${ROTATION_RAD}:
|
||||
fillcolor=none:
|
||||
ow=rotw(${ROTATION_RAD}):
|
||||
oh=roth(${ROTATION_RAD})[ovr];
|
||||
|
||||
[bg][ovr]overlay=
|
||||
x=(W-w)/2:
|
||||
y=(H-h)/2:
|
||||
format=auto[out]
|
||||
" \
|
||||
-map "[out]" \
|
||||
-frames:v 1 \
|
||||
-update 1 \
|
||||
"$TMPFILE"
|
||||
|
||||
mv "$TMPFILE" "$OUTPUT"
|
||||
@@ -0,0 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Waiting for boot completion..."
|
||||
timeout 300 bash -c 'until adb shell getprop sys.boot_completed 2>/dev/null | grep -q "1"; do sleep 5; done' || echo "Boot completion timeout, continuing"
|
||||
|
||||
echo "Waiting for package manager..."
|
||||
timeout 60 bash -c 'until adb shell pm list packages 2>/dev/null >/dev/null; do sleep 2; done' || echo "Package manager timeout, continuing"
|
||||
|
||||
echo "Waiting for settings service..."
|
||||
timeout 60 bash -c 'until adb shell settings get global window_animation_scale 2>/dev/null >/dev/null; do sleep 2; done' || echo "Settings service timeout, continuing"
|
||||
|
||||
echo "Emulator readiness check completed"
|
||||
@@ -0,0 +1,115 @@
|
||||
#!/bin/bash
|
||||
|
||||
TIER="$1"
|
||||
|
||||
if [[ -z "${SUITE_DIR_INPUT:-}" ]]; then
|
||||
echo "SUITE_DIR_INPUT never reached the emulator script"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
KEYS_IMPORTED=""
|
||||
|
||||
import_encryption_keys() {
|
||||
if [[ -n "$KEYS_IMPORTED" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 6B3199AD9B3D23B8 || true # konstantin@cakewallet.com
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 35C8DBAFB8D9ACAC || true # cyjan@mrcyjanek.net
|
||||
gpg --keyserver hkps://keyserver.ubuntu.com --recv-keys 0126DFF8D54495EB || true # david@cakewallet.com
|
||||
|
||||
if gpg --list-keys 6B3199AD9B3D23B8 > /dev/null 2>&1 &&
|
||||
gpg --list-keys 35C8DBAFB8D9ACAC > /dev/null 2>&1 &&
|
||||
gpg --list-keys 0126DFF8D54495EB > /dev/null 2>&1; then
|
||||
KEYS_IMPORTED=1
|
||||
else
|
||||
echo "Recipient keys missing from the keyring, the next call retries the import"
|
||||
fi
|
||||
}
|
||||
|
||||
encrypt_and_drop() {
|
||||
gpg --trust-model always --encrypt --output "$1.gpg" \
|
||||
--recipient 6B3199AD9B3D23B8 \
|
||||
--recipient 35C8DBAFB8D9ACAC \
|
||||
--recipient 0126DFF8D54495EB \
|
||||
"$1" || echo "Encrypting $1 failed, discarding it"
|
||||
rm -f "$1"
|
||||
}
|
||||
|
||||
bash scripts/ci/emulator_ready.sh
|
||||
|
||||
adb shell settings put global window_animation_scale 0.0 || true
|
||||
adb shell settings put global transition_animation_scale 0.0 || true
|
||||
adb shell settings put global animator_duration_scale 0.0 || true
|
||||
|
||||
echo "===== resources before $TIER ====="
|
||||
free -h || true
|
||||
df -h / || true
|
||||
|
||||
if [[ "$RECORD_SCREEN" == "true" ]]; then
|
||||
echo "Starting chunked screen recording..."
|
||||
(i=0; while true; do adb shell screenrecord --time-limit 180 --bit-rate 2000000 "/sdcard/rec_${TIER}_$i.mp4" || break; i=$((i+1)); done) &
|
||||
RECORD_LOOP_PID=$!
|
||||
fi
|
||||
|
||||
# Both tiers get one retry. tier1 talks to live nodes and providers, and giving it
|
||||
# no retry meant a driver that never attached was reported as a failing test.
|
||||
RETRIES=1
|
||||
|
||||
# The step log is public, so a run log that gets encrypted below must not print here.
|
||||
run_suites() {
|
||||
env \
|
||||
SUITE_DIR="$SUITE_DIR_INPUT" \
|
||||
TEST_TIER="$TIER" \
|
||||
EXTRA_DART_DEFINES="$EXTRA_DART_DEFINES_INPUT" \
|
||||
TEST_TIMEOUT=600 \
|
||||
RETRY_COUNT=$RETRIES \
|
||||
PLATFORM=android \
|
||||
SUMMARY_FILE="${TIER}_summary.txt" \
|
||||
./integration_test_runner.sh 2>&1
|
||||
}
|
||||
|
||||
set -o pipefail
|
||||
set +e
|
||||
if [[ "${ENCRYPT_LOGS:-}" == "true" ]]; then
|
||||
run_suites > "${TIER}_run.log"
|
||||
else
|
||||
run_suites | tee "${TIER}_run.log"
|
||||
fi
|
||||
TEST_EXIT_CODE=$?
|
||||
set -e
|
||||
|
||||
echo "===== resources after $TIER ====="
|
||||
free -h || true
|
||||
df -h / || true
|
||||
|
||||
adb logcat -d > "${TIER}_logcat.txt" || true
|
||||
|
||||
# A funds run puts real funded seeds on the device and these carry whatever the app
|
||||
# logs, so they leave the runner the same way the recordings do
|
||||
if [[ "${ENCRYPT_LOGS:-}" == "true" ]]; then
|
||||
import_encryption_keys
|
||||
encrypt_and_drop "${TIER}_logcat.txt"
|
||||
encrypt_and_drop "${TIER}_run.log"
|
||||
fi
|
||||
|
||||
if [[ -n "${RECORD_LOOP_PID:-}" ]]; then
|
||||
echo "Stopping screen recording and encrypting..."
|
||||
kill "$RECORD_LOOP_PID" || true
|
||||
adb shell killall -INT screenrecord || true
|
||||
sleep 5
|
||||
|
||||
mkdir -p recordings
|
||||
for f in $(adb shell ls /sdcard/rec_*.mp4 2>/dev/null | tr -d '\r'); do
|
||||
adb pull "$f" recordings/ || true
|
||||
done
|
||||
|
||||
# Recordings show seed words on screen so they are never uploaded in plaintext
|
||||
import_encryption_keys
|
||||
for f in recordings/*.mp4; do
|
||||
[[ -f "$f" ]] || continue
|
||||
encrypt_and_drop "$f"
|
||||
done
|
||||
fi
|
||||
|
||||
exit $TEST_EXIT_CODE
|
||||
Executable
+222
@@ -0,0 +1,222 @@
|
||||
#!/bin/bash
|
||||
|
||||
# usage:
|
||||
# ./compare_overrides.sh GIT_HASH_A GIT_HASH_B
|
||||
|
||||
set -e
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
HASH_A=${1:?usage: ./compare_overrides.sh GIT_HASH_A GIT_HASH_B}
|
||||
HASH_B=${2:?usage: ./compare_overrides.sh GIT_HASH_A GIT_HASH_B}
|
||||
|
||||
sdk_git_url=https://github.com/dart-lang/sdk
|
||||
|
||||
yq() {
|
||||
go run github.com/mikefarah/yq/v4@latest "$@"
|
||||
}
|
||||
|
||||
normalize_url() {
|
||||
echo "$1" | sed 's|\.git$||'
|
||||
}
|
||||
|
||||
repo_cache_dir() {
|
||||
echo "scripts/.cache/repos/$(normalize_url "$1" | sed 's|https://github.com/||; s|/|_|g')"
|
||||
}
|
||||
|
||||
ensure_repo_clone() {
|
||||
local url=$1 cache_dir=$2
|
||||
if [[ -d "${cache_dir}/.git" ]]; then
|
||||
git -C "$cache_dir" fetch --quiet origin
|
||||
else
|
||||
mkdir -p "$(dirname "$cache_dir")"
|
||||
if [[ "$(normalize_url "$url")" == "$sdk_git_url" ]]; then
|
||||
git clone --quiet --filter=blob:none "$url" "$cache_dir" || return 1
|
||||
else
|
||||
git clone --quiet "$url" "$cache_dir" || return 1
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
normalize_repo_path() {
|
||||
local path=$1
|
||||
[[ -z "$path" || "$path" == "-" ]] && return 0
|
||||
echo "${path#./}"
|
||||
}
|
||||
|
||||
ensure_ref() {
|
||||
local cache_dir=$1 ref=$2
|
||||
git -C "$cache_dir" cat-file -e "${ref}^{commit}" 2>/dev/null && return 0
|
||||
git -C "$cache_dir" fetch --quiet origin "$ref" 2>/dev/null || true
|
||||
git -C "$cache_dir" cat-file -e "${ref}^{commit}" 2>/dev/null
|
||||
}
|
||||
|
||||
count_lines_at_ref() {
|
||||
local cache_dir=$1 ref=$2 path=$3
|
||||
local repo_path file lines total=0
|
||||
|
||||
ensure_ref "$cache_dir" "$ref" || return 1
|
||||
repo_path=$(normalize_repo_path "$path")
|
||||
|
||||
while IFS= read -r file; do
|
||||
[[ -z "$file" ]] && continue
|
||||
lines=$(git -C "$cache_dir" show "$ref:$file" 2>/dev/null | wc -l | tr -d ' ')
|
||||
total=$((total + lines))
|
||||
done < <(
|
||||
if [[ -n "$repo_path" ]]; then
|
||||
git -C "$cache_dir" ls-tree -r --name-only "$ref" -- "$repo_path" 2>/dev/null
|
||||
else
|
||||
git -C "$cache_dir" ls-tree -r --name-only "$ref" 2>/dev/null
|
||||
fi
|
||||
)
|
||||
|
||||
echo "$total"
|
||||
}
|
||||
|
||||
print_ref_diff() {
|
||||
local cache_dir=$1 old_ref=$2 new_ref=$3 old_path=$4 new_path=$5
|
||||
local repo_path diff_paths=() path
|
||||
|
||||
ensure_ref "$cache_dir" "$old_ref" || {
|
||||
echo " diff (old ref not found: $old_ref)"
|
||||
return 1
|
||||
}
|
||||
ensure_ref "$cache_dir" "$new_ref" || {
|
||||
echo " diff (new ref not found: $new_ref)"
|
||||
return 1
|
||||
}
|
||||
|
||||
for path in "$old_path" "$new_path"; do
|
||||
repo_path=$(normalize_repo_path "$path")
|
||||
[[ -z "$repo_path" ]] && continue
|
||||
[[ " ${diff_paths[*]} " == *" $repo_path "* ]] && continue
|
||||
diff_paths+=("$repo_path")
|
||||
done
|
||||
|
||||
if [[ ${#diff_paths[@]} -eq 0 ]]; then
|
||||
git -C "$cache_dir" diff --stat "$old_ref" "$new_ref" | sed 's/^/ /'
|
||||
else
|
||||
git -C "$cache_dir" diff --stat "$old_ref" "$new_ref" -- "${diff_paths[@]}" | sed 's/^/ /'
|
||||
fi
|
||||
}
|
||||
|
||||
overrides_json_git() {
|
||||
git show "${1}:pubspec_overrides.yaml" | yq -o=json '.dependency_overrides // {}'
|
||||
}
|
||||
|
||||
overrides_json_worktree() {
|
||||
yq -o=json '.dependency_overrides // {}' pubspec_overrides.yaml
|
||||
}
|
||||
|
||||
print_git_fields() {
|
||||
local pkg=$1 old_url=$2 new_url=$3 old_ref=$4 new_ref=$5 old_path=$6 new_path=$7
|
||||
echo " $pkg"
|
||||
echo " url $old_url -> $new_url"
|
||||
echo " ref $old_ref -> $new_ref"
|
||||
echo " path $old_path -> $new_path"
|
||||
}
|
||||
|
||||
print_new_repo_stats() {
|
||||
local new_url=$1 new_ref=$2 new_path=$3 cache_dir loc
|
||||
|
||||
[[ "$new_url" == "-" || "$new_ref" == "-" ]] && return 0
|
||||
|
||||
cache_dir=$(repo_cache_dir "$new_url")
|
||||
if ! ensure_repo_clone "$new_url" "$cache_dir"; then
|
||||
echo " loc (clone failed)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if loc=$(count_lines_at_ref "$cache_dir" "$new_ref" "$new_path"); then
|
||||
echo " loc $loc lines"
|
||||
else
|
||||
echo " loc (ref not found: $new_ref)"
|
||||
fi
|
||||
}
|
||||
|
||||
print_changed_ref_stats() {
|
||||
local url=$1 old_ref=$2 new_ref=$3 old_path=$4 new_path=$5 cache_dir
|
||||
|
||||
[[ "$url" == "-" || "$old_ref" == "-" || "$new_ref" == "-" ]] && return 0
|
||||
|
||||
cache_dir=$(repo_cache_dir "$url")
|
||||
if ! ensure_repo_clone "$url" "$cache_dir"; then
|
||||
echo " diff (clone failed)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
print_ref_diff "$cache_dir" "$old_ref" "$new_ref" "$old_path" "$new_path"
|
||||
}
|
||||
|
||||
compare_overrides_jq='
|
||||
def git($obj; $pkg): $obj[$pkg].git // null;
|
||||
def fields($obj; $pkg):
|
||||
git($obj; $pkg) as $g |
|
||||
[($g.url // ""), ($g.ref // ""), ($g.path // "")];
|
||||
def dash($v): if $v == "" then "-" else $v end;
|
||||
'
|
||||
|
||||
resolved_a=$(git rev-parse "$HASH_A")
|
||||
resolved_b=$(git rev-parse "$HASH_B")
|
||||
resolved_head=$(git rev-parse HEAD)
|
||||
|
||||
if [[ "$resolved_a" == "$resolved_b" ]]; then
|
||||
json_a=$(overrides_json_git "$HASH_A")
|
||||
json_b=$(overrides_json_git "$HASH_B")
|
||||
elif [[ "$resolved_b" == "$resolved_head" ]]; then
|
||||
json_a=$(overrides_json_git "$HASH_A")
|
||||
json_b=$(overrides_json_worktree)
|
||||
else
|
||||
json_a=$(overrides_json_git "$HASH_A")
|
||||
json_b=$(overrides_json_git "$HASH_B")
|
||||
fi
|
||||
|
||||
new_output=$(
|
||||
jq -r -n --argjson a "$json_a" --argjson b "$json_b" "$compare_overrides_jq"'
|
||||
($b | keys[] | select(git($b; .))) as $pkg |
|
||||
select((git($a; $pkg) | not) or git($a; $pkg).url != git($b; $pkg).url) |
|
||||
(fields($a; $pkg)) as $old |
|
||||
(fields($b; $pkg)) as $new |
|
||||
[
|
||||
$pkg,
|
||||
dash($old[0]), dash($new[0]),
|
||||
dash($old[1]), dash($new[1]),
|
||||
dash($old[2]), dash($new[2])
|
||||
] | @tsv
|
||||
' | while IFS=$'\t' read -r pkg old_url new_url old_ref new_ref old_path new_path; do
|
||||
print_git_fields "$pkg" "$old_url" "$new_url" "$old_ref" "$new_ref" "$old_path" "$new_path"
|
||||
print_new_repo_stats "$new_url" "$new_ref" "$new_path"
|
||||
done
|
||||
)
|
||||
|
||||
changed_output=$(
|
||||
jq -r -n --argjson a "$json_a" --argjson b "$json_b" "$compare_overrides_jq"'
|
||||
($b | keys[] | select(git($b; .) and git($a; .))) as $pkg |
|
||||
select(git($a; $pkg).url == git($b; $pkg).url) |
|
||||
select((git($a; $pkg).ref // "") != (git($b; $pkg).ref // "")) |
|
||||
(fields($a; $pkg)) as $old |
|
||||
(fields($b; $pkg)) as $new |
|
||||
[
|
||||
$pkg,
|
||||
dash($old[0]), dash($new[0]),
|
||||
dash($old[1]), dash($new[1]),
|
||||
dash($old[2]), dash($new[2])
|
||||
] | @tsv
|
||||
' | while IFS=$'\t' read -r pkg old_url new_url old_ref new_ref old_path new_path; do
|
||||
print_git_fields "$pkg" "$old_url" "$new_url" "$old_ref" "$new_ref" "$old_path" "$new_path"
|
||||
print_changed_ref_stats "$new_url" "$old_ref" "$new_ref" "$old_path" "$new_path"
|
||||
done
|
||||
)
|
||||
|
||||
if [[ -n "$new_output" ]]; then
|
||||
echo "new git repos:"
|
||||
echo "$new_output"
|
||||
fi
|
||||
|
||||
if [[ -n "$new_output" && -n "$changed_output" ]]; then
|
||||
echo
|
||||
fi
|
||||
|
||||
if [[ -n "$changed_output" ]]; then
|
||||
echo "changed git refs:"
|
||||
echo "$changed_output"
|
||||
fi
|
||||
Executable
+624
@@ -0,0 +1,624 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Hello! o/
|
||||
# If you are think there's a chance that you
|
||||
# 1) want to update flutter sdk
|
||||
# 2) want to update some dependency
|
||||
# 3) want to add some dependency
|
||||
# 4) are forking a dependency
|
||||
# 5) something in the build process broke and you want to blame dependency pinning
|
||||
# 6) the script is failing
|
||||
#
|
||||
# In cases 1, 2, 3 you don't need to edit this script at all. Just add the dependency
|
||||
# to either pubspec_base.yaml or cw_*/pubspec.yaml. and re-run this script.
|
||||
# In case 4 (or 6), do the same and add the dependency to
|
||||
# package_repo_redirects - to redirect the dependency to your fork.
|
||||
# repo_redirects - if the dependency was moved between git repos.
|
||||
# version_ref_maps / dart_sdk_packages - if the dependency cannot be found upstream.
|
||||
# In case 5 remove pubspec_overrides.yaml, and just build the app. There is a non-zero
|
||||
# chance that it won't work. And if it works look for the diff between whatever is on git
|
||||
# and whatever is published on pub.dev tarball.
|
||||
# The script is designed in a way in which it is optional (so not using it should
|
||||
# still result in a working build).
|
||||
# In case of doubt git blame and ask the author ^^
|
||||
|
||||
set -e
|
||||
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
yq() {
|
||||
go run github.com/mikefarah/yq/v4@latest "$@"
|
||||
}
|
||||
|
||||
lockfile="$(pwd)/pubspec.lock"
|
||||
pubspec_base="$(pwd)/pubspec_base.yaml"
|
||||
overrides_file="$(pwd)/pubspec_overrides.yaml"
|
||||
sdk_git_url=https://github.com/dart-lang/sdk
|
||||
|
||||
resolved_git_path=""
|
||||
resolved_ref=""
|
||||
git_url=""
|
||||
override_url=""
|
||||
override_path=""
|
||||
version_ref_map_skip_verify=0
|
||||
|
||||
# old git url|new git url
|
||||
repo_redirects=(
|
||||
"https://github.com/cmdrootaccess/another-flushbar|https://github.com/ideployed/another-flushbar"
|
||||
"https://github.com/anicdh|https://github.com/MrCyjaneK/bs58check.git"
|
||||
"https://github.com/MedzikUser/libcrypto-dart|https://github.com/MrCyjaneK/libcrypto.git"
|
||||
"https://github.com/rive-app/rive-flutter|https://github.com/MrCyjaneK/rive-flutter-no-lfs"
|
||||
"https://github.com/dart-lang/ffi|https://github.com/dart-lang/native"
|
||||
)
|
||||
|
||||
# package|old git url|new git url (to move only one package out of a shared repo)
|
||||
package_repo_redirects=(
|
||||
"rive_common|https://github.com/rive-app/rive-flutter|https://github.com/MrCyjaneK/rive_common"
|
||||
"fixnum_nanodart|https://github.com/dart-lang/fixnum|https://github.com/MrCyjaneK/fixnum_nanodart"
|
||||
)
|
||||
|
||||
# package-version|git hash (exact match, or package-* to skip version check)
|
||||
version_ref_maps=(
|
||||
"ffi-2.1.0|6bd0935f29c7294ebb9aab21c06b47b513def933"
|
||||
"flutter_rust_bridge-2.11.1|f19087cd0cac019b82d52cfa5153ce81b1b6e902"
|
||||
)
|
||||
|
||||
dart_sdk_ref=$(cat $(dirname $(dirname $(which flutter)))/bin/cache/dart-sdk/revision)
|
||||
dart_sdk_packages=(
|
||||
js vm_service
|
||||
)
|
||||
|
||||
# Kept on pub.dev
|
||||
skip_git_pin_packages=(
|
||||
_fe_analyzer_shared
|
||||
analyzer
|
||||
meta
|
||||
)
|
||||
|
||||
lookup_version_ref_map() {
|
||||
local pkg=$1 ver=$2 entry key ref sdk_pkg
|
||||
version_ref_map_skip_verify=0
|
||||
for sdk_pkg in "${dart_sdk_packages[@]}"; do
|
||||
[[ "$pkg" == "$sdk_pkg" ]] || continue
|
||||
version_ref_map_skip_verify=1
|
||||
echo "$dart_sdk_ref"
|
||||
return 0
|
||||
done
|
||||
for entry in "${version_ref_maps[@]}"; do
|
||||
key="${entry%%|*}"
|
||||
ref="${entry#*|}"
|
||||
if [[ "$key" == "${pkg}-${ver}" ]]; then
|
||||
echo "$ref"
|
||||
return 0
|
||||
fi
|
||||
if [[ "$key" == "${pkg}-*" ]]; then
|
||||
version_ref_map_skip_verify=1
|
||||
echo "$ref"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
is_dart_sdk_package() {
|
||||
local pkg=$1 sdk_pkg
|
||||
for sdk_pkg in "${dart_sdk_packages[@]}"; do
|
||||
[[ "$pkg" == "$sdk_pkg" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
is_skip_git_pin_package() {
|
||||
local pkg=$1 skip_pkg
|
||||
for skip_pkg in "${skip_git_pin_packages[@]}"; do
|
||||
[[ "$pkg" == "$skip_pkg" ]] && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
apply_default_overrides() {
|
||||
[[ -f "$pubspec_base" ]] || return 0
|
||||
|
||||
awk '
|
||||
/^# dependency_overrides:/ {
|
||||
in_block = 1
|
||||
print "dependency_overrides:"
|
||||
next
|
||||
}
|
||||
in_block && /^#[[:space:]]/ {
|
||||
sub(/^#[[:space:]]?/, "")
|
||||
print
|
||||
next
|
||||
}
|
||||
in_block && /^#/ {
|
||||
sub(/^#/, "")
|
||||
print
|
||||
next
|
||||
}
|
||||
in_block { exit }
|
||||
' "$pubspec_base" > "$overrides_file"
|
||||
|
||||
if [[ ! -s "$overrides_file" ]]; then
|
||||
rm -f "$overrides_file"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "applied default overrides from ${pubspec_base}"
|
||||
}
|
||||
|
||||
normalize_url() {
|
||||
echo "$1" | sed 's|\.git$||'
|
||||
}
|
||||
|
||||
normalize_git_path() {
|
||||
local path=$1
|
||||
[[ -z "$path" || "$path" == "." ]] && return 0
|
||||
[[ "$path" == ./* ]] && { echo "$path"; return 0; }
|
||||
echo "./${path}"
|
||||
}
|
||||
|
||||
redirect_git_url() {
|
||||
local url=$1 package=${2:-} entry rest old new
|
||||
url=$(normalize_url "$url")
|
||||
|
||||
if [[ -n "$package" ]]; then
|
||||
for entry in "${package_repo_redirects[@]}"; do
|
||||
[[ "${entry%%|*}" != "$package" ]] && continue
|
||||
rest="${entry#*|}"
|
||||
old=$(normalize_url "${rest%%|*}")
|
||||
new=$(normalize_url "${rest#*|}")
|
||||
[[ "$url" == "$old" ]] && { echo "$new"; return 0; }
|
||||
done
|
||||
fi
|
||||
|
||||
for entry in "${repo_redirects[@]}"; do
|
||||
old=$(normalize_url "${entry%%|*}")
|
||||
new=$(normalize_url "${entry#*|}")
|
||||
[[ "$url" == "$old" ]] && { echo "$new"; return 0; }
|
||||
done
|
||||
echo "$1"
|
||||
}
|
||||
|
||||
parse_github_repo_url() {
|
||||
local url=$1
|
||||
if [[ "$url" =~ github\.com/([^/]+)/([^/?#]+) ]]; then
|
||||
git_owner="${BASH_REMATCH[1]}"
|
||||
git_repo="${BASH_REMATCH[2]%.git}"
|
||||
git_url="https://github.com/${git_owner}/${git_repo}"
|
||||
if [[ "$url" =~ github\.com/[^/]+/[^/]+/(tree|blob)/[^/]+/(.+) ]]; then
|
||||
git_path="./${BASH_REMATCH[2]}"
|
||||
else
|
||||
git_path=""
|
||||
fi
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
pubdev_cache_file() {
|
||||
echo "$(pwd)/scripts/.cache/pubdev/${1}/${2}.json"
|
||||
}
|
||||
|
||||
pubdev_repo_url() {
|
||||
local pkg=$1 ver=$2 cache_file
|
||||
cache_file=$(pubdev_cache_file "$pkg" "$ver")
|
||||
if [[ -f "$cache_file" ]]; then
|
||||
jq -r '.pubspec.repository // .pubspec.homepage // empty' "$cache_file"
|
||||
return 0
|
||||
fi
|
||||
mkdir -p "$(dirname "$cache_file")"
|
||||
curl -sf "https://pub.dev/api/packages/${pkg}/versions/${ver}" >"$cache_file"
|
||||
jq -r '.pubspec.repository // .pubspec.homepage // empty' "$cache_file"
|
||||
}
|
||||
|
||||
repo_cache_dir() {
|
||||
echo "scripts/.cache/repos/$(normalize_url "$1" | sed 's|https://github.com/||; s|/|_|g')"
|
||||
}
|
||||
|
||||
locks_dir="$(pwd)/scripts/.cache/locks"
|
||||
rm -rf $locks_dir
|
||||
mkdir -p $locks_dir
|
||||
|
||||
repo_lock_file() {
|
||||
local key=$1
|
||||
if [[ "$key" == */* || "$key" == scripts/* ]]; then
|
||||
echo "${locks_dir}/repo-$(basename "$key").lock"
|
||||
else
|
||||
echo "${locks_dir}/repo-$(normalize_url "$key" | sed 's|https://github.com/||; s|/|_|g').lock"
|
||||
fi
|
||||
}
|
||||
|
||||
with_lock() {
|
||||
local lockpath=$1; shift
|
||||
mkdir -p "$(dirname "$lockpath")"
|
||||
while ! mkdir "$lockpath" 2>/dev/null; do
|
||||
sleep 0.05
|
||||
done
|
||||
local rc=0
|
||||
"$@" || rc=$?
|
||||
rmdir "$lockpath" 2>/dev/null || true
|
||||
return "$rc"
|
||||
}
|
||||
|
||||
with_repo_lock() {
|
||||
with_lock "$(repo_lock_file "$1")" "${@:2}"
|
||||
}
|
||||
|
||||
with_overrides_lock() {
|
||||
with_lock "${locks_dir}/overrides.lock" "$@"
|
||||
}
|
||||
|
||||
_ensure_repo_clone() {
|
||||
local url=$1 cache_dir=$2
|
||||
[[ -d "${cache_dir}/.git" ]] && return 0
|
||||
mkdir -p "$(dirname "$cache_dir")"
|
||||
if [[ "$(normalize_url "$url")" == "$sdk_git_url" ]]; then
|
||||
git clone --quiet --filter=blob:none "$url" "$cache_dir" || return 1
|
||||
else
|
||||
git clone --quiet "$url" "$cache_dir" || return 1
|
||||
fi
|
||||
}
|
||||
|
||||
ensure_repo_clone() {
|
||||
local url=$1 cache_dir=$2
|
||||
with_repo_lock "$cache_dir" _ensure_repo_clone "$url" "$cache_dir"
|
||||
}
|
||||
|
||||
_ensure_git_ref() {
|
||||
local cache_dir=$1 ref=$2
|
||||
git -C "$cache_dir" cat-file -e "${ref}^{commit}" 2>/dev/null
|
||||
}
|
||||
|
||||
ensure_git_ref() {
|
||||
with_repo_lock "$1" _ensure_git_ref "$@"
|
||||
}
|
||||
|
||||
pubspec_field() {
|
||||
local content=$1 field=$2
|
||||
echo "$content" |
|
||||
grep -E "^${field}:[[:space:]]*" |
|
||||
head -1 |
|
||||
sed "s/^${field}:[[:space:]]*//" |
|
||||
tr -d "\"'" |
|
||||
sed 's/[[:space:]]*$//'
|
||||
}
|
||||
|
||||
pubspec_matches() {
|
||||
local content=$1 package=$2 ver=${3:-}
|
||||
[[ "$(pubspec_field "$content" name)" == "$package" ]] || return 1
|
||||
[[ -z "$ver" || "$(pubspec_field "$content" version)" == "$ver" ]]
|
||||
}
|
||||
|
||||
build_path_candidates() {
|
||||
local url=$1 package=$2 path=$3
|
||||
local candidate candidates=() seen=""
|
||||
|
||||
add_candidate() {
|
||||
local c=$1
|
||||
if [[ -z "$c" ]]; then
|
||||
[[ " $seen " == *" __ROOT__ "* ]] && return
|
||||
seen="$seen __ROOT__"
|
||||
candidates+=("")
|
||||
return
|
||||
fi
|
||||
[[ " $seen " == *" $c "* ]] && return
|
||||
seen="$seen $c"
|
||||
candidates+=("$c")
|
||||
}
|
||||
|
||||
if [[ -n "$path" ]]; then
|
||||
local normalized="${path#./}"
|
||||
normalized="${normalized%/}"
|
||||
if [[ "$normalized" != "packages" ]]; then
|
||||
local cache_dir content
|
||||
cache_dir=$(repo_cache_dir "$url")
|
||||
if ensure_repo_clone "$url" "$cache_dir"; then
|
||||
content=$(git -C "$cache_dir" show "HEAD:${normalized}/pubspec.yaml" 2>/dev/null) || content=""
|
||||
pubspec_matches "$content" "$package" && add_candidate "$normalized"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
local cache_dir pubspec_path dir content
|
||||
cache_dir=$(repo_cache_dir "$url")
|
||||
if ensure_repo_clone "$url" "$cache_dir"; then
|
||||
while IFS= read -r pubspec_path; do
|
||||
dir=$(dirname "$pubspec_path")
|
||||
content=$(git -C "$cache_dir" show "HEAD:${pubspec_path}" 2>/dev/null) || continue
|
||||
pubspec_matches "$content" "$package" || continue
|
||||
add_candidate "$dir"
|
||||
done < <(git -C "$cache_dir" ls-files | grep '/pubspec.yaml$')
|
||||
fi
|
||||
|
||||
add_candidate "pkgs/${package}"
|
||||
add_candidate "packages/${package}"
|
||||
add_candidate "${package}"
|
||||
add_candidate ""
|
||||
printf '%s\n' "${candidates[@]}"
|
||||
}
|
||||
|
||||
find_path_at_ref() {
|
||||
local url=$1 ref=$2 package=$3 ver=$4 hint_path=$5
|
||||
local cache_dir candidate pubspec_file content
|
||||
|
||||
cache_dir=$(repo_cache_dir "$url")
|
||||
ensure_repo_clone "$url" "$cache_dir" || return 1
|
||||
ensure_git_ref "$cache_dir" "$ref" || return 1
|
||||
|
||||
while IFS= read -r candidate; do
|
||||
pubspec_file=$([[ -n "$candidate" ]] && echo "${candidate}/pubspec.yaml" || echo "pubspec.yaml")
|
||||
content=$(git -C "$cache_dir" show "${ref}:${pubspec_file}" 2>/dev/null) || continue
|
||||
pubspec_matches "$content" "$package" "$ver" || continue
|
||||
[[ -n "$candidate" ]] && echo "./${candidate}"
|
||||
return 0
|
||||
done < <(build_path_candidates "$url" "$package" "$hint_path")
|
||||
return 1
|
||||
}
|
||||
|
||||
_resolve_tag_ref() {
|
||||
local url=$1 pkg=$2 ver=$3 cache_dir ref tag
|
||||
|
||||
cache_dir=$(repo_cache_dir "$url")
|
||||
_ensure_repo_clone "$url" "$cache_dir" || return 1
|
||||
|
||||
for tag in "${ver}" "v${ver}" "${pkg}-${ver}" "${pkg}-v${ver}"; do
|
||||
ref=$(git -C "$cache_dir" rev-parse -q "refs/tags/${tag}^{commit}" 2>/dev/null) && {
|
||||
echo "$ref"
|
||||
return 0
|
||||
}
|
||||
ref=$(git -C "$cache_dir" rev-parse -q "refs/tags/${tag}" 2>/dev/null) && {
|
||||
echo "$ref"
|
||||
return 0
|
||||
}
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
resolve_tag_ref() {
|
||||
with_repo_lock "$1" _resolve_tag_ref "$@"
|
||||
}
|
||||
|
||||
find_commit_for_package_version() {
|
||||
local url=$1 package=$2 ver=$3 hint_path=$4
|
||||
local cache_dir candidate pubspec_file ref content ver_try log_args
|
||||
local -a version_attempts=("$ver")
|
||||
|
||||
[[ "$ver" != *-dev ]] && version_attempts+=("${ver}-dev")
|
||||
|
||||
cache_dir=$(repo_cache_dir "$url")
|
||||
ensure_repo_clone "$url" "$cache_dir" || return 1
|
||||
|
||||
while IFS= read -r candidate; do
|
||||
pubspec_file=$([[ -n "$candidate" ]] && echo "${candidate}/pubspec.yaml" || echo "pubspec.yaml")
|
||||
for ver_try in "${version_attempts[@]}"; do
|
||||
[[ "$ver_try" == "$ver" ]] && log_args=(--reverse) || log_args=()
|
||||
for ref in $(git -C "$cache_dir" log "${log_args[@]}" --format=%H -- "$pubspec_file" 2>/dev/null); do
|
||||
content=$(git -C "$cache_dir" show "${ref}:${pubspec_file}" 2>/dev/null) || continue
|
||||
pubspec_matches "$content" "$package" "$ver_try" || continue
|
||||
resolved_git_path=""
|
||||
[[ -n "$candidate" ]] && resolved_git_path="./${candidate}"
|
||||
resolved_ref="$ref"
|
||||
return 0
|
||||
done
|
||||
done
|
||||
done < <(build_path_candidates "$url" "$package" "$hint_path")
|
||||
return 1
|
||||
}
|
||||
|
||||
resolve_git_override_for_package() {
|
||||
local package=$1 version=$2 repo_url=$3
|
||||
local original_git_url hint_path tag_ref path
|
||||
|
||||
repo_url=$(redirect_git_url "$repo_url" "$package")
|
||||
parse_github_repo_url "$repo_url" || return 1
|
||||
|
||||
original_git_url="$git_url"
|
||||
hint_path="$git_path"
|
||||
|
||||
path=$(find_path_at_ref "$git_url" HEAD "$package" "" "$hint_path" || true)
|
||||
if [[ -n "$path" ]]; then
|
||||
hint_path="$path"
|
||||
elif [[ -z "$hint_path" && "$git_url" != "$original_git_url" ]]; then
|
||||
path=$(find_path_at_ref "$original_git_url" HEAD "$package" "" "" || true)
|
||||
if [[ -n "$path" ]]; then
|
||||
git_url="$original_git_url"
|
||||
hint_path="$path"
|
||||
fi
|
||||
fi
|
||||
|
||||
resolved_git_path=""
|
||||
resolved_ref=""
|
||||
|
||||
tag_ref=$(resolve_tag_ref "$git_url" "$package" "$version" || true)
|
||||
if [[ -n "$tag_ref" ]] &&
|
||||
path=$(find_path_at_ref "$git_url" "$tag_ref" "$package" "$version" "$hint_path"); then
|
||||
resolved_git_path="$path"
|
||||
resolved_ref="$tag_ref"
|
||||
return 0
|
||||
fi
|
||||
|
||||
find_commit_for_package_version "$git_url" "$package" "$version" "$hint_path"
|
||||
}
|
||||
|
||||
resolve_mapped_override() {
|
||||
local package=$1 version=$2 source=$3 lock_git_url=$4 lock_git_path=$5 mapped_ref=$6
|
||||
local repo_url path_ver
|
||||
|
||||
if is_dart_sdk_package "$package"; then
|
||||
override_url="$sdk_git_url"
|
||||
override_path="./pkg/${package}"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [[ "$source" == "git" ]]; then
|
||||
[[ -n "$lock_git_url" ]] || return 1
|
||||
override_url=$(redirect_git_url "$lock_git_url" "$package")
|
||||
override_path=$(normalize_git_path "$lock_git_path")
|
||||
return 0
|
||||
fi
|
||||
|
||||
[[ "$source" == "hosted" ]] || return 1
|
||||
repo_url=$(pubdev_repo_url "$package" "$version")
|
||||
[[ -n "$repo_url" ]] || return 1
|
||||
repo_url=$(redirect_git_url "$repo_url" "$package")
|
||||
parse_github_repo_url "$repo_url" || return 1
|
||||
override_url="$git_url"
|
||||
path_ver="$version"
|
||||
[[ "$version_ref_map_skip_verify" == 1 ]] && path_ver=""
|
||||
override_path=$(find_path_at_ref "$git_url" "$mapped_ref" "$package" "$path_ver" "" || true)
|
||||
[[ -n "$override_path" ]]
|
||||
}
|
||||
|
||||
has_git_override_in_yaml() {
|
||||
local pkg=$1
|
||||
[[ -f "$overrides_file" ]] || return 1
|
||||
yq -e ".dependency_overrides.\"${pkg}\".git" "$overrides_file" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
_add_git_override_to_yaml() {
|
||||
local pkg=$1 url=$2 path=$3 ref=$4 yq_expr
|
||||
|
||||
[[ -f "$overrides_file" ]] || printf 'dependency_overrides: {}\n' > "$overrides_file"
|
||||
if has_git_override_in_yaml "$pkg"; then
|
||||
echo "$pkg: OK (default override)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
yq -i "del(.dependency_overrides.\"${pkg}\")" "$overrides_file"
|
||||
yq_expr=".dependency_overrides.\"${pkg}\".git.url = \"${url}\" | .dependency_overrides.\"${pkg}\".git.ref = \"${ref}\""
|
||||
[[ -n "$path" ]] && yq_expr+=" | .dependency_overrides.\"${pkg}\".git.path = \"${path}\""
|
||||
|
||||
yq -i "$yq_expr" "$overrides_file" || {
|
||||
echo "$pkg: failed to update ${overrides_file}" >&2
|
||||
return 1
|
||||
}
|
||||
|
||||
echo "added to ${overrides_file}:"
|
||||
echo " ${pkg}:"
|
||||
echo " git:"
|
||||
echo " url: ${url}"
|
||||
[[ -n "$path" ]] && echo " path: ${path}"
|
||||
echo " ref: ${ref}"
|
||||
}
|
||||
|
||||
add_git_override_to_yaml() {
|
||||
with_overrides_lock _add_git_override_to_yaml "$@"
|
||||
}
|
||||
|
||||
sort_overrides_yaml() {
|
||||
yq -i \
|
||||
'.dependency_overrides = (.dependency_overrides | to_entries | sort_by(.key) | from_entries)' \
|
||||
"$overrides_file"
|
||||
}
|
||||
|
||||
rm -f "$overrides_file"
|
||||
apply_default_overrides
|
||||
./configure_cake_wallet.sh android
|
||||
flutter pub get
|
||||
|
||||
apply_default_overrides
|
||||
|
||||
mkdir -p "$locks_dir"
|
||||
|
||||
process_package() {
|
||||
local pkg=$1 package source version git_url git_ref git_path mapped_ref repo_url
|
||||
|
||||
eval "$(jq -r '@sh "
|
||||
package=\(.package)
|
||||
source=\(.source)
|
||||
version=\(.version)
|
||||
git_url=\(.git_url)
|
||||
git_ref=\(.git_ref)
|
||||
git_path=\(.git_path)
|
||||
"' <<< "$pkg")"
|
||||
|
||||
if has_git_override_in_yaml "$package"; then
|
||||
echo "$package: OK (default override)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if is_skip_git_pin_package "$package"; then
|
||||
echo "$package: OK (version pinned, skipped)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
mapped_ref=$(lookup_version_ref_map "$package" "$version" || true)
|
||||
if [[ -n "$mapped_ref" ]]; then
|
||||
if ! resolve_mapped_override "$package" "$version" "$source" "$git_url" "$git_path" "$mapped_ref"; then
|
||||
echo "$package: NOT OK - could not apply version_ref_maps entry for ${version}" >&2
|
||||
return 1
|
||||
fi
|
||||
add_git_override_to_yaml "$package" "$override_url" "$override_path" "$mapped_ref" || return 1
|
||||
return 0
|
||||
fi
|
||||
|
||||
case "$source" in
|
||||
git)
|
||||
if [[ -z "$git_url" || -z "$git_ref" ]]; then
|
||||
echo "$package: NOT OK - git dependency missing url or ref in ${lockfile}" >&2
|
||||
return 1
|
||||
fi
|
||||
add_git_override_to_yaml \
|
||||
"$package" \
|
||||
"$(redirect_git_url "$git_url" "$package")" \
|
||||
"$(normalize_git_path "$git_path")" \
|
||||
"$git_ref" || return 1
|
||||
;;
|
||||
sdk)
|
||||
echo "$package: OK (sdk, skipped)"
|
||||
;;
|
||||
hosted)
|
||||
repo_url=$(pubdev_repo_url "$package" "$version")
|
||||
if [[ -z "$repo_url" ]]; then
|
||||
echo "$package: NOT OK - could not find repository or homepage on pub.dev for ${version}"
|
||||
return 1
|
||||
fi
|
||||
if ! resolve_git_override_for_package "$package" "$version" "$repo_url"; then
|
||||
echo "$package: NOT OK - could not resolve git ref for version ${version} in ${git_url}"
|
||||
echo "# add manual mapping to version_ref_maps in scripts/create_overrides.sh:"
|
||||
echo "# \"${package}-${version}|GIT_HASH\""
|
||||
echo "# repository: ${repo_url}"
|
||||
return 1
|
||||
fi
|
||||
add_git_override_to_yaml "$package" "$git_url" "$resolved_git_path" "$resolved_ref" || return 1
|
||||
;;
|
||||
path)
|
||||
echo "$package: OK (path, skipped)"
|
||||
;;
|
||||
*)
|
||||
echo "$package: NOT OK - source=${source} (cannot auto-generate git override)"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
max_jobs=16
|
||||
failed=0
|
||||
batch=()
|
||||
while IFS= read -r pkg; do
|
||||
process_package "$pkg" &
|
||||
batch+=($!)
|
||||
if ((${#batch[@]} >= max_jobs)); then
|
||||
for pid in "${batch[@]}"; do
|
||||
wait "$pid" || failed=1
|
||||
done
|
||||
batch=()
|
||||
fi
|
||||
done < <(
|
||||
yq -o json '.packages' "$lockfile" | jq -c '
|
||||
to_entries[] | {
|
||||
package: .key,
|
||||
source: (.value.source // ""),
|
||||
version: (.value.version // ""),
|
||||
git_url: (if (.value.description | type) == "object" then .value.description.url // "" else "" end),
|
||||
git_ref: (if (.value.description | type) == "object" then (.value.description["resolved-ref"] // .value.description.ref // "") else "" end),
|
||||
git_path: (if (.value.description | type) == "object" then .value.description.path // "" else "" end)
|
||||
}
|
||||
'
|
||||
)
|
||||
for pid in "${batch[@]}"; do
|
||||
wait "$pid" || failed=1
|
||||
done
|
||||
[[ "$failed" -eq 0 ]] || exit 1
|
||||
|
||||
sort_overrides_yaml
|
||||
@@ -12,8 +12,8 @@ TYPES=($MONERO_COM $CAKEWALLET)
|
||||
APP_IOS_TYPE=$1
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="6.1.2"
|
||||
MONERO_COM_BUILD_NUMBER=163
|
||||
MONERO_COM_VERSION="6.5.0"
|
||||
MONERO_COM_BUILD_NUMBER=178
|
||||
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
|
||||
|
||||
# Source CAKEWALLET version + build number from pubspec_description.yaml
|
||||
|
||||
+21
-9
@@ -1,17 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -x -e
|
||||
cd $(dirname $0)
|
||||
set -e
|
||||
cd "$(dirname "$0")"
|
||||
cd ..
|
||||
|
||||
for i in cw_core cw_monero cw_wownero cw_bitcoin cw_bitcoin_cash cw_dogecoin cw_evm cw_nano;
|
||||
do
|
||||
dart fix --apply $i/
|
||||
dart format --line-length=100 $i/
|
||||
if [[ ! "x$ABORT_ON_CHANGE" == "x" ]];
|
||||
then
|
||||
if [[ ! -z "$(git status --porcelain -- $(find $i))" ]];
|
||||
then
|
||||
echo "Please run scripts/lint.sh ($i has changes)"
|
||||
{
|
||||
# files modified after the lints got enabled and committed
|
||||
git log --since="2026-07-14 23:59:59" --name-only --diff-filter=d --format="" -- "$i"
|
||||
# uncommitted files (assumed to have been modified after the 29th)
|
||||
git diff --name-only --diff-filter=d HEAD -- "$i"
|
||||
} | grep '\.dart$' | sort -u | while IFS= read -r file; do
|
||||
echo $file
|
||||
if [[ -f "$file" ]]; then
|
||||
dart fix --apply "$file" && dart format --line-length=100 "$file"
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -n "$ABORT_ON_CHANGE" ]]; then
|
||||
DART_CHANGES=$(git status --porcelain -- "$i" | grep '\.dart$' || true)
|
||||
|
||||
if [[ -n "$DART_CHANGES" ]]; then
|
||||
echo "Please run scripts/lint.sh"
|
||||
echo "changes in $i:"
|
||||
echo "$DART_CHANGES"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -14,7 +14,7 @@ cd "$SCRIPT_DIR"
|
||||
BUILD_AMD64=false
|
||||
BUILD_ARM64=false
|
||||
APP_TYPE="cakewallet"
|
||||
DOCKER_IMAGE="ghcr.io/cake-tech/cake_wallet:debian13-flutter3.32.0-ndkr28-go1.24.1-ruststablenightly"
|
||||
DOCKER_IMAGE="ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly"
|
||||
|
||||
# Parse arguments
|
||||
for arg in "$@"
|
||||
|
||||
@@ -7,16 +7,23 @@ cd "$(dirname "$0")"
|
||||
|
||||
../prepare_moneroc.sh
|
||||
|
||||
for COIN in monero wownero;
|
||||
if [[ -n "${COIN:-}" ]]; then
|
||||
COINS=("$COIN")
|
||||
else
|
||||
COINS=(monero wownero)
|
||||
fi
|
||||
|
||||
if [[ -n "${TARGET:-}" ]]; then
|
||||
target="$TARGET"
|
||||
elif [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
|
||||
target="aarch64-linux-gnu"
|
||||
else
|
||||
target="x86_64-linux-gnu"
|
||||
fi
|
||||
|
||||
for COIN in "${COINS[@]}";
|
||||
do
|
||||
pushd ../monero_c
|
||||
# Determine target architecture based on system architecture
|
||||
if [[ $(uname -m) == "arm64" || $(uname -m) == "aarch64" ]]; then
|
||||
target="aarch64-linux-gnu"
|
||||
else
|
||||
target="x86_64-linux-gnu"
|
||||
fi
|
||||
|
||||
./build_single.sh ${COIN} $target -j$MAKE_JOB_COUNT
|
||||
popd
|
||||
done
|
||||
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -x -e
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
DEFAULT_TARGETS=(
|
||||
"x86_64-linux-gnu"
|
||||
)
|
||||
|
||||
if [ "$#" -gt 0 ]; then
|
||||
TARGETS=("$@")
|
||||
else
|
||||
TARGETS=("${DEFAULT_TARGETS[@]}")
|
||||
fi
|
||||
|
||||
../prepare_torch.sh
|
||||
|
||||
cd ../torch_dart
|
||||
|
||||
./build.sh "${TARGETS[@]}"
|
||||
@@ -0,0 +1,3 @@
|
||||
FROM --platform=linux/amd64 ghcr.io/cake-tech/cake_wallet:debian13-flutter3.41.9-ndkr28-go1.24.1-ruststablenightly
|
||||
|
||||
WORKDIR /w
|
||||
@@ -0,0 +1,9 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
RUN mkdir -p /w/scripts
|
||||
COPY scripts/build_bitbox_flutter.sh /w/scripts/build_bitbox_flutter.sh
|
||||
RUN cd /w/scripts && /w/scripts/build_bitbox_flutter.sh
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
COPY --from=build /w /w
|
||||
@@ -0,0 +1,23 @@
|
||||
ARG BASE_IMAGE
|
||||
ARG TORCH_IMAGE
|
||||
ARG REOWN_IMAGE
|
||||
ARG BITBOX_IMAGE
|
||||
ARG MONERO_IMAGE
|
||||
ARG MWEBD_IMAGE
|
||||
ARG ZCASH_IMAGE
|
||||
|
||||
FROM --platform=linux/amd64 ${TORCH_IMAGE} AS torch_src
|
||||
FROM --platform=linux/amd64 ${REOWN_IMAGE} AS reown_src
|
||||
FROM --platform=linux/amd64 ${BITBOX_IMAGE} AS bitbox_src
|
||||
FROM --platform=linux/amd64 ${MONERO_IMAGE} AS monero_src
|
||||
FROM --platform=linux/amd64 ${MWEBD_IMAGE} AS mwebd_src
|
||||
FROM --platform=linux/amd64 ${ZCASH_IMAGE} AS zcash_src
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
|
||||
COPY --from=torch_src /w /w.top
|
||||
COPY --from=reown_src /w /w.top
|
||||
COPY --from=bitbox_src /w /w.top
|
||||
COPY --from=monero_src /w /w.top
|
||||
COPY --from=mwebd_src /w /w.top
|
||||
COPY --from=zcash_src /w /w.top
|
||||
@@ -0,0 +1,26 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
ARG UID=10001
|
||||
ARG GID=10001
|
||||
ARG USER=builder
|
||||
RUN groupadd -g "$GID" "$USER" && \
|
||||
useradd -m -u "$UID" -g "$GID" -s /bin/bash "$USER"
|
||||
|
||||
RUN sudo chown $UID:$GID -R /w /root
|
||||
USER builder
|
||||
RUN mkdir -p /w/scripts/linux
|
||||
COPY scripts/prepare_moneroc.sh /w/scripts/prepare_moneroc.sh
|
||||
COPY scripts/linux/build_monero_all.sh /w/scripts/linux/build_monero_all.sh
|
||||
COPY scripts/functions.sh /w/scripts/functions.sh
|
||||
ARG COIN
|
||||
ARG TARGET
|
||||
ENV COIN=$COIN
|
||||
ENV TARGET=$TARGET
|
||||
RUN /w/scripts/linux/build_monero_all.sh \
|
||||
&& rm -rf /w/scripts/monero_c/contrib/depends/simplybs \
|
||||
/w/scripts/monero_c/monero_libwallet2_api_c/build \
|
||||
/w/scripts/monero_c/wownero_libwallet2_api_c/build
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
COPY --from=build /w /w
|
||||
@@ -0,0 +1,15 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
RUN mkdir -p /w/scripts/android
|
||||
COPY pubspec_base.yaml /w/pubspec.yaml
|
||||
COPY pubspec_overrides.yaml /w/pubspec_overrides.yaml
|
||||
COPY pubspec_overrides.yaml /w/cw_mweb/pubspec_overrides.yaml
|
||||
COPY cw_mweb/pubspec.yaml /w/cw_mweb/pubspec.yaml
|
||||
COPY cw_mweb/ffigen_config.yaml /w/cw_mweb/ffigen_config.yaml
|
||||
COPY cw_mweb/go /w/cw_mweb/go
|
||||
COPY scripts/android/build_mwebd.sh /w/scripts/android/build_mwebd.sh
|
||||
RUN /w/scripts/android/build_mwebd.sh
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
COPY --from=build /w /w
|
||||
@@ -0,0 +1,22 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
RUN mkdir -p /w/scripts/android
|
||||
COPY scripts/prepare_reown.sh /w/scripts/prepare_reown.sh
|
||||
COPY scripts/android/build_reown_deps.sh /w/scripts/android/build_reown_deps.sh
|
||||
RUN cd $(dirname $(which flutter)) && git checkout 3.32.0
|
||||
RUN /w/scripts/android/build_reown_deps.sh \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_core/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_sign/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_cli/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_walletkit/example/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_walletkit/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_yttrium/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_appkit/example/base/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_appkit/example/modal/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/packages/reown_appkit/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/.dart_tool \
|
||||
&& rm -rf /w/scripts/reown_flutter/scripts/yttrium/target
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
COPY --from=build /w /w
|
||||
@@ -0,0 +1,26 @@
|
||||
ARG BASE_IMAGE
|
||||
|
||||
FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
COPY scripts/prepare_torch.sh /w/scripts/prepare_torch.sh
|
||||
COPY scripts/linux/build_torch.sh /w/scripts/linux/build_torch.sh
|
||||
|
||||
ARG UID=10001
|
||||
ARG GID=10001
|
||||
ARG USER=builder
|
||||
RUN groupadd -g "$GID" "$USER" && \
|
||||
useradd -m -u "$UID" -g "$GID" -s /bin/bash "$USER"
|
||||
|
||||
RUN sudo chown $UID:$GID -R /w /root
|
||||
USER builder
|
||||
|
||||
ARG TARGET
|
||||
RUN if [ -n "$TARGET" ]; then \
|
||||
/w/scripts/linux/build_torch.sh "$TARGET"; \
|
||||
else \
|
||||
/w/scripts/linux/build_torch.sh; \
|
||||
fi \
|
||||
&& rm -rf /w/scripts/torch_dart/simplybs
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
COPY --from=build /w /w
|
||||
@@ -0,0 +1,10 @@
|
||||
ARG BASE_IMAGE
|
||||
FROM --platform=linux/amd64 ${BASE_IMAGE} AS build
|
||||
|
||||
RUN mkdir -p /w/scripts/linux
|
||||
COPY scripts/prepare_zcash.sh /w/scripts/prepare_zcash.sh
|
||||
COPY scripts/linux/build_zcash.sh /w/scripts/linux/build_zcash.sh
|
||||
RUN /w/scripts/linux/build_zcash.sh
|
||||
|
||||
FROM --platform=linux/amd64 alpine
|
||||
COPY --from=build /w /w
|
||||
Executable
+351
@@ -0,0 +1,351 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
cd "$(dirname $0)"
|
||||
|
||||
CW_DOCKER_REGISTRY="${CW_DOCKER_REGISTRY:-localhost/cake-tech/cake_wallet}"
|
||||
CW_DOCKER_USE_CLOUD="${CW_DOCKER_USE_CLOUD:-}"
|
||||
IMAGE_PREFIX="linux-deps-amd64"
|
||||
|
||||
SCRIPT_DIR="$(pwd)"
|
||||
REPO_ROOT="$(cd "$SCRIPT_DIR/../../.." && pwd)"
|
||||
|
||||
ONLY=""
|
||||
TARGET=""
|
||||
COIN=""
|
||||
MERGE=false
|
||||
EXTRACT=false
|
||||
|
||||
while [[ $# -gt 0 ]]; do
|
||||
case "$1" in
|
||||
--only)
|
||||
ONLY="$2"
|
||||
shift 2
|
||||
;;
|
||||
--target)
|
||||
TARGET="$2"
|
||||
shift 2
|
||||
;;
|
||||
--coin)
|
||||
COIN="$2"
|
||||
shift 2
|
||||
;;
|
||||
--merge)
|
||||
MERGE=true
|
||||
shift
|
||||
;;
|
||||
--extract)
|
||||
EXTRACT=true
|
||||
shift
|
||||
;;
|
||||
-h|--help)
|
||||
echo "Usage: $0 [--only NAME] [--target TRIPLE] [--coin COIN] [--merge] [--extract]"
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown argument: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
MONERO_COINS=(monero wownero)
|
||||
MONERO_TARGETS=(x86_64-linux-gnu)
|
||||
|
||||
image_exists() {
|
||||
docker image inspect "$1" &>/dev/null
|
||||
}
|
||||
|
||||
tinysha() {
|
||||
cat "$@" | sha256sum | cut -c1-6
|
||||
}
|
||||
|
||||
slice_extra() {
|
||||
if [[ -n "$COIN" && -n "$TARGET" ]]; then
|
||||
echo "-${COIN}-${TARGET}"
|
||||
elif [[ -n "$TARGET" ]]; then
|
||||
echo "-${TARGET}"
|
||||
else
|
||||
echo ""
|
||||
fi
|
||||
}
|
||||
|
||||
# Distinct from the unsuffixed all-in-one tag. The hash of slice suffixes
|
||||
# invalidates the merge image if a coin or target is added or removed.
|
||||
assembled_extra() {
|
||||
local tmp
|
||||
tmp="$(mktemp)"
|
||||
printf '%s\n' "$@" > "$tmp"
|
||||
echo "-merged-$(tinysha "$tmp")"
|
||||
rm -f "$tmp"
|
||||
}
|
||||
|
||||
monero_assembled_extra() {
|
||||
local extras=()
|
||||
local coin t
|
||||
for coin in "${MONERO_COINS[@]}"; do
|
||||
for t in "${MONERO_TARGETS[@]}"; do
|
||||
extras+=("-${coin}-${t}")
|
||||
done
|
||||
done
|
||||
assembled_extra "${extras[@]}"
|
||||
}
|
||||
|
||||
component_extra() {
|
||||
local name="$1"
|
||||
local sliced
|
||||
sliced="$(slice_extra)"
|
||||
if [[ -n "$sliced" ]]; then
|
||||
echo "$sliced"
|
||||
return
|
||||
fi
|
||||
case "$name" in
|
||||
monero) monero_assembled_extra ;;
|
||||
*) echo "" ;;
|
||||
esac
|
||||
}
|
||||
|
||||
img() {
|
||||
local name="$1"
|
||||
local version="$2"
|
||||
local extra="${3:-}"
|
||||
echo "$CW_DOCKER_REGISTRY:${IMAGE_PREFIX}-${name}-$(tinysha "$SCRIPT_DIR/Dockerfile.${name}")-${version}${extra}"
|
||||
}
|
||||
|
||||
remote_exists() {
|
||||
local tag="$1"
|
||||
if docker buildx version >/dev/null 2>&1; then
|
||||
docker buildx imagetools inspect "$tag" >/dev/null 2>&1
|
||||
return
|
||||
fi
|
||||
DOCKER_CLI_EXPERIMENTAL=enabled docker manifest inspect "$tag" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
cached() {
|
||||
local tag="$1"
|
||||
if image_exists "$tag"; then
|
||||
return 0
|
||||
fi
|
||||
if [[ "x$CW_DOCKER_USE_CLOUD" == "xtrue" ]] && remote_exists "$tag"; then
|
||||
return 0
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
maybe_push() {
|
||||
local tag="$1"
|
||||
if [[ "x$CW_DOCKER_USE_CLOUD" == "xtrue" ]]; then
|
||||
docker push "$tag"
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
local name="$1"; shift
|
||||
local version=$1; shift
|
||||
local extra
|
||||
extra="$(component_extra "$name")"
|
||||
local tag
|
||||
tag="$(img "$name" "$version" "$extra")"
|
||||
if cached "$tag"; then
|
||||
echo "==> skipping $name (cached: $tag)"
|
||||
return 0
|
||||
fi
|
||||
echo "==> building $name${extra}"
|
||||
docker build \
|
||||
--platform linux/amd64 \
|
||||
--file "$SCRIPT_DIR/Dockerfile.${name}" \
|
||||
--tag "$tag" \
|
||||
"$@" \
|
||||
"$REPO_ROOT"
|
||||
maybe_push "$tag"
|
||||
}
|
||||
|
||||
merge_slices() {
|
||||
local name="$1"
|
||||
local version="$2"
|
||||
local extra="$3"
|
||||
shift 3
|
||||
local dest
|
||||
dest="$(img "$name" "$version" "$extra")"
|
||||
if cached "$dest"; then
|
||||
echo "==> skipping merge $name (cached: $dest)"
|
||||
return 0
|
||||
fi
|
||||
|
||||
local slices=("$@")
|
||||
if [[ ${#slices[@]} -eq 0 ]]; then
|
||||
echo "merge_slices: no slice images given" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
local dockerfile
|
||||
dockerfile="$(mktemp)"
|
||||
local build_args=()
|
||||
local i=0
|
||||
for slice in "${slices[@]}"; do
|
||||
echo "ARG SRC${i}" >> "$dockerfile"
|
||||
i=$((i + 1))
|
||||
done
|
||||
i=0
|
||||
for slice in "${slices[@]}"; do
|
||||
if ! cached "$slice"; then
|
||||
echo "merge_slices: missing slice $slice" >&2
|
||||
rm -f "$dockerfile"
|
||||
exit 1
|
||||
fi
|
||||
echo "FROM --platform=linux/amd64 \${SRC${i}} AS s${i}" >> "$dockerfile"
|
||||
build_args+=(--build-arg "SRC${i}=$slice")
|
||||
i=$((i + 1))
|
||||
done
|
||||
echo "FROM --platform=linux/amd64 alpine" >> "$dockerfile"
|
||||
i=0
|
||||
for slice in "${slices[@]}"; do
|
||||
echo "COPY --from=s${i} /w /w" >> "$dockerfile"
|
||||
i=$((i + 1))
|
||||
done
|
||||
|
||||
echo "==> merging $name from ${#slices[@]} slices -> $dest"
|
||||
docker build \
|
||||
--platform linux/amd64 \
|
||||
--file "$dockerfile" \
|
||||
--tag "$dest" \
|
||||
"${build_args[@]}" \
|
||||
"$SCRIPT_DIR"
|
||||
rm -f "$dockerfile"
|
||||
maybe_push "$dest"
|
||||
}
|
||||
|
||||
base_ver="latest"
|
||||
torch_ver="$(tinysha $SCRIPT_DIR/Dockerfile.torch $REPO_ROOT/scripts/prepare_torch.sh $REPO_ROOT/scripts/linux/build_torch.sh)"
|
||||
reown_ver=$(tinysha $SCRIPT_DIR/Dockerfile.reown $REPO_ROOT/scripts/prepare_reown.sh $REPO_ROOT/scripts/android/build_reown_deps.sh)
|
||||
bitbox_ver=$(tinysha $SCRIPT_DIR/Dockerfile.bitbox $REPO_ROOT/scripts/build_bitbox_flutter.sh)
|
||||
monero_ver=$(tinysha $SCRIPT_DIR/Dockerfile.monero $REPO_ROOT/scripts/prepare_moneroc.sh $REPO_ROOT/scripts/linux/build_monero_all.sh)
|
||||
mwebd_ver=$(tinysha $SCRIPT_DIR/Dockerfile.mwebd $REPO_ROOT/pubspec_overrides.yaml $(find $REPO_ROOT/cw_mweb/go -type f | sort))
|
||||
zcash_ver=$(tinysha $SCRIPT_DIR/Dockerfile.zcash $REPO_ROOT/scripts/prepare_zcash.sh $REPO_ROOT/scripts/linux/build_zcash.sh)
|
||||
echo $base_ver $torch_ver $reown_ver $bitbox_ver $monero_ver $mwebd_ver $zcash_ver "$(monero_assembled_extra)" > /tmp/docker_build_versions
|
||||
final_ver=$(tinysha /tmp/docker_build_versions)
|
||||
|
||||
extract_final() {
|
||||
local required="${1:-}"
|
||||
local tag
|
||||
tag="$(img final "$final_ver")"
|
||||
if ! image_exists "$tag" && [[ "x$CW_DOCKER_USE_CLOUD" == "xtrue" ]] && remote_exists "$tag"; then
|
||||
docker pull "$tag"
|
||||
fi
|
||||
docker rm -f temp_extract >/dev/null 2>&1 || true
|
||||
if docker create --name temp_extract "$tag"; then
|
||||
cd "$REPO_ROOT"
|
||||
docker cp temp_extract:/w.top w.top
|
||||
rsync -av w.top/ .
|
||||
rm -rf w.top
|
||||
docker rm temp_extract
|
||||
echo "cache ok"
|
||||
echo "$tag" > /tmp/cakewallet_docker
|
||||
return 0
|
||||
fi
|
||||
docker rm -f temp_extract >/dev/null 2>&1 || true
|
||||
echo "cache miss oh"
|
||||
if [[ "$required" == "required" ]]; then
|
||||
echo "final image missing: $tag" >&2
|
||||
exit 1
|
||||
fi
|
||||
return 1
|
||||
}
|
||||
|
||||
build_base() {
|
||||
build base "$base_ver"
|
||||
}
|
||||
|
||||
build_bitbox() {
|
||||
build bitbox "$bitbox_ver" --build-arg BASE_IMAGE="$(img base "$base_ver")"
|
||||
}
|
||||
|
||||
build_mwebd() {
|
||||
build mwebd "$mwebd_ver" --build-arg BASE_IMAGE="$(img base "$base_ver")"
|
||||
}
|
||||
|
||||
build_reown() {
|
||||
build reown "$reown_ver" --build-arg BASE_IMAGE="$(img base "$base_ver")"
|
||||
}
|
||||
|
||||
build_zcash() {
|
||||
build zcash "$zcash_ver" --build-arg BASE_IMAGE="$(img base "$base_ver")"
|
||||
}
|
||||
|
||||
build_torch() {
|
||||
build torch "$torch_ver" \
|
||||
--build-arg BASE_IMAGE="$(img base "$base_ver")" \
|
||||
--build-arg TARGET="${TARGET}"
|
||||
}
|
||||
|
||||
build_monero() {
|
||||
if [[ "$MERGE" == true ]]; then
|
||||
local slices=()
|
||||
local coin t
|
||||
for coin in "${MONERO_COINS[@]}"; do
|
||||
for t in "${MONERO_TARGETS[@]}"; do
|
||||
slices+=("$(img monero "$monero_ver" "-${coin}-${t}")")
|
||||
done
|
||||
done
|
||||
merge_slices monero "$monero_ver" "$(monero_assembled_extra)" "${slices[@]}"
|
||||
return 0
|
||||
fi
|
||||
build monero "$monero_ver" \
|
||||
--build-arg BASE_IMAGE="$(img base "$base_ver")" \
|
||||
--build-arg COIN="${COIN}" \
|
||||
--build-arg TARGET="${TARGET}"
|
||||
}
|
||||
|
||||
build_final() {
|
||||
build final "$final_ver" \
|
||||
--build-arg BASE_IMAGE="$(img base "$base_ver")" \
|
||||
--build-arg TORCH_IMAGE="$(img torch "$torch_ver")" \
|
||||
--build-arg REOWN_IMAGE="$(img reown "$reown_ver")" \
|
||||
--build-arg BITBOX_IMAGE="$(img bitbox "$bitbox_ver")" \
|
||||
--build-arg MONERO_IMAGE="$(img monero "$monero_ver" "$(monero_assembled_extra)")" \
|
||||
--build-arg MWEBD_IMAGE="$(img mwebd "$mwebd_ver")" \
|
||||
--build-arg ZCASH_IMAGE="$(img zcash "$zcash_ver")"
|
||||
echo "done: $(img final $final_ver)"
|
||||
echo "$(img final $final_ver)" > /tmp/cakewallet_docker
|
||||
}
|
||||
|
||||
run_one() {
|
||||
case "$1" in
|
||||
base) build_base ;;
|
||||
bitbox) build_bitbox ;;
|
||||
mwebd) build_mwebd ;;
|
||||
reown) build_reown ;;
|
||||
zcash) build_zcash ;;
|
||||
torch) build_torch ;;
|
||||
monero) build_monero ;;
|
||||
final) build_final ;;
|
||||
*)
|
||||
echo "Unknown component: $1" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
if [[ "$EXTRACT" == true ]]; then
|
||||
extract_final required
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [[ -z "$ONLY" ]]; then
|
||||
extract_final && exit 0 || true
|
||||
ONLY=""
|
||||
TARGET=""
|
||||
COIN=""
|
||||
MERGE=false
|
||||
build_base
|
||||
build_bitbox
|
||||
build_mwebd
|
||||
build_reown
|
||||
build_monero
|
||||
build_zcash
|
||||
build_torch
|
||||
build_final
|
||||
extract_final required
|
||||
exit 0
|
||||
fi
|
||||
|
||||
run_one "$ONLY"
|
||||
@@ -16,8 +16,8 @@ if [ -n "$1" ]; then
|
||||
fi
|
||||
|
||||
MONERO_COM_NAME="Monero.com"
|
||||
MONERO_COM_VERSION="6.1.0"
|
||||
MONERO_COM_BUILD_NUMBER=79
|
||||
MONERO_COM_VERSION="6.5.0"
|
||||
MONERO_COM_BUILD_NUMBER=87
|
||||
MONERO_COM_BUNDLE_ID="com.cakewallet.monero"
|
||||
|
||||
# Version and build come from pubspec_description.yaml, the one file every
|
||||
|
||||
@@ -14,9 +14,9 @@ else
|
||||
fi
|
||||
|
||||
# NOTE: Make sure to update monero_c prebuilds link in workflow files
|
||||
# https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC1/release-bundle.zip
|
||||
# https://github.com/MrCyjaneK/monero_c/releases/download/v0.18.4.6-RC2/release-bundle.zip
|
||||
git fetch -a
|
||||
git checkout bc8d1a0b75b97156d71579581b4cdfe58c777ed2
|
||||
git checkout 33671871de3d51696b66ffb3bd94f744e26974f6
|
||||
git reset --hard
|
||||
|
||||
# Hash Bags: every CI workflow (android/ios-sim/ios-testflight/linux/windows)
|
||||
|
||||
@@ -7,7 +7,7 @@ cd "$(dirname "$0")"
|
||||
# - .github/workflows/pr_test_build_linux.yml
|
||||
# https://github.com/MrCyjaneK/torch_dart/releases/download/v1.0.17/torch_dart-v1.0.17.tar.gz
|
||||
|
||||
HASH=f48a45113ca556b73d8e80ef88012780ced82bcc
|
||||
HASH=a8601eaef00ac4a9465a0979b7d7a16df90bc364
|
||||
|
||||
if [[ ! -d "torch_dart/.git" ]];
|
||||
then
|
||||
|
||||
Executable
+59
@@ -0,0 +1,59 @@
|
||||
#!/bin/bash
|
||||
# Load a merge of an upstream Cake Wallet ref into the working tree, with the
|
||||
# two mechanical differences between the forks normalized away first:
|
||||
# 1. our project rename (package:cake_wallet/ -> package:hash_wallet/ imports)
|
||||
# 2. formatting (upstream formats Dart at 100 columns, short style)
|
||||
# Without this the 6.5.0 sync showed 614 conflicting paths; with it, 322.
|
||||
#
|
||||
# Usage: scripts/upstream_sync.sh <upstream-ref> e.g. v6.6.0
|
||||
# Run on a fresh sync branch with a clean tree. Afterwards resolve conflicts
|
||||
# as usual (git status), then `git commit`: MERGE_HEAD is the real upstream
|
||||
# commit, so the next sync's merge base is correct.
|
||||
set -euo pipefail
|
||||
|
||||
ref="${1:?usage: $0 <upstream-ref>}"
|
||||
dart="${DART:-dart}"
|
||||
fmt=(format --page-width 100 --language-version=3.0)
|
||||
|
||||
cd "$(git rev-parse --show-toplevel)"
|
||||
if [[ -n "$(git status --porcelain)" ]]; then
|
||||
echo "refusing: working tree is not clean" >&2
|
||||
exit 1
|
||||
fi
|
||||
git rev-parse -q --verify "$ref^{commit}" >/dev/null || { echo "refusing: unknown ref $ref" >&2; exit 1; }
|
||||
|
||||
# Our side: keep it formatted the way upstream is, as a real commit.
|
||||
git ls-files -z '*.dart' | xargs -0 "$dart" "${fmt[@]}" >/dev/null 2>&1 || true
|
||||
if [[ -n "$(git status --porcelain)" ]]; then
|
||||
git commit -qam "style: format Dart at 100 columns, as upstream does"
|
||||
fi
|
||||
|
||||
base=$(git merge-base HEAD "$ref")
|
||||
tmp=$(mktemp -d)
|
||||
trap 'git worktree remove --force "$tmp/base" 2>/dev/null || true; git worktree remove --force "$tmp/theirs" 2>/dev/null || true; rm -rf "$tmp"' EXIT
|
||||
|
||||
normalize() { # <dir> <format?>
|
||||
(
|
||||
cd "$1"
|
||||
git grep -lz 'package:cake_wallet/' -- '*.dart' | xargs -0 -r sed -i 's#package:cake_wallet/#package:hash_wallet/#g'
|
||||
if [[ "$2" == format ]]; then
|
||||
git ls-files -z '*.dart' | xargs -0 "$dart" "${fmt[@]}" >/dev/null 2>&1 || true
|
||||
fi
|
||||
git -c user.name=normalize -c user.email=normalize@localhost commit -qam normalize --allow-empty
|
||||
git rev-parse HEAD
|
||||
)
|
||||
}
|
||||
|
||||
umask 022
|
||||
git worktree add -q --detach "$tmp/base" "$base"
|
||||
git worktree add -q --detach "$tmp/theirs" "$ref"
|
||||
nbase=$(normalize "$tmp/base" format)
|
||||
ntheirs=$(normalize "$tmp/theirs" keep)
|
||||
|
||||
git read-tree -m -u "$nbase" HEAD "$ntheirs"
|
||||
git merge-index -o -q git-merge-one-file -a || true
|
||||
git rev-parse "$ref^{commit}" > "$(git rev-parse --git-dir)/MERGE_HEAD"
|
||||
echo "Merge upstream Cake Wallet $ref" > "$(git rev-parse --git-dir)/MERGE_MSG"
|
||||
|
||||
echo "Merge of $ref loaded. Unmerged paths:"
|
||||
git diff --name-only --diff-filter=U | wc -l
|
||||
Reference in New Issue
Block a user