---
version: '3'

tasks:
  build:
    deps:
      - :install:npm:ionic
    log:
      error: Error building Ionic project
      start: Building Ionic project
      success: Successfully built Ionic project
    cmds:
      - ionic build

  build:prod:
    deps:
      - :install:npm:ionic
    log:
      error: Error building Ionic production build
      start: Building Ionic project in production mode
      success: Successfully built Ionic project in production mode
    cmds:
      - ionic build --prod

  config:
    deps:
      - :install:npm:ionic
    log:
      error: Failed to configure Ionic
      start: Configuring Ionic
      success: Configured Ionic
    cmds:
      - ionic config set -g npmClient {{.NPM_PROGRAM}}

  prepare:
    deps:
      - :install:npm:ionic
    log:
      error: Failed to prepare with Cordova via Ionic
      start: Preparing Cordova targets via Ionic
      success: Successfully prepared Ionic Cordova targets
    cmds:
      - ionic cordova prepare android
      - ionic cordova prepare ios

  serve:
    deps:
      - :install:npm:ionic
    log:
      error: Failed to run `ionic serve`
      start: Running `ionic serve`
      success: Successfully finished running `ionic serve`
    cmds:
      - ionic serve
