From f02634f63599db37be8512124c25918e7120aae9 Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 21 May 2024 15:40:10 -0600 Subject: [PATCH] link assets based on config --- .gitignore | 4 ++ .../bundled_themes/stack_wallet}/dark.zip | Bin .../bundled_themes/stack_wallet}/light.zip | Bin .../icon/stack_wallet}/app_icon_alpha.png | Bin .../icon/stack_wallet}/icon.png | Bin .../icon/stack_wallet}/macos-icon.png | Bin .../icon/stack_wallet}/splash.png | Bin lib/utilities/assets.dart | 2 - pubspec.yaml | 2 +- scripts/android/build_all.sh | 4 +- scripts/android/build_all_duo.sh | 2 +- scripts/app_config/configure_duo.sh | 4 +- scripts/app_config/shared/link_assets.sh | 35 ++++++++++++++++++ scripts/ios/build_all.sh | 4 +- scripts/ios/build_all_duo.sh | 2 +- scripts/linux/build_all.sh | 4 +- scripts/linux/build_all_duo.sh | 2 +- scripts/macos/build_all.sh | 4 +- scripts/macos/build_all_duo.sh | 2 +- scripts/windows/build_all.sh | 4 +- scripts/windows/build_all_duo.sh | 2 +- 21 files changed, 63 insertions(+), 14 deletions(-) rename {assets/default_themes => asset_sources/bundled_themes/stack_wallet}/dark.zip (100%) rename {assets/default_themes => asset_sources/bundled_themes/stack_wallet}/light.zip (100%) rename {assets/icon => asset_sources/icon/stack_wallet}/app_icon_alpha.png (100%) rename {assets/icon => asset_sources/icon/stack_wallet}/icon.png (100%) rename {assets/icon => asset_sources/icon/stack_wallet}/macos-icon.png (100%) rename {assets/images => asset_sources/icon/stack_wallet}/splash.png (100%) create mode 100755 scripts/app_config/shared/link_assets.sh diff --git a/.gitignore b/.gitignore index ec9131840..3e7bee013 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,10 @@ test/services/coins/particl/particl_wallet_test_parameters.dart # Exceptions to above rules. !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages +# asset symlinks +/assets/default_themes +/assets/icon + # other coverage scripts/**/build diff --git a/assets/default_themes/dark.zip b/asset_sources/bundled_themes/stack_wallet/dark.zip similarity index 100% rename from assets/default_themes/dark.zip rename to asset_sources/bundled_themes/stack_wallet/dark.zip diff --git a/assets/default_themes/light.zip b/asset_sources/bundled_themes/stack_wallet/light.zip similarity index 100% rename from assets/default_themes/light.zip rename to asset_sources/bundled_themes/stack_wallet/light.zip diff --git a/assets/icon/app_icon_alpha.png b/asset_sources/icon/stack_wallet/app_icon_alpha.png similarity index 100% rename from assets/icon/app_icon_alpha.png rename to asset_sources/icon/stack_wallet/app_icon_alpha.png diff --git a/assets/icon/icon.png b/asset_sources/icon/stack_wallet/icon.png similarity index 100% rename from assets/icon/icon.png rename to asset_sources/icon/stack_wallet/icon.png diff --git a/assets/icon/macos-icon.png b/asset_sources/icon/stack_wallet/macos-icon.png similarity index 100% rename from assets/icon/macos-icon.png rename to asset_sources/icon/stack_wallet/macos-icon.png diff --git a/assets/images/splash.png b/asset_sources/icon/stack_wallet/splash.png similarity index 100% rename from assets/images/splash.png rename to asset_sources/icon/stack_wallet/splash.png diff --git a/lib/utilities/assets.dart b/lib/utilities/assets.dart index 9213fd1b2..ff557b46e 100644 --- a/lib/utilities/assets.dart +++ b/lib/utilities/assets.dart @@ -254,8 +254,6 @@ class _SVG { class _PNG { const _PNG(); - String get splash => "assets/images/splash.png"; - String get glasses => "assets/images/glasses.png"; String get glassesHidden => "assets/images/glasses-hidden.png"; String get mascot => "assets/images/mascot.png"; diff --git a/pubspec.yaml b/pubspec.yaml index a3fdcdf9d..d1ae29570 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -213,7 +213,7 @@ flutter_launcher_icons: image_path: assets/icon/macos-icon.png flutter_native_splash: - image: assets/images/splash.png + image: assets/icon/splash.png color: "F7F7F7" android_disable_fullscreen: true diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index 5da88e0e3..50dcdd7d6 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -1,6 +1,8 @@ #!/bin/bash -set -e +set -x -e + +../app_config/shared/link_assets.sh "stack_wallet" # libepiccash requires old rust source ../rust_version.sh diff --git a/scripts/android/build_all_duo.sh b/scripts/android/build_all_duo.sh index 12729db01..13424455a 100755 --- a/scripts/android/build_all_duo.sh +++ b/scripts/android/build_all_duo.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -x -e ../app_config/configure_duo.sh diff --git a/scripts/app_config/configure_duo.sh b/scripts/app_config/configure_duo.sh index e9dc81ce2..7605de750 100755 --- a/scripts/app_config/configure_duo.sh +++ b/scripts/app_config/configure_duo.sh @@ -1,6 +1,8 @@ #!/bin/bash -set -e +set -x -e + +../app_config/shared/link_assets.sh "stack_duo" # Configure files for Duo. export ORIGINAL_NAME="Stack Wallet" diff --git a/scripts/app_config/shared/link_assets.sh b/scripts/app_config/shared/link_assets.sh new file mode 100755 index 000000000..7c5ac2b4a --- /dev/null +++ b/scripts/app_config/shared/link_assets.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -x -e + +if [ $# -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + + +SELECT_ASSETS_DIR=$1 + +# set project root +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +pushd "${SCRIPT_DIR}/../../../" +PROJECT_ROOT="$(pwd)" +popd + +# declare full paths +ASSET_SOURCES_DIR="${PROJECT_ROOT}/asset_sources" +ASSETS_DIR="${PROJECT_ROOT}/assets" + +# finally update symlinks + +rm -f "${ASSETS_DIR}/default_themes" +ln -s "${ASSET_SOURCES_DIR}/bundled_themes/${SELECT_ASSETS_DIR}" "${ASSETS_DIR}/default_themes" + +rm -f "${ASSETS_DIR}/icon" +ln -s "${ASSET_SOURCES_DIR}/icon/${SELECT_ASSETS_DIR}" "${ASSETS_DIR}/icon" + + + + +# todo run flutter_native_splash +# todo run flutter_launcher_icons \ No newline at end of file diff --git a/scripts/ios/build_all.sh b/scripts/ios/build_all.sh index 8b03d1b6f..e1dc23d9b 100755 --- a/scripts/ios/build_all.sh +++ b/scripts/ios/build_all.sh @@ -1,6 +1,8 @@ #!/bin/bash -set -e +set -x -e + +../app_config/shared/link_assets.sh "stack_wallet" # libepiccash requires old rust source ../rust_version.sh diff --git a/scripts/ios/build_all_duo.sh b/scripts/ios/build_all_duo.sh index 0b264c541..bb1cb9290 100755 --- a/scripts/ios/build_all_duo.sh +++ b/scripts/ios/build_all_duo.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -x -e ../app_config/configure_duo.sh diff --git a/scripts/linux/build_all.sh b/scripts/linux/build_all.sh index d7c29e1b1..67e4f3066 100755 --- a/scripts/linux/build_all.sh +++ b/scripts/linux/build_all.sh @@ -1,6 +1,8 @@ #!/bin/bash -set -e +set -x -e + +../app_config/shared/link_assets.sh "stack_wallet" # libepiccash requires old rust source ../rust_version.sh diff --git a/scripts/linux/build_all_duo.sh b/scripts/linux/build_all_duo.sh index bbba76855..720d3c187 100755 --- a/scripts/linux/build_all_duo.sh +++ b/scripts/linux/build_all_duo.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -x -e ../app_config/configure_duo.sh diff --git a/scripts/macos/build_all.sh b/scripts/macos/build_all.sh index 59d1425c9..83191dcd2 100755 --- a/scripts/macos/build_all.sh +++ b/scripts/macos/build_all.sh @@ -1,6 +1,8 @@ #!/bin/bash -set -e +set -x -e + +../app_config/shared/link_assets.sh "stack_wallet" # libepiccash requires old rust source ../rust_version.sh diff --git a/scripts/macos/build_all_duo.sh b/scripts/macos/build_all_duo.sh index 08be98f32..43ef40d35 100755 --- a/scripts/macos/build_all_duo.sh +++ b/scripts/macos/build_all_duo.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -x -e ../app_config/configure_duo.sh diff --git a/scripts/windows/build_all.sh b/scripts/windows/build_all.sh index c055cb6c3..887c067ef 100755 --- a/scripts/windows/build_all.sh +++ b/scripts/windows/build_all.sh @@ -1,6 +1,8 @@ #!/bin/bash -set -e +set -x -e + +../app_config/shared/link_assets.sh "stack_wallet" # libepiccash requires old rust source ../rust_version.sh diff --git a/scripts/windows/build_all_duo.sh b/scripts/windows/build_all_duo.sh index 2f401237a..40b75c81d 100755 --- a/scripts/windows/build_all_duo.sh +++ b/scripts/windows/build_all_duo.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -e +set -x -e ../app_config/configure_duo.sh