name: weblibre_project

environment:
  sdk: '>=3.8.0 <4.0.0'
workspace:
  - app/
  - packages/flutter_mozilla_components
  - packages/flutter_mozilla_components/example
  - packages/pluggable_transports_proxy
  - packages/simple_intent_receiver
  - packages/simple_intent_receiver/example
  - packages/tor
  - packages/locale_resolver
  - packages/locale_resolver/example
dev_dependencies:
  melos: ^7.3.0

melos:
  name: weblibre_project

  command:
    clean:
      hooks:
        pre: melos exec -c 1 -- "flutter clean"

  scripts:
    upgrade-major-tighten:
      run: |
        dart pub upgrade --major-versions --tighten
      exec:
        concurrency: 1
    validate-dependencies:
      description: Validates dependcies in the workspace
      packageFilters:
        noDependsOn: melos
      exec: |
        dart pub global run dependency_validator
    build-watch:
      description: Generate and watch files with build_runner in the workspace
      packageFilters:
        dependsOn: build_runner
      exec: |
        dart run build_runner watch --delete-conflicting-outputs
    build:
      description: Generate files with build_runner in the workspace
      packageFilters:
        dependsOn: build_runner
      run: |
        dart run build_runner build --delete-conflicting-outputs
      exec:
        failFast: true
        concurrency: 1
    build-pigeons:
      description: Running pigeon for files in pigeons directory
      exec: |
        echo "Running pigeon for files in pigeons directory:"
        for file in ./pigeons/*; do
          if [ -f "\$file" ]; then
            echo "Processing \$file"
            flutter pub run pigeon --input "\$file"
          fi
        done
      packageFilters:
        dirExists: 'pigeons'
