version: '3'

tasks:
  build:
    cmds:
      - cp ./source.txt ./generated.txt
    sources:
      - ./**/glob-with-inexistent-file.txt
      - ./*.txt
      - exclude: ./ignore_me.txt
      - exclude: ./generated.txt
    generates:
      - ./generated.txt
    method: checksum
  build-*:
    cmds:
      - cp ./source.txt ./generated-{{index .MATCH 0}}.txt
    sources:
      - ./source.txt
    generates:
      - ./generated-{{index .MATCH 0}}.txt
  method: checksum

  build-with-status:
    cmds:
      - cp ./source.txt ./generated.txt
    sources:
      - ./source.txt
    status:
      - test -f ./generated.txt
