version: '3'

tasks:
  build-backend:
    cmds:
      - rm gw
      - nimble build
  build-frontend:
    dir: ./web
    cmds:
      - pnpm install
      - pnpm run build
  dev-backend:
    cmds:
      - nimble c -d:usestd -r src/gw.nim -o:gw
  dev-frontend:
    dir: ./web
    cmds:
      - pnpm run dev
  docker-build-frontend:
    dir: ./web
    cmds:
      - pnpm install
      - pnpm run build
  docker-build-backend:
    cmds: 
      - rm gw | echo "has not been compiled before"
      - nimble -y build --gcc.path:"/usr/bin" --gcc.exe:"x86_64-alpine-linux-musl-gcc" --gcc.linkerexe:"x86_64-alpine-linux-musl-gcc" --gcc.options.always:"-static" --define:release --threads:on
