Skip to content

Commit

Permalink
feat(codeqlExecuteScan): added params projectSettingsFile and globalS…
Browse files Browse the repository at this point in the history
…ettingsFile (#4702)

* added settings file params

* added checking build tool
  • Loading branch information
daskuznetsova authored Dec 1, 2023
1 parent 8dc2a1b commit aab4de4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/codeqlExecuteScan.go
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,14 @@ func runCodeqlExecuteScan(config *codeqlExecuteScanOptions, telemetryData *telem

//codeql has an autobuilder which tries to build the project based on specified programming language
if len(config.BuildCommand) > 0 {
cmd = append(cmd, "--command="+config.BuildCommand)
buildCmd := config.BuildCommand
if len(config.ProjectSettingsFile) > 0 && config.BuildTool == "maven" {
buildCmd = fmt.Sprintf("%s --settings=%s", buildCmd, config.ProjectSettingsFile)
}
if len(config.GlobalSettingsFile) > 0 && config.BuildTool == "maven" {
buildCmd = fmt.Sprintf("%s --global-settings=%s", buildCmd, config.GlobalSettingsFile)
}
cmd = append(cmd, "--command="+buildCmd)
}

err = execute(utils, cmd, GeneralConfig.Verbose)
Expand Down
22 changes: 22 additions & 0 deletions cmd/codeqlExecuteScan_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions resources/metadata/codeqlExecuteScan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,26 @@ spec:
- PARAMETERS
- STAGES
- STEPS
- name: projectSettingsFile
type: string
description: Path to the mvn settings file that should be used as project settings file.
scope:
- GENERAL
- STEPS
- STAGES
- PARAMETERS
aliases:
- name: maven/projectSettingsFile
- name: globalSettingsFile
type: string
description: Path to the mvn settings file that should be used as global settings file.
scope:
- GENERAL
- STEPS
- STAGES
- PARAMETERS
aliases:
- name: maven/globalSettingsFile
containers:
- image: ""
outputs:
Expand Down

0 comments on commit aab4de4

Please sign in to comment.