diff options
author | Jeremy Davis <jeremy.davis@sonarsource.com> | 2021-07-01 16:45:46 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2021-07-02 20:03:12 +0000 |
commit | ea7064762be12f5ccca3c3372d900f2e23784b27 (patch) | |
tree | aeae697c2f74c87122e69a05ce3a6aea4ede50e7 /server/sonar-web/src | |
parent | 9d4267ca0cbab902205fca61e361c53ead046d2c (diff) | |
download | sonarqube-ea7064762be12f5ccca3c3372d900f2e23784b27.tar.gz sonarqube-ea7064762be12f5ccca3c3372d900f2e23784b27.zip |
SONAR-15061 Explain how to set up Java 11 for Azure Pipelines
Diffstat (limited to 'server/sonar-web/src')
7 files changed, 181 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx new file mode 100644 index 00000000000..c4619c8e4c5 --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx @@ -0,0 +1,81 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import * as React from 'react'; +import { FormattedMessage } from 'react-intl'; +import { translate } from 'sonar-ui-common/helpers/l10n'; + +function renderSentenceWithFieldAndValue(props: { + field: React.ReactNode; + value: React.ReactNode; +}) { + const { field, value } = props; + return ( + <FormattedMessage + id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence" + defaultMessage={translate( + 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence' + )} + values={{ + field: <strong>{field}</strong>, + value: <strong>{value}</strong> + }} + /> + ); +} + +export default function JavaToolInstallation() { + return ( + <li> + {translate('onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title')} + <ul className="list-styled"> + <li> + {renderSentenceWithFieldAndValue({ + field: translate( + 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version' + ), + value: '11' + })} + {' ' /* explicit space between the two strings */} + {translate( + 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher' + )} + </li> + <li> + {renderSentenceWithFieldAndValue({ + field: translate( + 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture' + ), + value: 'x64' + })} + </li> + <li> + {renderSentenceWithFieldAndValue({ + field: translate( + 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source' + ), + value: translate( + 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed' + ) + })} + </li> + </ul> + </li> + ); +} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/JavaToolInstallation-test.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/JavaToolInstallation-test.tsx new file mode 100644 index 00000000000..65cf657d6d7 --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/JavaToolInstallation-test.tsx @@ -0,0 +1,30 @@ +/* + * SonarQube + * Copyright (C) 2009-2021 SonarSource SA + * mailto:info AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import { shallow } from 'enzyme'; +import * as React from 'react'; +import JavaToolInstallation from '../JavaToolInstallation'; + +it('should render correctly', () => { + expect(shallowRender()).toMatchSnapshot(); +}); + +function shallowRender() { + return shallow(<JavaToolInstallation />); +} diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/JavaToolInstallation-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/JavaToolInstallation-test.tsx.snap new file mode 100644 index 00000000000..fc744643409 --- /dev/null +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/JavaToolInstallation-test.tsx.snap @@ -0,0 +1,61 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`should render correctly 1`] = ` +<li> + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title + <ul + className="list-styled" + > + <li> + <FormattedMessage + defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence" + id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence" + values={ + Object { + "field": <strong> + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version + </strong>, + "value": <strong> + 11 + </strong>, + } + } + /> + + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher + </li> + <li> + <FormattedMessage + defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence" + id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence" + values={ + Object { + "field": <strong> + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture + </strong>, + "value": <strong> + x64 + </strong>, + } + } + /> + </li> + <li> + <FormattedMessage + defaultMessage="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence" + id="onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence" + values={ + Object { + "field": <strong> + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source + </strong>, + "value": <strong> + onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed + </strong>, + } + } + /> + </li> + </ul> +</li> +`; diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx index 3736f533bbb..372499561dd 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx @@ -22,6 +22,7 @@ import * as React from 'react'; import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; import { BuildTools } from '../../types'; +import JavaToolInstallation from '../JavaToolInstallation'; import AlertClassicEditor from './AlertClassicEditor'; import PrepareAnalysisCommand, { PrepareType } from './PrepareAnalysisCommand'; import PublishSteps from './PublishSteps'; @@ -48,6 +49,9 @@ export default function JavaGradle(props: JavaGradleProps) { kind={PrepareType.JavaMavenGradle} projectKey={projectKey} /> + + <JavaToolInstallation /> + <li> {translateWithParameters( 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java', diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx index c73f380c11d..aee48bdc51d 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx @@ -22,6 +22,7 @@ import * as React from 'react'; import { translate, translateWithParameters } from 'sonar-ui-common/helpers/l10n'; import SentenceWithHighlights from '../../components/SentenceWithHighlights'; import { BuildTools } from '../../types'; +import JavaToolInstallation from '../JavaToolInstallation'; import AlertClassicEditor from './AlertClassicEditor'; import PrepareAnalysisCommand, { PrepareType } from './PrepareAnalysisCommand'; import PublishSteps from './PublishSteps'; @@ -48,6 +49,8 @@ export default function JavaMaven(props: JavaMavenProps) { projectKey={projectKey} /> + <JavaToolInstallation /> + <li> {translateWithParameters( 'onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java', diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap index 66f4880a6ec..d46bb3b80f4 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap @@ -23,6 +23,7 @@ exports[`should render correctly 1`] = ` kind={0} projectKey="projectKey" /> + <JavaToolInstallation /> <li> onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.gradle </li> diff --git a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap index 5c22db0b22e..06c9d9ce809 100644 --- a/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap +++ b/server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap @@ -23,6 +23,7 @@ exports[`should render correctly 1`] = ` kind={0} projectKey="projectKey" /> + <JavaToolInstallation /> <li> onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.onboarding.build.maven </li> |