From eddbc984892cabe525ecc22f28031ca3ef9d136e Mon Sep 17 00:00:00 2001 From: Nguyen Thai Date: Tue, 8 Oct 2024 14:54:33 +0700 Subject: [PATCH] Simplified the prebuild script --- scripts/prebuild.sh | 49 +++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 33 deletions(-) diff --git a/scripts/prebuild.sh b/scripts/prebuild.sh index 5104c75d65..d8ed0dde05 100755 --- a/scripts/prebuild.sh +++ b/scripts/prebuild.sh @@ -4,36 +4,19 @@ set -e # debug log set -x -cd core -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -## Install necessary pods -# cd ../ios -# flutter pub get && pod install - -cd ../model -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -cd ../contact -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -cd ../forward -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -cd ../rule_filter -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -cd ../fcm -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -cd ../email_recovery -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -cd ../server_settings -flutter pub get && dart run build_runner build --delete-conflicting-outputs - -cd .. -flutter pub get \ - && dart run build_runner build --delete-conflicting-outputs \ - && dart run intl_generator:extract_to_arb --output-dir=./lib/l10n lib/main/localizations/app_localizations.dart \ - && dart run intl_generator:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/main/localizations/app_localizations.dart lib/l10n/intl*.arb +# Add additional modules to the end of this, seperated by space +modules=("core" "model" "contact" "forward" "rule_filter" "fcm" "email_recovery" "server_settings") + +for mod in "${modules[@]}"; do + ( + cd "$mod" + flutter pub get + dart run build_runner build --delete-conflicting-outputs + ) +done + +# For the parent module +flutter pub get +dart run build_runner build --delete-conflicting-outputs && + dart run intl_generator:extract_to_arb --output-dir=./lib/l10n lib/main/localizations/app_localizations.dart && + dart run intl_generator:generate_from_arb --output-dir=lib/l10n --no-use-deferred-loading lib/main/localizations/app_localizations.dart lib/l10n/intl*.arb