Skip to content

Commit 2468534

Browse files
committed
Parameterize build_all.sh, remove per-app build script variants
1 parent 9b3f04f commit 2468534

16 files changed

Lines changed: 64 additions & 236 deletions

scripts/android/build_all.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,27 @@
22

33
set -x -e
44

5+
APP="${1:-stack_wallet}"
6+
57
mkdir -p build
68
. ./config.sh
79

810
PLUGINS_DIR=../../crypto_plugins
911

10-
# libepiccash requires old rust
1112
source ../rust_version.sh
12-
set_rust_version_for_libepiccash
13-
(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh )
14-
set_rust_version_for_libmwc
15-
(cd "${PLUGINS_DIR}"/flutter_libmwc/scripts/android && ./build_all.sh )
16-
# set rust (back) to a more recent stable release after building epiccash
13+
14+
if [[ "$APP" = "stack_wallet" ]]; then
15+
set_rust_version_for_libepiccash
16+
(cd "${PLUGINS_DIR}"/flutter_libepiccash/scripts/android && ./build_all.sh )
17+
set_rust_version_for_libmwc
18+
(cd "${PLUGINS_DIR}"/flutter_libmwc/scripts/android && ./build_all.sh )
19+
fi
20+
1721
set_rust_to_everything_else
1822

19-
(cd "${PLUGINS_DIR}"/frostdart/scripts/android && ./build_all.sh )
23+
if [[ "$APP" = "stack_wallet" || "$APP" = "stack_duo" ]]; then
24+
(cd "${PLUGINS_DIR}"/frostdart/scripts/android && ./build_all.sh )
25+
fi
2026

2127
wait
2228
echo "Done building"

scripts/android/build_all_campfire.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

scripts/android/build_all_duo.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/build_app.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,7 @@ if [ "$BUILD_CRYPTO_PLUGINS" -eq 0 ]; then
119119
if [ "$DOWNLOAD_CRYPTO_PLUGINS" -eq 1 ]; then
120120
./download_all.sh "$APP_NAMED_ID"
121121
else
122-
if [[ "$APP_NAMED_ID" = "stack_wallet" ]]; then
123-
./build_all.sh
124-
elif [[ "$APP_NAMED_ID" = "stack_duo" ]]; then
125-
./build_all_duo.sh
126-
elif [[ "$APP_NAMED_ID" = "campfire" ]]; then
127-
./build_all_campfire.sh
128-
else
129-
echo "Invalid app id: ${APP_NAMED_ID}"
130-
exit 1
131-
fi
122+
./build_all.sh "$APP_NAMED_ID"
132123
fi
133124
fi
134125

scripts/ios/build_all.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,26 @@
22

33
set -x -e
44

5-
# ensure ios rust triples are there
6-
rustup target add aarch64-apple-ios
7-
rustup target add x86_64-apple-ios
5+
APP="${1:-stack_wallet}"
86

97
# ensure ios rust triples are there
108
rustup target add aarch64-apple-ios
119
rustup target add x86_64-apple-ios
1210

13-
# libepiccash requires old rust
1411
source ../rust_version.sh
15-
set_rust_version_for_libepiccash
16-
(cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh )
17-
set_rust_version_for_libmwc
18-
(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh )
19-
# set rust (back) to a more recent stable release after building epiccash
12+
13+
if [[ "$APP" = "stack_wallet" ]]; then
14+
set_rust_version_for_libepiccash
15+
(cd ../../crypto_plugins/flutter_libepiccash/scripts/ios && ./build_all.sh )
16+
set_rust_version_for_libmwc
17+
(cd ../../crypto_plugins/flutter_libmwc/scripts/ios/ && ./build_all.sh )
18+
fi
19+
2020
set_rust_to_everything_else
2121

22-
(cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh )
22+
if [[ "$APP" = "stack_wallet" || "$APP" = "stack_duo" ]]; then
23+
(cd ../../crypto_plugins/frostdart/scripts/ios && ./build_all.sh )
24+
fi
2325

2426
wait
2527
echo "Done building"
26-
27-
# ensure ios rust triples are there
28-
rustup target add aarch64-apple-ios
29-
rustup target add x86_64-apple-ios

scripts/ios/build_all_campfire.sh

Lines changed: 0 additions & 22 deletions
This file was deleted.

scripts/ios/build_all_duo.sh

Lines changed: 0 additions & 26 deletions
This file was deleted.

scripts/linux/build_all.sh

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,29 @@
22

33
set -x -e
44

5+
APP="${1:-stack_wallet}"
6+
57
# for arm
68
# flutter-elinux clean
79
# flutter-elinux pub get
810
# flutter-elinux build linux --dart-define="IS_ARM=true"
911
mkdir -p build
1012
./build_secure_storage_deps.sh
1113

12-
# libepiccash requires old rust
1314
source ../rust_version.sh
14-
set_rust_version_for_libepiccash
15-
(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh )
16-
set_rust_version_for_libmwc
17-
(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh )
18-
# set rust (back) to a more recent stable release after building epiccash
15+
16+
if [[ "$APP" = "stack_wallet" ]]; then
17+
set_rust_version_for_libepiccash
18+
(cd ../../crypto_plugins/flutter_libepiccash/scripts/linux && ./build_all.sh )
19+
set_rust_version_for_libmwc
20+
(cd ../../crypto_plugins/flutter_libmwc/scripts/linux && ./build_all.sh )
21+
fi
22+
1923
set_rust_to_everything_else
2024

21-
(cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh )
25+
if [[ "$APP" = "stack_wallet" || "$APP" = "stack_duo" ]]; then
26+
(cd ../../crypto_plugins/frostdart/scripts/linux && ./build_all.sh )
27+
fi
2228

2329
./build_secp256k1.sh
2430

scripts/linux/build_all_campfire.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

scripts/linux/build_all_duo.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)