tasks.json 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. {
  2. // See https://go.microsoft.com/fwlink/?LinkId=733558
  3. // for the documentation about the tasks.json format
  4. "version": "2.0.0",
  5. "tasks": [
  6. {
  7. "label": "mkdir",
  8. "type": "shell",
  9. "options": {
  10. "cwd": "${workspaceFolder}"
  11. },
  12. "command": "mkdir",
  13. "args": [
  14. "-Force",
  15. "build"
  16. ]
  17. },
  18. {
  19. "label": "qmake-debug",
  20. "type": "shell",
  21. "options": {
  22. "cwd": "${workspaceFolder}/build"
  23. },
  24. "command": "qmake",
  25. "args": [
  26. "../${workspaceFolderBasename}.pro",
  27. "-spec",
  28. "win32-g++",
  29. "\"CONFIG+=debug\"",
  30. "\"CONFIG+=console\""
  31. ],
  32. "dependsOn": [
  33. "mkdir"
  34. ]
  35. },
  36. {
  37. "label": "make-debug",
  38. "type": "shell",
  39. "options": {
  40. "cwd": "${workspaceFolder}/build"
  41. },
  42. "command": "mingw32-make",
  43. "args": [
  44. "-f",
  45. "Makefile.Debug",
  46. "-j7"
  47. ],
  48. "dependsOn": [
  49. "qmake-debug"
  50. ]
  51. },
  52. {
  53. "label": "run-debug",
  54. "type": "process",
  55. "options": {
  56. "cwd": "${workspaceFolder}/build/debug"
  57. },
  58. "command": "${workspaceFolder}/build/debug/${workspaceFolderBasename}.exe",
  59. "dependsOn": [
  60. "make-debug"
  61. ]
  62. },
  63. {
  64. "label": "qmake-release",
  65. "type": "shell",
  66. "options": {
  67. "cwd": "${workspaceFolder}/build"
  68. },
  69. "command": "qmake",
  70. "args": [
  71. "../${workspaceFolderBasename}.pro",
  72. "-spec",
  73. "win32-g++",
  74. "\"CONFIG+=qtquickcompiler\""
  75. ],
  76. "dependsOn": []
  77. },
  78. {
  79. "label": "make-release",
  80. "type": "shell",
  81. "options": {
  82. "cwd": "${workspaceFolder}/build"
  83. },
  84. "command": "mingw32-make",
  85. "args": [
  86. "-f",
  87. "Makefile.Release",
  88. "-j7"
  89. ],
  90. "dependsOn": [
  91. "qmake-release"
  92. ],
  93. "problemMatcher": [
  94. "$vite"
  95. ],
  96. "isBackground": true
  97. },
  98. {
  99. "label": "run-release",
  100. "type": "process",
  101. "options": {
  102. "cwd": "${workspaceFolder}/build/release"
  103. },
  104. "command": "${workspaceFolder}/build/release/${workspaceFolderBasename}.exe",
  105. "dependsOn": [
  106. "make-release"
  107. ]
  108. },
  109. {
  110. "label": "clean",
  111. "type": "shell",
  112. "options": {
  113. "cwd": "${workspaceFolder}/build"
  114. },
  115. "command": "mingw32-make",
  116. "args": [
  117. "clean"
  118. ]
  119. },
  120. {
  121. "type": "cppbuild",//任务类型,可以取cppbuild、shell、process,三种执行时稍有差异,这里选择默认cppbuild。
  122. "label": "build task 1",//任务标签(标记),也即任务名称,任务名称要和launch.json里的"preLaunchTask"值对应一致。
  123. "command": "cd ${fileDirname};mingw32-make",
  124. "args": [
  125. ],
  126. "options": {
  127. "cwd": "${workspaceFolder}"//当前工作目录(路径)。
  128. },
  129. "problemMatcher": ["$gcc"],//使用gcc的问题匹配器。
  130. "group": {
  131. "kind": "build",
  132. "isDefault": true
  133. },
  134. "detail": "Task generated by Debugger."
  135. }
  136. ]
  137. }