From 26f6be0ce6bd34a9da48e9462bade0d39ec5cd68 Mon Sep 17 00:00:00 2001 From: M Date: Tue, 11 Jan 2022 20:20:44 +0200 Subject: [PATCH] Update build scripts for android --- scripts/android/app_config.sh | 24 ++---------------------- scripts/android/inject_app_details.sh | 11 +++++++++++ scripts/android/pubspec_gen.sh | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+), 22 deletions(-) create mode 100755 scripts/android/inject_app_details.sh create mode 100755 scripts/android/pubspec_gen.sh diff --git a/scripts/android/app_config.sh b/scripts/android/app_config.sh index c72f8e8c0..80d057877 100755 --- a/scripts/android/app_config.sh +++ b/scripts/android/app_config.sh @@ -7,25 +7,5 @@ fi ./app_properties.sh ./app_icon.sh - -CONFIG_ARGS="" - -case $APP_ANDROID_TYPE in - $MONERO_COM) - CONFIG_ARGS="--monero" - ;; - $CAKEWALLET) - CONFIG_ARGS="--monero --bitcoin" - ;; -esac - -cd ../.. - -cp -rf pubspec_description.yaml pubspec.yaml -flutter pub get -flutter pub run tool/generate_pubspec.dart -flutter pub get -flutter packages pub run tool/configure.dart $CONFIG_ARGS - -sed -i "0,/version:/{s/version:.*/version: ${APP_ANDROID_VERSION}+${APP_ANDROID_BUILD_NUMBER}/}" ./pubspec.yaml -sed -i "0,/version:/{s/__APP_PACKAGE__/${APP_ANDROID_PACKAGE}/}" ./android/app/src/main/AndroidManifest.xml \ No newline at end of file +./pubspec_gen.sh +./inject_app_details.sh \ No newline at end of file diff --git a/scripts/android/inject_app_details.sh b/scripts/android/inject_app_details.sh new file mode 100755 index 000000000..6bcdf7239 --- /dev/null +++ b/scripts/android/inject_app_details.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +if [ -z "$APP_ANDROID_TYPE" ]; then + echo "Please set APP_ANDROID_TYPE" + exit 1 +fi + +cd ../.. +sed -i "0,/version:/{s/version:.*/version: ${APP_ANDROID_VERSION}+${APP_ANDROID_BUILD_NUMBER}/}" ./pubspec.yaml +sed -i "0,/version:/{s/__APP_PACKAGE__/${APP_ANDROID_PACKAGE}/}" ./android/app/src/main/AndroidManifest.xml +cd scripts/android \ No newline at end of file diff --git a/scripts/android/pubspec_gen.sh b/scripts/android/pubspec_gen.sh new file mode 100755 index 000000000..350aa664d --- /dev/null +++ b/scripts/android/pubspec_gen.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +MONERO_COM=monero.com +CAKEWALLET=cakewallet +CONFIG_ARGS="" + +case $APP_ANDROID_TYPE in + $MONERO_COM) + CONFIG_ARGS="--monero" + ;; + $CAKEWALLET) + CONFIG_ARGS="--monero --bitcoin" + ;; +esac + +cd ../.. +cp -rf pubspec_description.yaml pubspec.yaml +flutter pub get +flutter pub run tool/generate_pubspec.dart +flutter pub get +flutter packages pub run tool/configure.dart $CONFIG_ARGS +cd scripts/android \ No newline at end of file