Commit 07247322 authored by Sebastien Marchand's avatar Sebastien Marchand Committed by Commit Bot

Documents how to use compile_single_file in VSCode and Sublime.

This scripts lives in depot_tools.

Bug: 759146
Change-Id: I3877d3b53ef2f91b34cebb61b04e6f285a006ae7
Reviewed-on: https://chromium-review.googlesource.com/911428
Commit-Queue: Sébastien Marchand <sebmarchand@chromium.org>
Reviewed-by: default avatarLutz Justen <ljusten@chromium.org>
Reviewed-by: default avatarSasha Morrissey <sashab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#541885}
parent 23e967ba
......@@ -427,27 +427,6 @@ about it with this command: Windows: `git config --global core.excludesfile
%USERPROFILE%\.gitignore` Mac, Linux: `git config --global core.excludesfile
~/.gitignore`
### Build a single file
Copy the file `compile_current_file.py` to your Packages directory:
```shell
cd /path/to/chromium/src
cp tools/sublime/compile_current_file.py ~/.config/sublime-text-3/Packages/User
```
This will give you access to a command `"compile_current_file"`, which you can
then add to your `Preferences > Keybindings - User` file:
```json
[
{ "keys": ["ctrl+f7"], "command": "compile_current_file", "args": {"target_build": "Debug"} },
{ "keys": ["ctrl+shift+f7"], "command": "compile_current_file", "args": {"target_build": "Release"} },
]
```
You can then press those key combinations to compile the current file in the
given target build.
## Building inside Sublime
To build inside Sublime Text, we first have to create a new build system.
......@@ -523,6 +502,10 @@ build targets with `Ctrl + Shift + B`:
"name": "Browser Tests",
"cmd": ["ninja", "-j", "1000", "-C", "out/Debug", "browser_tests"],
},
{
"name": "Current file",
"cmd": ["compile_single_file", "--build-dir", "out/Debug", "--file-path", "$file"],
},
]
```
......
......@@ -352,6 +352,28 @@ You might have to adjust the commands to your situation and needs.
"file": 1, "severity": 3, "message": 4
}
}]
},
{
"taskName": "6-build_current_file",
"command": "compile_single_file --build-dir=out/Debug --file-path=${file}",
"isShellCommand": true,
"problemMatcher": [
{
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^../../(.*):(\\d+):(\\d+):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1, "line": 2, "column": 3, "severity": 4, "message": 5
}
},
{
"owner": "cpp",
"fileLocation": ["relative", "${workspaceRoot}"],
"pattern": {
"regexp": "^../../(.*?):(.*):\\s+(warning|\\w*\\s?error):\\s+(.*)$",
"file": 1, "severity": 3, "message": 4
}
}]
}]
}
```
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment