{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Compile linux debug (single, jack)",
            "type": "shell",
            "command": "${config:build_linux_debug}; ${config:install_linux}",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile linux (single, jack)",
            "type": "shell",
            "command": "${config:build_linux_single}; ${config:install_linux}",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile linux (double, jack)",
            "type": "shell",
            "command": "${config:build_linux_double}; ${config:install_linux}",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile Windows (single)",
            "type": "shell",
            "command": "py -3.${input:pyMinVersion} setup.py bdist_wheel & py -3.${input:pyMinVersion} -m pip install --force-reinstall dist\\pyo-${config:pyo_version}-cp3${input:pyMinVersion}-cp3${input:pyMinVersion}-win_amd64.whl",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile Windows (double)",
            "type": "shell",
            "command": "py -3.${input:pyMinVersion} setup.py bdist_wheel --use-double & py -3.${input:pyMinVersion} -m pip install --force-reinstall dist\\pyo-${config:pyo_version}-cp3${input:pyMinVersion}-cp3${input:pyMinVersion}-win_amd64.whl",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile MacOS arm64 (single)",
            "type": "shell",
            "command": "/usr/local/bin/python3.${input:pyMinVersion} setup.py bdist_wheel --use-coreaudio -p macosx_13_0_universal2 && /usr/local/bin/python3.${input:pyMinVersion} -m pip install --user --force-reinstall dist/pyo-*-cp3${input:pyMinVersion}-cp3${input:pyMinVersion}-*_universal2.whl",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile MacOS arm64 (double)",
            "type": "shell",
            "command": "/usr/local/bin/python3.${input:pyMinVersion} setup.py bdist_wheel --use-coreaudio --use-double -p macosx_13_0_universal2 && /usr/local/bin/python3.${input:pyMinVersion} -m pip install --user --force-reinstall dist/pyo-*-cp3${input:pyMinVersion}-cp3${input:pyMinVersion}-*_universal2.whl",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile MacOS x86_64 (single)",
            "type": "shell",
            "command": "/usr/local/bin/python3.${input:pyMinVersion} setup.py bdist_wheel --use-coreaudio -p macosx_12_0_x86_64 && /usr/local/bin/python3.${input:pyMinVersion} -m pip install --user --force-reinstall dist/pyo-*-cp3${input:pyMinVersion}-cp3${input:pyMinVersion}-*_x86_64.whl",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Compile MacOS x86_64 (double)",
            "type": "shell",
            "command": "/usr/local/bin/python3.${input:pyMinVersion} setup.py bdist_wheel --use-coreaudio --use-double -p macosx_12_0_x86_64 && /usr/local/bin/python3.${input:pyMinVersion} -m pip install --user --force-reinstall dist/pyo-*-cp3${input:pyMinVersion}-cp3${input:pyMinVersion}-*_x86_64.whl",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Clean up linux",
            "type": "shell",
            "command": "rm -rf build dist",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Clean up Windows",
            "type": "shell",
            "command": "rd /s /q build dist",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Clean up MacOS",
            "type": "shell",
            "command": "rm -rf build dist",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Run unit tests linux",
            "type": "shell",
            "command": "jack_control stop; export -n PYO_SERVER_AUDIO; cd tests/pytests; python3 -m pytest -vv",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Run unit tests Windows",
            "type": "shell",
            "command": "cd tests/pytests & py -3.${input:pyMinVersion} -m pytest",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Run unit tests MacOS",
            "type": "shell",
            "command": "cd tests/pytests; /usr/local/bin/python3.${input:pyMinVersion} -m pytest",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Run unit tests with coverage (linux)",
            "type": "shell",
            "command": "cd tests/pytests; coverage run --source=pyo --omit=*/examples/*,*/editor/* -m pytest; coverage html",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Run EPyo",
            "type": "shell",
            "command": "cd ~ & epyo",
            "problemMatcher": [],
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        },
        {
            "label": "Build Documentation",
            "type": "shell",
            "command": "python3 build.py --${input:docFormat}",
            "problemMatcher": [],
            "options": {
                "cwd": "${workspaceFolder}/documentation"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            }
        }
    ],
    "inputs": [
        {
            "type": "pickString",
            "id": "pyMinVersion",
            "description": "Choose your python minor version...",
            "options": ["7", "8", "9", "10", "11"],
            "default": "9"
        },
        {
            "type": "pickString",
            "id": "docFormat",
            "description": "Choose the documentation format...",
            "options": ["html", "latex", "man"],
            "default": "html"
        }
    ]
}
