version: 3

vars:
  RED: '\033[0;31m'
  GREEN: '\033[0;32m'
  COLOROFF: '\033[0m'
  PREFIX: "⏳"

silent: true

tasks:
  get:
    desc: Getting latest dependencies
    aliases: [g]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Getting latest dependencies...{{.COLOROFF}}"
      - flutter pub get

  upgrade:
    desc: Upgrading dependencies
    aliases: [u]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Upgrading dependencies...{{.COLOROFF}}"
      - flutter pub upgrade

  upgrade-major:
    desc: Upgrading dependencies
    aliases: [um]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Upgrading dependencies --major-versions...{{.COLOROFF}}"
      - flutter pub upgrade --major-versions

  outdated:
    desc: Checking for outdated dependencies
    deps: [upgrade]
    aliases: [o]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Checking for outdated dependencies...{{.COLOROFF}}"
      - flutter pub upgrade
  
  validate:
    desc: Running dependency validator
    deps: [get]
    aliases: [v]
    cmds:
      - echo -e "{{.GREEN}}{{.PREFIX}} Validating dependencies...{{.COLOROFF}}"
      - flutter pub run dependency_validator
