add master build script

This commit is contained in:
julian 2024-05-21 18:21:27 -06:00
parent ef293ac68e
commit ab2806a4b7
14 changed files with 74 additions and 42 deletions

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/shared/link_assets.sh "stack_wallet"
# libepiccash requires old rust
source ../rust_version.sh
set_rust_to_1671

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/configure_duo.sh
sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/build.gradle
sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/src/debug/AndroidManifest.xml
sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../android/app/src/main/AndroidManifest.xml

View file

@ -2,29 +2,24 @@
set -x -e
../app_config/shared/link_assets.sh "stack_duo"
# Configure files for Duo.
ORIGINAL_PUBSPEC_NAME="stackwallet"
NEW_PUBSPEC_NAME="stackduo"
export ORIGINAL_NAME="Stack Wallet"
export ORIGINAL_APP_ID="com.cypherstack.stackwallet"
export NEW_NAME="Stack Duo"
export NEW_APP_ID="com.cypherstack.stackduo"
export NEW_VERSION="2.0.0"
export NEW_BUILD="" # Will increment existing build # if empty.
# String replacements.
if [[ "$(uname)" == 'Darwin' ]]; then
# macos specific sed
sed -i '' 's/Wallet/Duo/g' ../../lib/app_config.dart
sed -i '' "s/${ORIGINAL_NAME}/${NEW_NAME}/g" ../../pubspec.yaml
sed -i '' "s/${ORIGINAL_PUBSPEC_NAME}/${NEW_PUBSPEC_NAME}/g" ../../pubspec.yaml
else
sed -i 's/Wallet/Duo/g' ../../lib/app_config.dart
sed -i "s/${ORIGINAL_NAME}/${NEW_NAME}/g" ../../pubspec.yaml
sed -i "s/${ORIGINAL_PUBSPEC_NAME}/${NEW_PUBSPEC_NAME}/g" ../../pubspec.yaml
fi
# Extract Duo images.
unzip -o stack_duo_assets.zip -d ../../
# Update version & build number.
./update_version.sh -v "${NEW_VERSION}" -b "${NEW_BUILD}"

View file

@ -7,18 +7,12 @@ if [ $# -ne 1 ]; then
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"
ASSET_SOURCES_DIR="${APP_PROJECT_ROOT_DIR}/asset_sources"
ASSETS_DIR="${APP_PROJECT_ROOT_DIR}/assets"
# finally update symlinks

66
scripts/build_app.sh Executable file
View file

@ -0,0 +1,66 @@
#!/usr/bin/env bash
set -x -e
# set project root
THIS_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
pushd "${THIS_SCRIPT_DIR}/../"
export APP_PROJECT_ROOT_DIR="$(pwd)"
popd
APP_PLATFORMS=("android" "ios" "macos" "linux" "windows")
APP_NAMED_IDS=("stack_wallet" "stack_duo")
# Function to display usage.
usage() {
echo "Usage: $0 -v <version> -b <build_number> -p <platform> -a <app>"
exit 1
}
# check for required number of args
if [ $# -ne 8 ]; then
usage
fi
unset -v APP_VERSION_STRING
unset -v APP_BUILD_NUMBER
unset -v APP_BUILD_PLATFORM
unset -v APP_NAMED_ID
# Parse command-line arguments.
while getopts "v:b:p:a:" opt; do
case "$opt" in
v) APP_VERSION_STRING="$OPTARG" ;;
b) APP_BUILD_NUMBER="$OPTARG" ;;
p) APP_BUILD_PLATFORM="$OPTARG" ;;
a) APP_NAMED_ID="$OPTARG" ;;
*) usage ;;
esac
done
if printf '%s\0' "${APP_PLATFORMS[@]}" | grep -Fxqz -- "${APP_BUILD_PLATFORM}"; then
pushd "${APP_PROJECT_ROOT_DIR}/scripts/${APP_BUILD_PLATFORM}"
else
echo "Invalid platform: ${APP_BUILD_PLATFORM}"
usage
fi
if printf '%s\0' "${APP_NAMED_IDS[@]}" | grep -Fxqz -- "${APP_NAMED_ID}"; then
"${APP_PROJECT_ROOT_DIR}/scripts/app_config/update_version.sh" -v "${APP_VERSION_STRING}" -b "${APP_BUILD_NUMBER}"
"${APP_PROJECT_ROOT_DIR}/scripts/app_config/shared/link_assets.sh" "${APP_NAMED_ID}"
else
echo "Invalid app id: ${APP_NAMED_ID}"
exit 1
fi
if [[ "$APP_NAMED_ID" = "stack_wallet" ]]; then
./build_all.sh
elif [[ "$APP_NAMED_ID" = "stack_duo" ]]; then
"${APP_PROJECT_ROOT_DIR}/scripts/app_config/configure_duo.sh"
./build_all_duo.sh
else
echo "Invalid app id: ${APP_NAMED_ID}"
exit 1
fi
popd

View file

@ -1,3 +0,0 @@
#!/bin/bash
dart run build_runner build --delete-conflicting-outputs

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/shared/link_assets.sh "stack_wallet"
# libepiccash requires old rust
source ../rust_version.sh
set_rust_to_1671

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/configure_duo.sh
# Configure ios for Duo.
sed -i '' "s/${ORIGINAL_NAME}/${NEW_NAME}/g" ../../ios/Runner/Info.plist
sed -i '' "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../ios/Runner.xcodeproj/project.pbxproj

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/shared/link_assets.sh "stack_wallet"
# libepiccash requires old rust
source ../rust_version.sh
set_rust_to_1671

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/configure_duo.sh
# Configure Linux for Duo.
sed -i "s/${ORIGINAL_APP_ID}/${NEW_APP_ID}/g" ../../linux/CMakeLists.txt
sed -i "s/${ORIGINAL_NAME}/${NEW_NAME}/g" ../../linux/my_application.cc

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/shared/link_assets.sh "stack_wallet"
# libepiccash requires old rust
source ../rust_version.sh
set_rust_to_1671

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/configure_duo.sh
# Configure macOS for Duo.
sed -i '' 's/com.cypherstack.stackWallet/com.cypherstack.stackDuo/g' ../../macos/Runner.xcodeproj/project.pbxproj

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/shared/link_assets.sh "stack_wallet"
# libepiccash requires old rust
source ../rust_version.sh
set_rust_to_1671

View file

@ -2,8 +2,6 @@
set -x -e
../app_config/configure_duo.sh
# Configure Windows for Duo.
sed -i 's/Stack Wallet/Stack Duo/g' ../../windows/runner/Runner.rc