From ccddfdeb60851b080da0d49d8611f47ee162a37f Mon Sep 17 00:00:00 2001 From: Vincenzo Pellegrini Date: Thu, 20 Jun 2024 14:48:44 +0200 Subject: [PATCH] SONAR-22427 Adapt Onboarding tutorials for CFamily Linux ARM64 (#11286) --- .../bitbucket-pipelines/AnalysisCommand.tsx | 40 +++++++++++++++++- .../BitbucketPipelinesTutorial-it.tsx.snap | 8 ++-- .../bitbucket-pipelines/commands/CFamily.ts | 13 ++++-- .../tutorials/components/CreateYmlFile.tsx | 14 +++++-- .../tutorials/other/BuildToolForm.tsx | 5 ++- .../tutorials/other/ProjectAnalysisStep.tsx | 1 + .../other/__tests__/OtherTutorial-it.tsx | 11 +++++ .../__snapshots__/OtherTutorial-it.tsx.snap | 35 ++++++++++++++-- .../other/commands/AnalysisCommand.tsx | 18 +++++++- .../other/commands/ClangGCCCommand.tsx | 4 +- .../other/commands/DownloadScanner.tsx | 41 ++++++++++++++----- .../tutorials/other/commands/Other.tsx | 9 ++-- .../src/main/js/components/tutorials/utils.ts | 31 ++++++++++++-- .../src/main/js/helpers/doc-links.ts | 1 + .../resources/org/sonar/l10n/core.properties | 2 + 15 files changed, 192 insertions(+), 41 deletions(-) diff --git a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx index fa956930e0b..b5f49ab41f0 100644 --- a/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/bitbucket-pipelines/AnalysisCommand.tsx @@ -17,16 +17,21 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +import { Link } from '@sonarsource/echoes-react'; import { Dictionary } from 'lodash'; import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; import withAvailableFeatures, { WithAvailableFeaturesProps, } from '../../../app/components/available-features/withAvailableFeatures'; +import { DocLink } from '../../../helpers/doc-links'; +import { useDocUrl } from '../../../helpers/docs'; +import { translate } from '../../../helpers/l10n'; import { Feature } from '../../../types/features'; import { Component } from '../../../types/types'; import { CompilationInfo } from '../components/CompilationInfo'; import CreateYmlFile from '../components/CreateYmlFile'; -import { Arch, BuildTools, TutorialConfig } from '../types'; +import { Arch, AutoConfig, BuildTools, TutorialConfig } from '../types'; import { isCFamily } from '../utils'; import { PreambuleYaml } from './PreambuleYaml'; import cFamilyExample from './commands/CFamily'; @@ -60,9 +65,20 @@ const YamlTemplate: Dictionary = { [BuildTools.Other]: othersExample, }; +const showJreWarning = (config: TutorialConfig, arch: Arch) => { + if (!isCFamily(config.buildTool)) { + return false; + } + if (config.autoConfig === AutoConfig.Automatic) { + return false; + } + return arch === Arch.Arm64; +}; + export function AnalysisCommand(props: Readonly) { const { config, arch, mainBranchName, component } = props; const branchesEnabled = props.hasFeature(Feature.BranchSupport); + const scannerRequirementsUrl = useDocUrl(DocLink.SonarScannerRequirements); if (!config.buildTool) { return null; @@ -77,10 +93,30 @@ export function AnalysisCommand(props: Readonly) { projectName: component.name, }); + const warning = showJreWarning(config, arch) && ( +

+ + {translate('onboarding.analysis.sq_scanner.jre_required_warning.link')} + + ), + }} + /> +

