ci: refactor code generation

This commit is contained in:
Hieu 2022-02-24 14:40:48 +07:00
parent d05e4bbc82
commit 0c9fc35cb3
3 changed files with 18 additions and 44 deletions

View File

@ -29,15 +29,14 @@ jobs:
with:
channel: "stable"
- name: Deps Flutter
run: flutter pub get
run: flutter packages pub get
working-directory: frontend/app_flowy
- name: Code Generate
- name: Code Generation
working-directory: frontend/app_flowy
run: |
flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
flutter packages pub get
flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: flutter analyze
- name: Run Flutter Analyzer
working-directory: frontend/app_flowy
run: flutter analyze

View File

@ -29,13 +29,12 @@ jobs:
cargo make flowy_dev
echo PATH="$PATH":"$HOME/.pub-cache/bin" >> $GITHUB_PATH
- name: Deps Flutter
run: flutter pub get
run: flutter packages pub get
working-directory: frontend/app_flowy
- name: Code Generate
- name: Code Generation
working-directory: frontend/app_flowy
run: |
flutter pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
flutter packages pub get
flutter packages pub run easy_localization:generate -S ./assets/translations -f keys -O lib/generated -o locale_keys.g.dart
flutter packages pub run build_runner build --delete-conflicting-outputs
- name: Build FlowySDK
working-directory: frontend

View File

@ -5,16 +5,16 @@ linux_alias = "appflowy-linux"
[tasks.appflowy-macos]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] }
script_runner = "@shell"
[tasks.appflowy-windows]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] }
[tasks.appflowy-linux]
dependencies = ["flowy-sdk-release"]
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product", "create-release-archive"] }
run_task = { name = ["code_generation", "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", "generate_freezed_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] }
script_runner = "@shell"
[tasks.appflowy-windows-dev]
dependencies = ["flowy-sdk-dev"]
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] }
[tasks.appflowy-linux-dev]
dependencies = ["flowy-sdk-dev"]
run_task = { name = ["generate_language_files", "generate_freezed_files", "flutter-build", "copy-to-product"] }
run_task = { name = ["code_generation", "flutter-build", "copy-to-product"] }
script_runner = "@shell"
[tasks.copy-to-product]
@ -156,50 +156,26 @@ script = [
]
script_runner = "@duckscript"
[tasks.generate_language_files]
script_runner = "@shell"
script = [
"""
cd app_flowy
flutter clean
flutter pub get
flutter pub run easy_localization:generate -S assets/translations/
flutter pub run easy_localization:generate -f keys -o locale_keys.g.dart -S assets/translations -s en.json
"""
]
[tasks.generate_language_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]
[tasks.code_generation]
script_runner = "@shell"
script = [
"""
cd app_flowy
flutter clean
flutter packages pub get
flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
flutter packages pub run build_runner build --delete-conflicting-outputs
"""
]
[tasks.generate_freezed_files.windows]
[tasks.code_generation.windows]
script_runner = "@duckscript"
script = [
"""
cd ./app_flowy/
exec cmd.exe /c flutter clean
exec cmd.exe /c flutter packages pub get
exec cmd.exe /c flutter packages pub get
exec cmd.exe /c flutter pub get
exec cmd.exe /c flutter packages pub run easy_localization:generate -S assets/translations/ -f keys -o locale_keys.g.dart -S assets/translations -s en.json
exec cmd.exe /c flutter packages pub run build_runner build --delete-conflicting-outputs
"""
]