diff options
author | Lucas Paulger <lucas.paulger@sonarsource.com> | 2024-06-04 12:50:36 +0300 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2024-06-05 20:02:46 +0000 |
commit | eafc83c83cce70aed8a9261c26a13a834be95b68 (patch) | |
tree | 77b5ea6f6606bfb64ed599d85989f9a2a9dcff7b | |
parent | b7e5fcf95e8cce0a59991ea22fa2b3472749b0a9 (diff) | |
download | sonarqube-eafc83c83cce70aed8a9261c26a13a834be95b68.tar.gz sonarqube-eafc83c83cce70aed8a9261c26a13a834be95b68.zip |
SONAR-22120 Update CFamily onboarding
11 files changed, 33 insertions, 46 deletions
diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap index 74138a435b7..bb473275129 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`should render correctly and allow token generation: cfamily linux, copy additional properties 1`] = `"sonar.cfamily.build-wrapper-output=bw-output"`; +exports[`should render correctly and allow token generation: cfamily linux, copy additional properties 1`] = `"sonar.cfamily.compile-commands=bw-output/compile_commands.json"`; exports[`should render correctly and allow token generation: cfamily linux, copy build-wrapper command 1`] = `"./build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your build command here>"`; @@ -9,7 +9,7 @@ exports[`should render correctly and allow token generation: cfamily linux, copy unzip build-wrapper.zip" `; -exports[`should render correctly and allow token generation: cfamily mac, copy additional properties 1`] = `"sonar.cfamily.build-wrapper-output=bw-output"`; +exports[`should render correctly and allow token generation: cfamily mac, copy additional properties 1`] = `"sonar.cfamily.compile-commands=bw-output/compile_commands.json"`; exports[`should render correctly and allow token generation: cfamily mac, copy build-wrapper command 1`] = `"./build-wrapper-macosx-x86/build-wrapper-macosx-x86 --out-dir bw-output <your build command here>"`; @@ -18,7 +18,7 @@ exports[`should render correctly and allow token generation: cfamily mac, copy s unzip build-wrapper.zip" `; -exports[`should render correctly and allow token generation: cfamily win, copy additional properties 1`] = `"sonar.cfamily.build-wrapper-output=bw-output"`; +exports[`should render correctly and allow token generation: cfamily win, copy additional properties 1`] = `"sonar.cfamily.compile-commands=bw-output/compile_commands.json"`; exports[`should render correctly and allow token generation: cfamily win, copy build-wrapper command 1`] = `"build-wrapper-win-x86/build-wrapper-win-x86-64.exe --out-dir bw-output <your build command here>"`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx index c2cc50ae81d..f9eb7b633dd 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx @@ -41,7 +41,7 @@ export interface PrepareAnalysisCommandProps { export default function PrepareAnalysisCommand(props: PrepareAnalysisCommandProps) { const { buildTool, kind, projectKey, projectName } = props; - const ADDITIONAL_PROPERTY = 'sonar.cfamily.build-wrapper-output=bw-output'; + const ADDITIONAL_PROPERTY = 'sonar.cfamily.compile-commands=bw-output/compile_commands.json'; const MAVEN_GRADLE_PROPS_SNIPPET = `# Additional properties that will be passed to the scanner, # Put one key=value per line, example: diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap index 0b37b7731b5..827109d5f21 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap @@ -48,7 +48,7 @@ definitions: - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin" - <any step required before running your build, like ./configure> - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command> - - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output + - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json caches: sonar: ~/.sonar diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts index 8f74e2b6e91..ab6adff8e9e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts @@ -34,7 +34,7 @@ definitions: - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin" - <any step required before running your build, like ./configure> - $HOME/.sonar/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir bw-output <your clean build command> - - sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output + - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json caches: sonar: ~/.sonar diff --git a/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx b/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx index 3b5e5aeea41..7b3b0e5e36d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx @@ -48,19 +48,6 @@ export function CompilationInfo({ className = 'sw-my-2' }: CompilationInfoProps) }} /> </p> - <p> - <FormattedMessage - id="onboarding.tutorial.cfamilly.speed_caching" - defaultMessage={translate('onboarding.tutorial.cfamilly.speed_caching')} - values={{ - link: ( - <Link to={docUrl(DocLink.CFamilyAnalysisCache)}> - {translate('onboarding.tutorial.cfamilly.speed_caching.link')} - </Link> - ), - }} - /> - </p> </div> </FlagMessage> ); diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap index cc2fd570a83..eb5e451a53d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap @@ -83,7 +83,7 @@ jobs: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}} run: | - sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}"" + sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"" `; exports[`should follow and complete all steps: CFamily MacOS: .github/workflows/build.yml 1`] = ` @@ -119,7 +119,7 @@ jobs: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}} run: | - sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}"" + sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"" `; exports[`should follow and complete all steps: CFamily Windows: .github/workflows/build.yml 1`] = ` @@ -155,7 +155,7 @@ jobs: SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}} run: | - sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}"" + sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"" `; exports[`should follow and complete all steps: CFamily: sonar-project.properties 1`] = `"sonar.projectKey=my-project"`; diff --git a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx index 9f01849c1e2..7c8195a939e 100644 --- a/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx @@ -52,7 +52,7 @@ const STEPS = { SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}} run: | - sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}"`, + sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`, [OSs.MacOS]: ` - name: Install sonar-scanner and build-wrapper env: @@ -67,7 +67,7 @@ const STEPS = { SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}} run: | - sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}"`, + sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`, [OSs.Windows]: ` - name: Install sonar-scanner and build-wrapper env: @@ -82,7 +82,7 @@ const STEPS = { SONAR_TOKEN: \${{ secrets.SONAR_TOKEN }} SONAR_HOST_URL: \${{secrets.SONAR_HOST_URL}} run: | - sonar-scanner --define sonar.cfamily.build-wrapper-output="\${{ env.BUILD_WRAPPER_OUT_DIR }}"`, + sonar-scanner --define sonar.cfamily.compile-commands="\${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"`, }; export default function CFamily(props: CFamilyProps) { diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap index 26973bf7fce..70cf5185828 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap @@ -42,7 +42,7 @@ exports[`bitbucket: can select devops platform and complete all the steps with c stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -68,7 +68,7 @@ exports[`bitbucket: can select devops platform and complete all the steps with c stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -100,7 +100,7 @@ exports[`bitbucket: can select devops platform and complete all the steps with c stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -249,7 +249,7 @@ exports[`bitbucketcloud: can select devops platform and complete all the steps w stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -275,7 +275,7 @@ exports[`bitbucketcloud: can select devops platform and complete all the steps w stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -307,7 +307,7 @@ exports[`bitbucketcloud: can select devops platform and complete all the steps w stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -456,7 +456,7 @@ exports[`github: can select devops platform and complete all the steps with copy stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -482,7 +482,7 @@ exports[`github: can select devops platform and complete all the steps with copy stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -514,7 +514,7 @@ exports[`github: can select devops platform and complete all the steps with copy stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -663,7 +663,7 @@ exports[`gitlab: can select devops platform and complete all the steps with copy stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -689,7 +689,7 @@ exports[`gitlab: can select devops platform and complete all the steps with copy stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" @@ -721,7 +721,7 @@ exports[`gitlab: can select devops platform and complete all the steps with copy stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }" diff --git a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx index e99fdd77ac7..03669459838 100644 --- a/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx @@ -45,7 +45,7 @@ const YAML_MAP: Record<OSs, (baseUrl: string) => string> = { stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }`, @@ -68,7 +68,7 @@ const YAML_MAP: Record<OSs, (baseUrl: string) => string> = { stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + sh "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }`, @@ -97,7 +97,7 @@ const YAML_MAP: Record<OSs, (baseUrl: string) => string> = { stage('SonarQube Analysis') { def scannerHome = tool 'SonarScanner'; withSonarQubeEnv() { - powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.build-wrapper-output=bw-output" + powershell "\${scannerHome}/bin/sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json" } } }`, diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/ExecScanner.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/ExecScanner.tsx index 41780dda9e6..5a1d49f1384 100644 --- a/server/sonar-web/src/main/js/components/tutorials/other/commands/ExecScanner.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/other/commands/ExecScanner.tsx @@ -49,7 +49,9 @@ export default function ExecScanner(props: ExecScannerProps) { os === OSs.Windows ? 'sonar-scanner.bat' : 'sonar-scanner', '-D' + q(`sonar.projectKey=${component.key}`), '-D' + q('sonar.sources=.'), - cfamily ? '-D' + q('sonar.cfamily.build-wrapper-output=bw-output') : undefined, + cfamily + ? '-D' + q('sonar.cfamily.compile-commands=bw-output/compile_commands.json') + : undefined, '-D' + q(`sonar.host.url=${baseUrl}`), isLocal ? '-D' + q(`sonar.token=${token}`) : undefined, ]; diff --git a/sonar-core/src/main/resources/org/sonar/l10n/core.properties b/sonar-core/src/main/resources/org/sonar/l10n/core.properties index 7e383dd81ee..f29248383e7 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -4625,10 +4625,8 @@ onboarding.tutorial.ci_outro.refresh.why=If the page doesn't refresh after a whi onboarding.tutorial.other.project_key.sentence=Create a {file} file in your repository and paste the following code: onboarding.tutorial.other.project_key.monorepo.sentence=Create a {file} file at the root of your project and paste the following code: onboarding.tutorial.other.project_key.monorepo.info=Repeat this step for all the projects in your monorepo -onboarding.tutorial.cfamilly.compilation_database_info=If you have trouble using the build wrapper, you can try using a {link}. -onboarding.tutorial.cfamilly.compilation_database_info.link=compilation database -onboarding.tutorial.cfamilly.speed_caching=You can also speed up your analysis by enabling {link}. -onboarding.tutorial.cfamilly.speed_caching.link=multi-threading and caching +onboarding.tutorial.cfamilly.compilation_database_info=If you have trouble using the Build Wrapper, you can try one of the alternative methods to {link}. +onboarding.tutorial.cfamilly.compilation_database_info.link=generate a compilation database onboarding.tutorial.cfamily.examples_repositories_description=Check out our C and C++ sample projects with SonarQube analysis configured @@ -4983,7 +4981,7 @@ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.nix.s onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.win.sentence.inline=inline onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build_wrapper.ccpp.nix.sentence.inline=inline onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare.ccpp.sentence=Add a new {task} task {before} your build task. -onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp=In {additional} in the {advanced} section, add a new property to set the output directory to which the Build Wrapper should write its results: {property} {button} +onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp=In {additional} in the {advanced} section, add a new property: {property} {button} onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.additional=Additional Properties onboarding.tutorial.with.azure_pipelines.BranchAnalysis.prepare_additional.ccpp.advanced=Advanced onboarding.tutorial.with.azure_pipelines.BranchAnalysis.build.ccpp.sentence=Add or modify your build {task} task. For the analysis to happen, your build has to be run through a command line so that it can be wrapped-up by the build-wrapper. |