+ ); + return ( <> - + {isCFamily(config.buildTool) && } ); 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 af497235e2f..af14ac13ac1 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 @@ -105,9 +105,9 @@ definitions: - mkdir $HOME/.sonar - curl -sSLo $HOME/.sonar/build-wrapper-linux-aarch64.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-aarch64.zip - unzip -o $HOME/.sonar/build-wrapper-linux-aarch64.zip -d $HOME/.sonar/ - - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip + - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}.zip - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin" + - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}/bin" - - $HOME/.sonar/build-wrapper-linux-aarch64/build-wrapper-linux-aarch64 --out-dir bw-output - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json @@ -143,9 +143,9 @@ definitions: - mkdir $HOME/.sonar - curl -sSLo $HOME/.sonar/build-wrapper-linux-aarch64.zip \${SONAR_HOST_URL}/static/cpp/build-wrapper-linux-aarch64.zip - unzip -o $HOME/.sonar/build-wrapper-linux-aarch64.zip -d $HOME/.sonar/ - - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip + - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}.zip - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin" + - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}/bin" - - $HOME/.sonar/build-wrapper-linux-aarch64/build-wrapper-linux-aarch64 --out-dir bw-output - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json 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 70df56f6ce9..cf77fbf478a 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 @@ -17,8 +17,12 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { AutoConfig, BuildTools } from '../../types'; -import { getBuildWrapperExecutableLinux, getBuildWrapperFolderLinux } from '../../utils'; +import { AutoConfig, BuildTools, OSs } from '../../types'; +import { + getBuildWrapperExecutableLinux, + getBuildWrapperFolderLinux, + getScannerUrlSuffix, +} from '../../utils'; import { BuildToolExampleBuilder } from '../AnalysisCommand'; import othersExample from './Others'; @@ -33,6 +37,7 @@ const cFamilyExample: BuildToolExampleBuilder = ({ } const buildWrapperExecutable = getBuildWrapperExecutableLinux(arch); const buildWrapperFolder = getBuildWrapperFolderLinux(arch); + const scannerSuffix = getScannerUrlSuffix(OSs.Linux, arch); return `image: definitions: @@ -44,9 +49,9 @@ definitions: - mkdir $HOME/.sonar - curl -sSLo $HOME/.sonar/${buildWrapperFolder}.zip \${SONAR_HOST_URL}/static/cpp/${buildWrapperFolder}.zip - unzip -o $HOME/.sonar/${buildWrapperFolder}.zip -d $HOME/.sonar/ - - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}-linux.zip + - curl -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-\${SONAR_SCANNER_VERSION}${scannerSuffix}.zip - unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ - - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}-linux/bin" + - export PATH="$PATH:$HOME/.sonar/sonar-scanner-\${SONAR_SCANNER_VERSION}${scannerSuffix}/bin" - - $HOME/.sonar/${buildWrapperFolder}/${buildWrapperExecutable} --out-dir bw-output - sonar-scanner -Dsonar.cfamily.compile-commands=bw-output/compile_commands.json diff --git a/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx b/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx index a2658bb5b80..8be1e9d92e2 100644 --- a/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/components/CreateYmlFile.tsx @@ -17,19 +17,20 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { ClipboardIconButton, CodeSnippet, NumberedListItem } from 'design-system'; +import { ClipboardIconButton, CodeSnippet, FlagMessage, NumberedListItem } from 'design-system'; import * as React from 'react'; import { FormattedMessage } from 'react-intl'; import { translate } from '../../../helpers/l10n'; import { InlineSnippet } from './InlineSnippet'; export interface CreateYmlFileProps { + warning?: React.ReactNode; yamlFileName: string; yamlTemplate: string; } -export default function CreateYmlFile(props: CreateYmlFileProps) { - const { yamlTemplate, yamlFileName } = props; +export default function CreateYmlFile(props: Readonly) { + const { yamlTemplate, yamlFileName, warning } = props; return ( + {warning && ( +
+ + {warning} + +
+ )}
); diff --git a/server/sonar-web/src/main/js/components/tutorials/other/BuildToolForm.tsx b/server/sonar-web/src/main/js/components/tutorials/other/BuildToolForm.tsx index e5a51052430..78d5bbf5531 100644 --- a/server/sonar-web/src/main/js/components/tutorials/other/BuildToolForm.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/other/BuildToolForm.tsx @@ -30,6 +30,7 @@ interface Props { arch?: Arch; config: TutorialConfig; hasCLanguageFeature: boolean; + isLocal: boolean; os?: OSs; setArch: (arch: Arch) => void; setConfig: (config: TutorialConfig) => void; @@ -37,7 +38,7 @@ interface Props { } export function BuildToolForm(props: Readonly) { - const { config, setConfig, os, setOs, arch, setArch, hasCLanguageFeature } = props; + const { config, setConfig, os, setOs, arch, setArch, isLocal, hasCLanguageFeature } = props; function handleConfigChange(newConfig: TutorialConfig) { const selectOsByDefault = (newConfig.buildTool === BuildTools.Cpp || @@ -75,7 +76,7 @@ export function BuildToolForm(props: Readonly) { titleLabelKey="onboarding.build.other.os" /> )} - {shouldShowArchSelector(os, config) && ( + {shouldShowArchSelector(os, config, !isLocal) && ( ) {
{ // C++ - Automatic await user.click(ui.cppBuildButton.get()); await user.click(ui.linuxButton.get()); + expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot( + 'c++ (automatic) and other linux: download scanner', + ); expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot( 'c++ (automatic) and other linux: execute scanner', ); + await user.click(ui.arm64Button.get()); + expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot( + 'c++ (automatic) and other linux arm64: download scanner', + ); + expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot( + 'c++ (automatic) and other linux arm64: execute scanner', + ); await user.click(ui.windowsButton.get()); expect(getCopyToClipboardValue(1, 'Copy')).toMatchSnapshot( 'c++ (automatic) and other windows: execute scanner', @@ -139,6 +149,7 @@ it('can choose build tools and copy provided settings', async () => { // C++ - Linux (x86_64) await user.click(ui.autoConfigManual.get()); await user.click(ui.linuxButton.get()); + await user.click(ui.x86_64Button.get()); expect(getCopyToClipboardValue(0, 'Copy')).toMatchSnapshot( 'c++ (manual) linux: download build wrapper', ); diff --git a/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap index b38254c0548..9bbba92c695 100644 --- a/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/other/__tests__/__snapshots__/OtherTutorial-it.tsx.snap @@ -1,5 +1,32 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`can choose build tools and copy provided settings: c++ (automatic) and other linux arm64: download scanner 1`] = ` +"export SONAR_SCANNER_VERSION=5.0.1.3006 +export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION +curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip +unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ +export PATH=$SONAR_SCANNER_HOME/bin:$PATH +export SONAR_SCANNER_OPTS="-server" +" +`; + +exports[`can choose build tools and copy provided settings: c++ (automatic) and other linux arm64: execute scanner 1`] = ` +"sonar-scanner \\ + -Dsonar.projectKey=my-project \\ + -Dsonar.sources=. \\ + -Dsonar.host.url=http://localhost:9000" +`; + +exports[`can choose build tools and copy provided settings: c++ (automatic) and other linux: download scanner 1`] = ` +"export SONAR_SCANNER_VERSION=5.0.1.3006 +export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux +curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip +unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ +export PATH=$SONAR_SCANNER_HOME/bin:$PATH +export SONAR_SCANNER_OPTS="-server" +" +`; + exports[`can choose build tools and copy provided settings: c++ (automatic) and other linux: execute scanner 1`] = ` "sonar-scanner \\ -Dsonar.projectKey=my-project \\ @@ -60,8 +87,8 @@ export PATH=$HOME/.sonar/build-wrapper-linux-aarch64:$PATH exports[`can choose build tools and copy provided settings: c++ (manual) linux arm64: download scanner 1`] = ` "export SONAR_SCANNER_VERSION=5.0.1.3006 -export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux -curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip +export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION +curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ export PATH=$SONAR_SCANNER_HOME/bin:$PATH export SONAR_SCANNER_OPTS="-server" @@ -207,8 +234,8 @@ export PATH=$HOME/.sonar/build-wrapper-linux-aarch64:$PATH exports[`can choose build tools and copy provided settings: objective-c linux arm64: download scanner 1`] = ` "export SONAR_SCANNER_VERSION=5.0.1.3006 -export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux -curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip +export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION +curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION.zip unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ export PATH=$SONAR_SCANNER_HOME/bin:$PATH export SONAR_SCANNER_OPTS="-server" diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/AnalysisCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/AnalysisCommand.tsx index 7105aeafa15..846fdb0f14c 100644 --- a/server/sonar-web/src/main/js/components/tutorials/other/commands/AnalysisCommand.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/other/commands/AnalysisCommand.tsx @@ -55,14 +55,28 @@ export default function AnalysisCommand(props: Readonly) { case BuildTools.Other: return ( - + ); case BuildTools.Cpp: case BuildTools.ObjectiveC: if (config.buildTool === BuildTools.Cpp && config.autoConfig === AutoConfig.Automatic) { return ( - + ); } return ( diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/ClangGCCCommand.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/ClangGCCCommand.tsx index 90dfda610b3..0498b2c2c46 100644 --- a/server/sonar-web/src/main/js/components/tutorials/other/commands/ClangGCCCommand.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/other/commands/ClangGCCCommand.tsx @@ -35,13 +35,13 @@ export interface ClangGCCCustomProps { token: string; } -export default function ClangGCCCustom(props: ClangGCCCustomProps) { +export default function ClangGCCCustom(props: Readonly) { const { os, arch, baseUrl, component, isLocal, token } = props; return (
- + ) { + const { arch, os, isLocal, token } = props; const docUrl = useDocUrl(DocLink.SonarScanner); + const scannerRequirementsUrl = useDocUrl(DocLink.SonarScannerRequirements); return (
@@ -66,12 +70,29 @@ export default function DownloadScanner(props: DownloadScannerProps) {

) : ( <> + {os === OSs.Linux && arch === Arch.Arm64 && ( + +

+ + {translate('onboarding.analysis.sq_scanner.jre_required_warning.link')} + + ), + }} + /> +

+
+ )} ${getRemoteDownloadSnippet(os)}`} + snippet={getRemoteDownloadSnippet(os, arch)} + render={`${getRemoteDownloadSnippet(os, arch)}`} /> {translate('onboarding.analysis.sq_scanner.sonar_token_env.header')} @@ -98,7 +119,7 @@ export default function DownloadScanner(props: DownloadScannerProps) { ); } -function getRemoteDownloadSnippet(os: OSs) { +function getRemoteDownloadSnippet(os: OSs, arch: Arch) { if (os === OSs.Windows) { return `$env:SONAR_SCANNER_VERSION = "5.0.1.3006" $env:SONAR_DIRECTORY = [System.IO.Path]::Combine($(get-location).Path,".sonar") @@ -113,10 +134,10 @@ $env:Path += ";$env:SONAR_SCANNER_HOME/bin" $env:SONAR_SCANNER_OPTS="-server" `; } - const suffix = os === OSs.MacOS ? 'macosx' : 'linux'; + const suffix = getScannerUrlSuffix(os, arch); return `export SONAR_SCANNER_VERSION=5.0.1.3006 -export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-${suffix} -curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-${suffix}.zip +export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION${suffix} +curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION${suffix}.zip unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ export PATH=$SONAR_SCANNER_HOME/bin:$PATH export SONAR_SCANNER_OPTS="-server" diff --git a/server/sonar-web/src/main/js/components/tutorials/other/commands/Other.tsx b/server/sonar-web/src/main/js/components/tutorials/other/commands/Other.tsx index 81b72ded5e9..82500b1e060 100644 --- a/server/sonar-web/src/main/js/components/tutorials/other/commands/Other.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/other/commands/Other.tsx @@ -19,11 +19,12 @@ */ import * as React from 'react'; import { Component } from '../../../../types/types'; -import { OSs } from '../../types'; +import { Arch, OSs } from '../../types'; import DownloadScanner from './DownloadScanner'; import ExecScanner from './ExecScanner'; export interface OtherProps { + arch: Arch; baseUrl: string; component: Component; isLocal: boolean; @@ -31,12 +32,12 @@ export interface OtherProps { token: string; } -export default function Other(props: OtherProps) { - const { baseUrl, os, component, isLocal, token } = props; +export default function Other(props: Readonly) { + const { arch, baseUrl, os, component, isLocal, token } = props; return (
- + getBuildWrapperFolder(OSs.Linux, arch); -export const getBuildWrapperExecutableLinux = (arch?: Arch) => - getBuildWrapperExecutable(OSs.Linux, arch); +export function getBuildWrapperFolderLinux(arch?: Arch) { + return getBuildWrapperFolder(OSs.Linux, arch); +} +export function getBuildWrapperExecutableLinux(arch?: Arch) { + return getBuildWrapperExecutable(OSs.Linux, arch); +} + +export function getScannerUrlSuffix(os: OSs, arch?: Arch) { + if (os === OSs.Windows) { + return '-windows'; + } + if (os === OSs.MacOS) { + return '-macosx'; + } + if (os === OSs.Linux && arch === Arch.X86_64) { + return '-linux'; + } + return ''; +} diff --git a/server/sonar-web/src/main/js/helpers/doc-links.ts b/server/sonar-web/src/main/js/helpers/doc-links.ts index 148dc4b7702..219e701fdcf 100644 --- a/server/sonar-web/src/main/js/helpers/doc-links.ts +++ b/server/sonar-web/src/main/js/helpers/doc-links.ts @@ -77,6 +77,7 @@ export enum DocLink { ServerUpgradeRoadmap = '/setup-and-upgrade/upgrade-the-server/roadmap/', SonarLintConnectedMode = '/user-guide/sonarlint-connected-mode/', SonarScanner = '/analyzing-source-code/scanners/sonarscanner/', + SonarScannerRequirements = '/analyzing-source-code/scanners/general-requirements/', SonarScannerDotNet = '/analyzing-source-code/scanners/sonarscanner-for-dotnet/', SonarScannerGradle = '/analyzing-source-code/scanners/sonarscanner-for-gradle/', SonarScannerMaven = '/analyzing-source-code/scanners/sonarscanner-for-maven/', 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 61513daa6dd..80dc1c28a1e 100644 --- a/sonar-core/src/main/resources/org/sonar/l10n/core.properties +++ b/sonar-core/src/main/resources/org/sonar/l10n/core.properties @@ -4637,6 +4637,8 @@ onboarding.analysis.sq_scanner.docs_link=official documentation of the Scanner onboarding.analysis.sq_scanner.sonar_token_env.header=Configure a SONAR_TOKEN environment variable in your CI settings onboarding.analysis.sq_scanner.sonar_token_env.var_name=Add an environment variable called onboarding.analysis.sq_scanner.sonar_token_env.var_value=Give it the following value +onboarding.analysis.sq_scanner.jre_required_warning=A compatible Java Runtime Environment is required to run the Scanner on this platform, please refer to {link} for more details. +onboarding.analysis.sq_scanner.jre_required_warning.link=the documentation onboarding.analysis.sqscanner.docs.gradle.title=official documentation of the Scanner for Gradle onboarding.analysis.sqscanner.docs.gradle.example_project.title=live Gradle-based example project -- 2.39.5