{ // See https://go.microsoft.com/fwlink/?LinkId=733558 // for the documentation about the tasks.json format "version": "2.0.0", "tasks": [ { "label": "mkdir", "type": "shell", "options": { "cwd": "${workspaceFolder}" }, "command": "mkdir", "args": [ "-Force", "build" ] }, { "label": "qmake-debug", "type": "shell", "options": { "cwd": "${workspaceFolder}/build" }, "command": "qmake", "args": [ "../${workspaceFolderBasename}.pro", "-spec", "win32-g++", "\"CONFIG+=debug\"", "\"CONFIG+=console\"" ], "dependsOn": [ "mkdir" ] }, { "label": "make-debug", "type": "shell", "options": { "cwd": "${workspaceFolder}/build" }, "command": "mingw32-make", "args": [ "-f", "Makefile.Debug", "-j7" ], "dependsOn": [ "qmake-debug" ] }, { "label": "run-debug", "type": "process", "options": { "cwd": "${workspaceFolder}/build/debug" }, "command": "${workspaceFolder}/build/debug/${workspaceFolderBasename}.exe", "dependsOn": [ "make-debug" ] }, { "label": "qmake-release", "type": "shell", "options": { "cwd": "${workspaceFolder}/build" }, "command": "qmake", "args": [ "../${workspaceFolderBasename}.pro", "-spec", "win32-g++", "\"CONFIG+=qtquickcompiler\"" ], "dependsOn": [] }, { "label": "make-release", "type": "shell", "options": { "cwd": "${workspaceFolder}/build" }, "command": "mingw32-make", "args": [ "-f", "Makefile.Release", "-j7" ], "dependsOn": [ "qmake-release" ], "problemMatcher": [ "$vite" ], "isBackground": true }, { "label": "run-release", "type": "process", "options": { "cwd": "${workspaceFolder}/build/release" }, "command": "${workspaceFolder}/build/release/${workspaceFolderBasename}.exe", "dependsOn": [ "make-release" ] }, { "label": "clean", "type": "shell", "options": { "cwd": "${workspaceFolder}/build" }, "command": "mingw32-make", "args": [ "clean" ] }, { "type": "cppbuild",//任务类型,可以取cppbuild、shell、process,三种执行时稍有差异,这里选择默认cppbuild。 "label": "build task 1",//任务标签(标记),也即任务名称,任务名称要和launch.json里的"preLaunchTask"值对应一致。 "command": "cd ${fileDirname};mingw32-make", "args": [ ], "options": { "cwd": "${workspaceFolder}"//当前工作目录(路径)。 }, "problemMatcher": ["$gcc"],//使用gcc的问题匹配器。 "group": { "kind": "build", "isDefault": true }, "detail": "Task generated by Debugger." } ] }