Skip to content

Instantly share code, notes, and snippets.

@a-ignatov-parc
Last active July 24, 2020 12:32
Show Gist options
  • Save a-ignatov-parc/dd0fd6579071b2eb140f1c5c418d7c6c to your computer and use it in GitHub Desktop.
Save a-ignatov-parc/dd0fd6579071b2eb140f1c5c418d7c6c to your computer and use it in GitHub Desktop.
VSCode bazel autobuild
#!/bin/bash
{bash_runfiles}
runfiles_export_envvars
$(rlocation {cli}) --config $(rlocation {config}) {targets} | sed 's/^.*\.runfiles\/[^/]*\///g'
// Place your key bindings in this file to overwrite the defaults
[
{
"key": "cmd+s",
"command": "workbench.action.tasks.build"
}
]
{
"version": "2.0.0",
"tasks": [
{
"label": "Build TS",
"type": "shell",
"command": "./bazel query 'filter(\"ts_default_library\", kind(\"rule\", //...))' | xargs ./bazel build",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": "$tsc",
"presentation": {
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"runOptions": {
"runOn": "default"
}
},
{
"label": "Lint TS",
"type": "shell",
"command": "./bazel run //:lint",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": {
"base": "$eslint-stylish",
"fileLocation": ["relative", "${workspaceFolder}"],
},
"presentation": {
"reveal": "never",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"runOptions": {
"runOn": "default"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment