mirror of
https://github.com/github/codeql.git
synced 2026-06-16 10:21:09 +02:00
Update with Go custom build options
This commit is contained in:
@@ -165,13 +165,14 @@ build steps, you may need to explicitly define each step in the command line.
|
||||
|
||||
.. pull-quote:: Creating databases for Go
|
||||
|
||||
For Go, you should always use the CodeQL autobuilder. Install the Go
|
||||
toolchain (version 1.11 or later) and, if there are dependencies, the
|
||||
appropriate dependency manager (such as `dep
|
||||
For Go, install the Go toolchain (version 1.11 or later) and, if there
|
||||
are dependencies, the appropriate dependency manager (such as `dep
|
||||
<https://golang.github.io/dep/>`__).
|
||||
|
||||
Do not specify any build commands, as you will override the autobuilder
|
||||
invocation, which will create an empty database.
|
||||
The Go autobuilder attempts to automatically detect Go code in a repository,
|
||||
and only runs build scripts in an attempt to fetch dependencies. To force
|
||||
CodeQL to use your build script, set the environment variable
|
||||
`CODEQL_EXTRACTOR_GO_BUILD_TRACING=on` or pass a command.
|
||||
|
||||
Specifying build commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -200,6 +201,10 @@ commands that you can specify for compiled languages.
|
||||
|
||||
codeql database create csharp-database --language=csharp --command='dotnet build /p:UseSharedCompilation=false /t:rebuild'
|
||||
|
||||
- Go project built using a custom build script::
|
||||
|
||||
CODEQL_EXTRACTOR_GO_BUILD_TRACING=on codeql database create go-database --language=go --command='./scripts/build.sh'
|
||||
|
||||
- Java project built using Gradle::
|
||||
|
||||
codeql database create java-database --language=java --command='gradle clean test'
|
||||
|
||||
Reference in New Issue
Block a user