]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-15061 Explain how to set up Java 11 for Azure Pipelines
authorJeremy Davis <jeremy.davis@sonarsource.com>
Thu, 1 Jul 2021 14:45:46 +0000 (16:45 +0200)
committersonartech <sonartech@sonarsource.com>
Fri, 2 Jul 2021 20:03:12 +0000 (20:03 +0000)
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/JavaToolInstallation.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/JavaToolInstallation-test.tsx [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/__tests__/__snapshots__/JavaToolInstallation-test.tsx.snap [new file with mode: 0644]
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaGradle.tsx
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/JavaMaven.tsx
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaGradle-test.tsx.snap
server/sonar-web/src/main/js/components/tutorials/azure-pipelines/commands/__tests__/__snapshots__/JavaMaven-test.tsx.snap
sonar-core/src/main/resources/org/sonar/l10n/core.properties

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 (file)
index 0000000..c4619c8
--- /dev/null
@@ -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 (file)
index 0000000..65cf657
--- /dev/null
@@ -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 (file)
index 0000000..fc74464
--- /dev/null
@@ -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>
+`;
index 3736f533bbbab1836643c2cacd92a7ce66b194ba..372499561dde837613df6778eb995d9ae9216017 100644 (file)
@@ -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',
index c73f380c11d924613b7f7f4fde762a3e55c9d87d..aee48bdc51dbe065fce00b56e9e178850a0137ab 100644 (file)
@@ -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',
index 66f4880a6ec92241e1fdfdc298e9e8ba2a3a4b2a..d46bb3b80f44caec5619e1a3876925bb90c1a7cf 100644 (file)
@@ -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>
index 5c22db0b22e9cc61c5b1ae9d128527b3b82b0307..06c9d9ce809565d7a39c87b9a30f21cd45d8932e 100644 (file)
@@ -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>
index c1a666798351ad826cc62283190288ca9b9160b7..112ecffea95626bfcb3c0abaa3dcc676b1a8d4e8 100644 (file)
@@ -3830,6 +3830,13 @@ onboarding.tutorial.with.azure_pipelines.BranchAnalysis.run.key.sentence.project
 onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence=Expand the {section} and replace the {properties} with the following snippet
 onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.section=Advanced section
 onboarding.tutorial.with.azure_pipelines.BranchAnalysis.advanced_properties.sentence.properties=Additional Properties
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.title=Add a new Java tool installer task
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.sentence=Under {field}, select {value}
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_version=JDK version
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.or_higher=(or higher)
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_architecture=JDK architecture
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.java_source=JDK source
+onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java_installer.pre-installed=Pre-installed
 onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java=Edit or add a new {0} task
 onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence=Under {section}, check {option}
 onboarding.tutorial.with.azure_pipelines.BranchAnalysis.java.settings.sentence.section=Code Analysis