1{ 2 // Note! 3 // You can set the value used for ${config:chrome.outputDir} in your settings.json 4 // file with a line like: 5 // "chrome.outputDir": "/path/to/chromium/src/out/Debug", 6 "version": "2.0.0", 7 "runner": "terminal", 8 // The default problem matcher matches build output, which is useful for most tasks. 9 "problemMatcher": [ 10 { 11 "owner": "cpp", 12 "fileLocation": ["relative", "${config:chrome.outputDir}"], 13 "pattern": { 14 "regexp": "^(gen/.*):(\\d+):(\\d+):\\s+(warning|\\w*\\s?error):\\s+(.*)$", 15 "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 16 } 17 }, 18 { 19 "owner": "cpp", 20 "fileLocation": ["relative", "${workspaceRoot}"], 21 "pattern": { 22 "regexp": "^../../(.*):(\\d+):(\\d+):\\s+(warning|\\w*\\s?error):\\s+(.*)$", 23 "file": 1, "line": 2, "column": 3, "severity": 4, "message": 5 24 } 25 }, 26 { 27 "owner": "cpp", 28 "fileLocation": ["relative", "${config:chrome.outputDir}"], 29 "pattern": { 30 "regexp": "^(gen/.*?):(.*):\\s+(warning|\\w*\\s?error):\\s+(.*)$", 31 "file": 1, "severity": 3, "message": 4 32 } 33 }, 34 { 35 "owner": "cpp", 36 "fileLocation": ["relative", "${workspaceRoot}"], 37 "pattern": { 38 "regexp": "^../../(.*?):(.*):\\s+(warning|\\w*\\s?error):\\s+(.*)$", 39 "file": 1, "severity": 3, "message": 4 40 } 41 } 42 ], 43 "options": { 44 // It's important to set the CWD to the output directory so that file paths 45 // are linked correctly in the terminal output. 46 "cwd": "${config:chrome.outputDir}" 47 }, 48 49 "inputs": [ 50 { 51 // See 'Set Chrome Output Directory'. 52 "type": "pickString", 53 "id": "chromeOutputDir", 54 "description": "Chrome output directory:", 55 // Configure this to point to all the output directories you use. 56 "options": [ 57 "/path/to/chromium/src/out/pc", 58 "/path/to/chromium/src/out/Debug", 59 "/path/to/chromium/src/out/Debug_x86" 60 ] 61 } 62 ], 63 "tasks": [ 64 // Set the Chrome output directory to be used in future task runs. 65 // This uses a symbolic link to remember the current output directory. 66 // If you want to use this, make sure chrome.outputDir is configured to 67 // point to the link created at ${workspaceFolder}/out/current_link. 68 69 // Alternatively: 70 // * If you want to be prompted for the output directory each 71 // time you run a command, replace 72 // ${config:chrome.outputDir} 73 // with 74 // ${input:chromeOutputDir} 75 // everywhere in this file. 76 // 77 // * If you want to have different tasks for different output directories, 78 // just create duplicate tasks and hard-code the output directory used. 79 80 { 81 "label": "0-set_chrome_output_directory", 82 "command": "rm -f ${workspaceFolder}/out/current_link; ln -s ${input:chromeOutputDir} ${workspaceFolder}/out/current_link", 83 "type": "shell", 84 // The default problem matcher doesn't make sense here, so remove it. 85 "problemMatcher": [], 86 "options": { 87 "cwd": "${workspaceFolder}" 88 } 89 }, 90 // Some general-purpose build and test tasks. These all inherit the 91 // problemMatcher at the top of the file. 92 { 93 "label": "1-build_chrome", 94 "type": "shell", 95 "command": "autoninja -C ${config:chrome.outputDir} chrome", 96 "group": "test" 97 }, 98 { 99 "label": "2-build_all", 100 "type": "shell", 101 "command": "autoninja -C ${config:chrome.outputDir}" 102 }, 103 { 104 "label": "3-test_current_file", 105 "type": "shell", 106 "command": "${workspaceFolder}/tools/autotest.py -C ${config:chrome.outputDir} --run_all ${file}" 107 }, 108 { 109 "label": "4-test_current_directory", 110 "type": "shell", 111 "command": "${workspaceFolder}/tools/autotest.py -C ${config:chrome.outputDir} --run_all ${fileDirname}" 112 }, 113 { 114 "label": "5-build_current_file", 115 "type": "shell", 116 "command": "compile_single_file --build-dir=${config:chrome.outputDir} --file-path=${file}" 117 }, 118 // Some more specific build tasks, which hard-code the output directory. 119 { 120 "label": "6-build_chrome_debug", 121 "type": "shell", 122 "command": "autoninja -C ${workspaceFolder}/out/Debug chrome" 123 }, 124 { 125 "label": "7-build_chrome_release", 126 "type": "shell", 127 "command": "autoninja -C ${workspaceFolder}/out/Release chrome" 128 }, 129 { 130 "label": "8-build_test_debug", 131 "type": "shell", 132 "command": "autoninja -C ${workspaceFolder}/out/Debug unit_tests components_unittests browser_tests" 133 } 134 ] 135} 136