diff --git a/.github/workflows/dart_lint.yml b/.github/workflows/dart_lint.yml index 56cc033292..2b4a995cce 100644 --- a/.github/workflows/dart_lint.yml +++ b/.github/workflows/dart_lint.yml @@ -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 diff --git a/.github/workflows/dart_test.yml b/.github/workflows/dart_test.yml index 6ce615bedc..4f5ccf06ce 100644 --- a/.github/workflows/dart_test.yml +++ b/.github/workflows/dart_test.yml @@ -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 diff --git a/frontend/scripts/makefile/flutter.toml b/frontend/scripts/makefile/flutter.toml index 753b57132a..8e21a4d85c 100644 --- a/frontend/scripts/makefile/flutter.toml +++ b/frontend/scripts/makefile/flutter.toml @@ -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 """ ] \ No newline at end of file