tasks.json 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. {
  2. "version": "2.0.0",
  3. "tasks": [
  4. {
  5. "label": "Build - Build project",
  6. "type": "shell",
  7. "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py build",
  8. "windows": {
  9. "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py build",
  10. "options": {
  11. "env": {
  12. "PATH": "${env:PATH};${config:idf.customExtraPaths}"
  13. }
  14. }
  15. },
  16. "options": {
  17. "env": {
  18. "PATH": "${env:PATH}:${config:idf.customExtraPaths}"
  19. }
  20. },
  21. "problemMatcher": [
  22. {
  23. "owner": "cpp",
  24. "fileLocation": [
  25. "autoDetect",
  26. "${workspaceFolder}"
  27. ],
  28. "pattern": {
  29. "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
  30. "file": 1,
  31. "line": 2,
  32. "column": 3,
  33. "severity": 4,
  34. "message": 5
  35. }
  36. }
  37. ],
  38. "group": {
  39. "kind": "build",
  40. "isDefault": true
  41. }
  42. },
  43. {
  44. "label": "Set ESP-IDF Target",
  45. "type": "shell",
  46. "command": "${command:espIdf.setTarget}",
  47. "problemMatcher": {
  48. "owner": "cpp",
  49. "fileLocation": [
  50. "autoDetect",
  51. "${workspaceFolder}"
  52. ],
  53. "pattern": {
  54. "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
  55. "file": 1,
  56. "line": 2,
  57. "column": 3,
  58. "severity": 4,
  59. "message": 5
  60. }
  61. }
  62. },
  63. {
  64. "label": "Clean - Clean the project",
  65. "type": "shell",
  66. "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py fullclean",
  67. "windows": {
  68. "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py fullclean",
  69. "options": {
  70. "env": {
  71. "PATH": "${env:PATH};${config:idf.customExtraPaths}"
  72. }
  73. }
  74. },
  75. "options": {
  76. "env": {
  77. "PATH": "${env:PATH}:${config:idf.customExtraPaths}"
  78. }
  79. },
  80. "problemMatcher": [
  81. {
  82. "owner": "cpp",
  83. "fileLocation": [
  84. "autoDetect",
  85. "${workspaceFolder}"
  86. ],
  87. "pattern": {
  88. "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
  89. "file": 1,
  90. "line": 2,
  91. "column": 3,
  92. "severity": 4,
  93. "message": 5
  94. }
  95. }
  96. ]
  97. },
  98. {
  99. "label": "Flash - Flash the device",
  100. "type": "shell",
  101. "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} -b ${config:idf.flashBaudRate} flash",
  102. "windows": {
  103. "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py flash -p ${config:idf.portWin} -b ${config:idf.flashBaudRate}",
  104. "options": {
  105. "env": {
  106. "PATH": "${env:PATH};${config:idf.customExtraPaths}"
  107. }
  108. }
  109. },
  110. "options": {
  111. "env": {
  112. "PATH": "${env:PATH}:${config:idf.customExtraPaths}"
  113. }
  114. },
  115. "problemMatcher": [
  116. {
  117. "owner": "cpp",
  118. "fileLocation": [
  119. "autoDetect",
  120. "${workspaceFolder}"
  121. ],
  122. "pattern": {
  123. "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
  124. "file": 1,
  125. "line": 2,
  126. "column": 3,
  127. "severity": 4,
  128. "message": 5
  129. }
  130. }
  131. ]
  132. },
  133. {
  134. "label": "Monitor: Start the monitor",
  135. "type": "shell",
  136. "command": "${config:idf.pythonBinPath} ${config:idf.espIdfPath}/tools/idf.py -p ${config:idf.port} monitor",
  137. "windows": {
  138. "command": "${config:idf.pythonBinPathWin} ${config:idf.espIdfPathWin}\\tools\\idf.py -p ${config:idf.portWin} monitor",
  139. "options": {
  140. "env": {
  141. "PATH": "${env:PATH};${config:idf.customExtraPaths}"
  142. }
  143. }
  144. },
  145. "options": {
  146. "env": {
  147. "PATH": "${env:PATH}:${config:idf.customExtraPaths}"
  148. }
  149. },
  150. "problemMatcher": [
  151. {
  152. "owner": "cpp",
  153. "fileLocation": [
  154. "autoDetect",
  155. "${workspaceFolder}"
  156. ],
  157. "pattern": {
  158. "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
  159. "file": 1,
  160. "line": 2,
  161. "column": 3,
  162. "severity": 4,
  163. "message": 5
  164. }
  165. }
  166. ],
  167. "dependsOn": "Flash - Flash the device"
  168. },
  169. {
  170. "label": "OpenOCD: Start openOCD",
  171. "type": "shell",
  172. "presentation": {
  173. "echo": true,
  174. "reveal": "never",
  175. "focus": false,
  176. "panel": "new"
  177. },
  178. "command": "openocd -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}",
  179. "windows": {
  180. "command": "openocd.exe -s ${command:espIdf.getOpenOcdScriptValue} ${command:espIdf.getOpenOcdConfigs}",
  181. "options": {
  182. "env": {
  183. "PATH": "${env:PATH};${config:idf.customExtraPaths}"
  184. }
  185. }
  186. },
  187. "options": {
  188. "env": {
  189. "PATH": "${env:PATH}:${config:idf.customExtraPaths}"
  190. }
  191. },
  192. "problemMatcher": {
  193. "owner": "cpp",
  194. "fileLocation": [
  195. "autoDetect",
  196. "${workspaceFolder}"
  197. ],
  198. "pattern": {
  199. "regexp": "^(.*?):(\\d+):(\\d*):?\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
  200. "file": 1,
  201. "line": 2,
  202. "column": 3,
  203. "severity": 4,
  204. "message": 5
  205. }
  206. }
  207. },
  208. {
  209. "label": "adapter",
  210. "type": "shell",
  211. "command": "${config:idf.pythonBinPath}",
  212. "isBackground": true,
  213. "options": {
  214. "env": {
  215. "PATH": "${env:PATH}:${config:idf.customExtraPaths}",
  216. "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter"
  217. }
  218. },
  219. "problemMatcher": {
  220. "background": {
  221. "beginsPattern": "\bDEBUG_ADAPTER_STARTED\b",
  222. "endsPattern": "DEBUG_ADAPTER_READY2CONNECT",
  223. "activeOnStart": true
  224. },
  225. "pattern": {
  226. "regexp": "(\\d+)-(\\d+)-(\\d+)\\s(\\d+):(\\d+):(\\d+),(\\d+)\\s-(.+)\\s(ERROR)",
  227. "file": 8,
  228. "line": 2,
  229. "column": 3,
  230. "severity": 4,
  231. "message": 9
  232. }
  233. },
  234. "args": [
  235. "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter_main.py",
  236. "-e",
  237. "${workspaceFolder}/build/${command:espIdf.getProjectName}.elf",
  238. "-s",
  239. "${command:espIdf.getOpenOcdScriptValue}",
  240. "-ip",
  241. "localhost",
  242. "-dn",
  243. "${config:idf.adapterTargetName}",
  244. "-om",
  245. "connect_to_instance"
  246. ],
  247. "windows": {
  248. "command": "${config:idf.pythonBinPathWin}",
  249. "options": {
  250. "env": {
  251. "PATH": "${env:PATH};${config:idf.customExtraPaths}",
  252. "PYTHONPATH": "${command:espIdf.getExtensionPath}/esp_debug_adapter/debug_adapter"
  253. }
  254. }
  255. }
  256. }
  257. ]
  258. }