Skip to content

Commit

Permalink
Simplified the prebuild script
Browse files Browse the repository at this point in the history
  • Loading branch information
Nguyen Thai committed Oct 9, 2024
1 parent b124692 commit eddbc98
Showing 1 changed file with 16 additions and 33 deletions.
49 changes: 16 additions & 33 deletions scripts/prebuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit eddbc98

Please sign in to comment.