Sanmill/flutter-init.sh

30 lines
695 B
Bash
Raw Normal View History

2021-01-24 12:56:14 +08:00
#!/bin/bash
ENV_FILE_PATH=assets/files
ENV_FILE=$ENV_FILE_PATH/environment_variables.txt
2021-05-28 00:27:11 +08:00
GEN_FILE_PATH=lib/generated
FLUTTER_VERSION_FILE=$GEN_FILE_PATH/flutter_version.dart
2021-03-21 21:38:28 +08:00
cd src/ui/flutter_app || exit
flutter config --no-analytics
flutter pub get
flutter gen-l10n
mkdir -p "$GEN_FILE_PATH" || true
echo "const Map<String, String> flutterVersion =" >"$FLUTTER_VERSION_FILE"
flutter --version --machine >>"$FLUTTER_VERSION_FILE"
echo ";" >>"$FLUTTER_VERSION_FILE"
2021-05-28 00:27:11 +08:00
mkdir -p "$ENV_FILE_PATH" || true
touch "$ENV_FILE"
export >"$ENV_FILE"
2021-05-28 00:27:11 +08:00
flutter pub global deactivate build_runner
flutter pub global activate build_runner
flutter pub run build_runner build --delete-conflicting-outputs