ci: generate freezed files

This commit is contained in:
Hieu 2022-02-23 20:32:53 +07:00
parent a0654d8a41
commit 6ae8efbdfe
3 changed files with 53 additions and 28 deletions

View File

@ -33,8 +33,11 @@ jobs:
working-directory: frontend/app_flowy
- name: Code Generate
working-directory: frontend/app_flowy
run:
flutter pub run easy_localization:generate --source-dir ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
run: |
flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
sed -i '/generate: true/s/true/false/g' pubspec.yaml
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: flutter analyze
working-directory: frontend/app_flowy
run: flutter analyze

View File

@ -33,8 +33,11 @@ jobs:
working-directory: frontend/app_flowy
- name: Code Generate
working-directory: frontend/app_flowy
run:
flutter pub run easy_localization:generate --source-dir ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
run: |
flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
sed -i '/generate: true/s/true/false/g' pubspec.yaml
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Build FlowySDK
working-directory: frontend
run: |

View File

@ -5,16 +5,16 @@ linux_alias = "appflowy-linux"
[tasks.appflowy-macos]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
script_runner = "@shell"
[tasks.appflowy-windows]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
[tasks.appflowy-linux]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product", "create-release-archive"] }
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product", "create-release-archive"] }
script_runner = "@shell"
[tasks.appflowy-dev]
@ -24,16 +24,16 @@ linux_alias = "appflowy-linux-dev"
[tasks.appflowy-macos-dev]
dependencies = ["flowy-sdk-dev"]
run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
script_runner = "@shell"
[tasks.appflowy-windows-dev]
dependencies = ["flowy-sdk-dev"]
run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
[tasks.appflowy-linux-dev]
dependencies = ["flowy-sdk-dev"]
run_task = { name = ["generate_language_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
script_runner = "@shell"
[tasks.copy-to-product]
@ -156,24 +156,6 @@ script = [
]
script_runner = "@duckscript"
[tasks.freeze_setup]
script = [
"""
flutter clean
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
""",
]
script_runner = "@shell"
[tasks.freeze_watch]
script = [
"""
flutter pub run build_runner watch
""",
]
script_runner = "@shell"
[tasks.generate_language_files]
script_runner = "@shell"
script = [
@ -198,3 +180,40 @@ script = [
exec cmd.exe /c flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations
"""
]
[tasks.generate_freezed_files]
script_runner = "@shell"
script = [
"""
cd app_flowy
flutter clean
sed -i '/generate: true/s/true/false/g' pubspec.yaml
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs
"""
]
# TODO: Add support for Windows.
# [tasks.generate_freezed_files.windows]
# script_runner = "@duckscript"
# script = [
# """
# cd ./app_flowy/
# exec cmd.exe /c flutter clean
# exec cmd.exe /c flutter pub get
# exec cmd.exe /c flutter pub run easy_localization:generate -S assets/translations/
# exec cmd.exe /c flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations
# """
# ]
[tasks.generate_freezed_files.macos]
script_runner = "@shell"
script = [
"""
cd app_flowy
flutter clean
sed -i '' '/generate: true/s/true/false/g' pubspec.yaml
flutter pub get
flutter packages pub run build_runner build --delete-conflicting-outputs
"""
]