{
  // See https://go.microsoft.com/fwlink/?LinkId=733558
  // for the documentation about the tasks.json format
  "version": "2.0.0",
  "tasks": [
    {
      "label": "Build",
      "type": "shell",
      "options": {
        "env": {
          "BUILD_ARGS": "-G Ninja -f BUILD_TESTS=ON CMAKE_BUILD_TYPE=Debug ENABLE_NBAPI=ON",
          // "CMAKE_TOOLCHAIN_FILE": "${workspaceFolder}/tools/cmake/toolchain/openwrt.cmake",
          // "PRPLMESH_PLATFORM_TYPE": "ugw",
          // "PRPLMESH_PLATFORM_BASE_DIR": "/workspaces/ugw_sw/2020_09_17/openwrt",
          // "PRPLMESH_PLATFORM_BUILD_NAME": "target-mips_24kc+nomips16_musl_axepoint_gw_sec",
          // "PRPLMESH_PLATFORM_TOOLCHAIN": "toolchain-mips_24kc+nomips16_gcc-8.3.0_musl",
          // "PRPLMESH_PLATFORM_TOOLCHAIN_PREFIX": "mips-openwrt-linux-musl-"
        }
      },
      "linux": {
        "command": "[ -f /.dockerenv ] && { ./tools/maptools.py build ${BUILD_ARGS} || exit 1; } || ./tools/docker/build.sh ${BUILD_ARGS}"
      },
      "problemMatcher": [
        "$gcc"
      ],
      "group": {
        "kind": "build",
        "isDefault": true
      }
    },
    {
      "label": "Clean",
      "type": "shell",
      "linux": {
        "command": "rm",
        "args": [
          "-rf",
          "build"
        ]
      },
      "problemMatcher": []
    },
    {
      "label": "Run Containers",
      "type": "shell",
      "linux": {
        "command": "./tests/test_gw_repeater.sh",
        "args": [
          "-f",
          "-g",
          "gateway-${env:USER}",
          "-r",
          "repeater1-${env:USER}",
          "-r",
          "repeater2-${env:USER}",
          "--delay",
          "7"
        ],
        "options": {
          "env": {
            "VERBOSE": "true"
          }
        }
      },
      "problemMatcher": []
    },
    {
      "label": "Run boardfarm tests",
      "type": "shell",
      "linux": {
        "command": "./dctest.py"
      },
      "problemMatcher": []
    },
    {
      "label": "Run beerocks_cli",
      "type": "shell",
      "linux": {
        "command": "/usr/bin/docker",
        "args": [
          "exec",
          "-ti",
          "gateway-${env:USER}",
          "${workspaceFolder}/build/install/bin/beerocks_cli"
        ]
      },
      "problemMatcher": []
    },
    {
      "label": "SSH Server",
      "type": "shell",
      "linux": {
        "command": "/usr/sbin/service",
        "args": [
          "ssh",
          "${input:serviceOp}"
        ]
      },
      "problemMatcher": []
    },
    {
      "label": "Docker bridge",
      "type": "shell",
      "linux": {
        "command": "/usr/bin/docker",
        "args": [
          "network",
          "inspect",
          "prplMesh-net-${env:USER}",
          "|",
          "awk",
          "'/\\\"bridge\\\":/{print substr($2,2,length($2)-3)}'"
        ]
      },
      "problemMatcher": []
    },
    {
      "label": "Run cppcheck",
      "type": "shell",
      "linux": {
        "command": "./tools/docker/cppcheck.sh",
        "args": [
          "common",
          "framework",
          "controller"
        ]
      },
      "problemMatcher": []
    }
  ],
  "inputs": [
    {
      "type": "pickString",
      "id": "serviceOp",
      "description": "What would you like to do?",
      "options": [
        "start",
        "stop"
      ]
    }
  ]
}
