Skip to content

Commit

Permalink
Code review: improve README for use of "no Build Wrapper" vs "Build W…
Browse files Browse the repository at this point in the history
…rapper"
  • Loading branch information
antonioaversa committed Dec 12, 2024
1 parent 8072fc8 commit 7665391
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ sonar.sources=.
```

The workflow, usually declared under `.github/workflows`, looks like the following:
- for projects **not** written in C, C++, and Objective-C
- and for projects written in C, C++, and Objective-C and using [AutoConfig](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/languages/c-family/analysis-modes/#choosing-the-right-analysis-mode)
- for projects that don't have C, C++, or Objective-C in them
- for C, C++, Objective-C projects that don't use [Build Wrapper](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/languages/c-family/prerequisites/#using-buildwrapper)

```yaml
on:
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
SONAR_HOST_URL: ${{ vars.SONAR_HOST_URL }}
```
For C, C++ and Objective-C projects not using AutoConfig, the workflow requires additional steps to download the Build Wrapper and invoking it:
For C, C++, and Objective-C projects relying on [Build Wrapper](https://docs.sonarsource.com/sonarqube-server/latest/analyzing-source-code/languages/c-family/prerequisites/#using-buildwrapper) to generate the compilation database, the workflow requires additional steps to download the Build Wrapper and invoke it:
```yaml
# Trigger analysis when pushing to your main branches, and when creating a pull request.
Expand Down Expand Up @@ -118,7 +118,10 @@ jobs:
#Consult https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner/ for more information and options
```
If you are using SonarQube Server 10.5 or earlier, use `sonar.cfamily.build-wrapper-output` instead of `sonar.cfamily.compile-commands` in the `run` property of the last step, as Build Wrapper does not generate a compile_commands.json file before SonarQube Server 10.6, like this:
If you are using SonarQube Server 10.5 or earlier, use `sonar.cfamily.build-wrapper-output` instead of `sonar.cfamily.compile-commands` in the `args` property of the last step, as Build Wrapper does not generate a `compile_commands.json` file before SonarQube Server 10.6.

It should look like this:

```yaml
with:
args: |
Expand Down

0 comments on commit 7665391

Please sign in to comment.