File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,26 @@ commands that you can specify for compiled languages.
221221
222222 codeql database create java-database --language=java --command='ant -f build.xml'
223223
224+ - Project built using Bazel::
225+
226+ # Navigate to the Bazel workspace.
227+
228+ # Before building, remove cached objects
229+ # and stop all running Bazel server processes.
230+ bazel clean --expunge
231+
232+ # Build using the following Bazel flags, to help CodeQL detect the build:
233+ # `--spawn_strategy=local`: build locally, instead of using a distributed build
234+ # `--nouse_action_cache`: turn off build caching, which might prevent recompilation of source code
235+ # `--noremote_accept_cached`, `--noremote_upload_local_results`: avoid using a remote cache
236+ codeql database create new-database --language=<language> \
237+ --command='bazel build --spawn_strategy=local --nouse_action_cache --noremote_accept_cached --noremote_upload_local_results //path/to/package:target'
238+
239+ # After building, stop all running Bazel server processes.
240+ # This ensures future build commands start in a clean Bazel server process
241+ # without CodeQL attached.
242+ bazel shutdown
243+
224244- Project built using a custom build script::
225245
226246 codeql database create new-database --language=<language> --command='./scripts/build.sh'
You can’t perform that action at this time.
0 commit comments