Browse Source

tool: melos handle l10n, build_runner and formatting

pull/414/head
Nikolas Rimikis 1 year ago
parent
commit
bd5f80c135
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 3
      melos.yaml
  2. 0
      packages/neon/neon/build.yaml
  3. 8
      tool/format.sh
  4. 3
      tool/generate-app.sh
  5. 14
      tool/generate-localizations.sh
  6. 6
      tool/generate-neon.sh
  7. 4
      tool/generate-nextcloud.sh

3
melos.yaml

@ -19,6 +19,9 @@ ide:
enabled: false enabled: false
scripts: scripts:
format: dart format --fix --line-length 120 .
format-check: dart format --output=none --set-exit-if-changed --line-length 120 . format-check: dart format --output=none --set-exit-if-changed --line-length 120 .
analyze: dart analyze --fatal-infos . analyze: dart analyze --fatal-infos .
test: melos exec --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=$(nproc --all)" test: melos exec --concurrency=1 --fail-fast --dir-exists=test -- "flutter test --concurrency=$(nproc --all)"
generate:neon:build_runner: melos exec --scope="neon*" --file-exists="build.yaml" -- dart run build_runner build --delete-conflicting-outputs && melos run format
generate:neon:l10n: melos exec --flutter --dir-exists="lib/l10n" flutter gen-l10n && melos run format

0
packages/neon/neon/build.yaml

8
tool/format.sh

@ -1,8 +0,0 @@
#!/bin/bash
set -euxo pipefail
cd "$(dirname "$0")/.."
(
cd packages
fvm dart format --fix --line-length 120 .
)

3
tool/generate-app.sh

@ -37,7 +37,4 @@ function export_mipmap_icon_all() {
wait wait
fvm dart run flutter_native_splash:create fvm dart run flutter_native_splash:create
fvm flutter gen-l10n
) )
./tool/format.sh

14
tool/generate-localizations.sh

@ -1,14 +0,0 @@
#!/bin/bash
set -euxo pipefail
cd "$(dirname "$0")/.."
for package in packages/neon/*; do
(
cd "$package"
fvm flutter gen-l10n
) &
done
wait
./tool/format.sh

6
tool/generate-neon.sh

@ -33,8 +33,8 @@ copy_nextcloud_app_svg notifications external/nextcloud-notifications
# Nextcloud logo # Nextcloud logo
wget https://raw.githubusercontent.com/nextcloud/promo/master/nextcloud-logo-inverted.svg -O assets/logo_nextcloud.svg wget https://raw.githubusercontent.com/nextcloud/promo/master/nextcloud-logo-inverted.svg -O assets/logo_nextcloud.svg
fvm dart run build_runner build --delete-conflicting-outputs melos run generate:neon:build_runner
fvm flutter gen-l10n melos run generate:neon:l10n
) )
./tool/format.sh melos run format

4
tool/generate-nextcloud.sh

@ -66,7 +66,7 @@ jq \
fvm dart pub run build_runner build --delete-conflicting-outputs fvm dart pub run build_runner build --delete-conflicting-outputs
# For some reason we need to fix and format twice, otherwise not everything gets fixed # For some reason we need to fix and format twice, otherwise not everything gets fixed
fvm dart fix --apply lib/src/nextcloud.openapi.dart fvm dart fix --apply lib/src/nextcloud.openapi.dart
../../tool/format.sh melos run format
fvm dart fix --apply lib/src/nextcloud.openapi.dart fvm dart fix --apply lib/src/nextcloud.openapi.dart
../../tool/format.sh melos run format
) )

Loading…
Cancel
Save