]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-22120 Update CFamily onboarding
authorLucas Paulger <lucas.paulger@sonarsource.com>
Tue, 4 Jun 2024 09:50:36 +0000 (12:50 +0300)
committersonartech <sonartech@sonarsource.com>
Wed, 5 Jun 2024 20:02:46 +0000 (20:02 +0000)
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/AzurePipelinesTutorial-it.tsx.snap
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/PrepareAnalysisCommand.tsx
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/__tests__/__snapshots__/BitbucketPipelinesTutorial-it.tsx.snap
server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/commands/CFamily.ts
server/sonar-web/src/main/js/components/tutorials/components/CompilationInfo.tsx
server/sonar-web/src/main/js/components/tutorials/github-action/__tests__/__snapshots__/GithubActionTutorial-it.tsx.snap
server/sonar-web/src/main/js/components/tutorials/github-action/commands/CFamily.tsx
server/sonar-web/src/main/js/components/tutorials/jenkins/__tests__/__snapshots__/JenkinsTutorial-it.tsx.snap
server/sonar-web/src/main/js/components/tutorials/jenkins/buildtool-steps/CFamilly.tsx
server/sonar-web/src/main/js/components/tutorials/other/commands/ExecScanner.tsx
sonar-core/src/main/resources/org/sonar/l10n/core.properties

index 74138a435b7fe6598727d853436293445dfccc00..bb4732751290c56f4adf9ac9f10d6b81a0357e74 100644 (file)
@@ -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>"`;
 
index c2cc50ae81d5ed789f79484ca17f23555c68f96d..f9eb7b633dd1926cf81b2107030e46d2595a6bc5 100644 (file)
@@ -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:
index 0b37b7731b542e122e85a4abf8905c6424b39f8e..827109d5f21a4e810e5509c690202ecadc224f2c 100644 (file)
@@ -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
 
index 8f74e2b6e9158b00e5c29685fd2cdb6d33c95ec7..ab6adff8e9ebdf7af36b697ab04fd4d3f34f30ea 100644 (file)
@@ -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
 
index 3b5e5aeea418584f94096e7e711bf05497cf1ab4..7b3b0e5e36d060a4b883eaf6185f8453f875be1a 100644 (file)
@@ -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>
   );
index cc2fd570a83c3120df200559bf9d177cc3508aad..eb5e451a53d460dcd42d9a849564c7c5751aa360 100644 (file)
@@ -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"`;
index 9f01849c1e2a716be4cbc6cb4fa197d21d50d8fc..7c8195a939e3b0b339599b7b2c8f2ea13b411c73 100644 (file)
@@ -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) {
index 26973bf7fce9b7181f672dfe766569bdf18c8df1..70cf5185828c09ef87114cd44f355c9f5d62d4dd 100644 (file)
@@ -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"
     }
   }
 }"
index e99fdd77ac709ae0fd669f51daeb288dc2b0153d..03669459838ea78a13496a9f3a943d4d98f96434 100644 (file)
@@ -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"
     }
   }
 }`,
index 41780dda9e66a5c66b597e9e72f25390c91c88e9..5a1d49f1384d4c2c98ab547a59d4dba71c9f1a21 100644 (file)
@@ -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,
   ];
index 7e383dd81ee87704d3b15c3bfb7cb7c57a2ace67..f29248383e739f5076cbc602d268b31091401271 100644 (file)
@@ -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.