{
    "folders": [
        {
            "path": "."
        }
    ],
    "settings": {
        "cargo_task": [
            "./ all!Unix: All",
            "cpp_out all!Unix: cpp_out",
            "mkoverlay all!Unix: mkoverlay",
            "psxcdgen_ex all!Unix: psxcdgen_ex",
            "psxcdread all!Unix: psxcdread",
            "psxfileconv all!Unix: psxfileconv",
            "psxreadmap all!Unix: psxreadmap",
            "wslpath all!Unix: wslpath",

            "./ all-windows!Windows: All",
            "cpp_out all-windows!Windows: cpp_out",
            "mkoverlay all-windows!Windows: mkoverlay",
            "psxcdgen_ex all-windows!Windows: psxcdgen_ex",
            "psxcdread all-windows!Windows: psxcdread",
            "psxfileconv all-windows!Windows: psxfileconv",
            "psxreadmap all-windows!Windows: psxreadmap",
            "wslpath all-windows!Windows: wslpath"
        ]
    },
    "tasks": {
        "version": "2.0.0",
        "tasks": [
            {
                "label": "cargo",
                "type": "shell",
                "group": {
                    "kind": "build"
                },
                "windows": {
                    "command": "wsl --shell-type login make -C ${input:windows_cargo_task} CARGO_CMD=${input:cargo cmd} BUILD_PROFILE=${input:build cfg}"
                },
                "linux":   {
                    "command": "make -C ${input:linux_cargo_task} BUILD_PROFILE=${input:build cfg}"
                },
                "problemMatcher": []
            }
        ],
        "inputs": [
            {
                "id": "windows_cargo_task",
                "type": "command",
                "command": "shellCommand.execute",
                "args": {
                    "command": "powershell",
                    "commandArgs": ["-command", "'${config:cargo_task}'.Replace(',',\"`n\")"],
                    "fieldSeparator": "!"
                }
            },
            {
                "id": "linux_cargo_task",
                "type": "command",
                "command": "shellCommand.execute",
                "args": {
                    "command": "echo ${config:cargo_task} | tr , \\\\n",
                    "fieldSeparator": "!"
                }
            },
            {
                "id": "build cfg",
                "type": "pickString",
                "options": ["debug", "release"],
                "default": "release",
                "description": "build configuration"
            },
            {
                "id": "cargo cmd",
                "type":"pickString",
                "options": ["build", "check", "update", "clean", "run", "tree"],
                "default": "build",
                "description": "cargo command to run"
            }
        ]
    }
}