3 * Copyright (C) 2009-2020 SonarSource SA
4 * mailto:info AT sonarsource DOT com
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 3 of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 import * as React from 'react';
21 import { FormattedMessage } from 'react-intl';
22 import { translate } from 'sonar-ui-common/helpers/l10n';
23 import CodeSnippet from '../../../../../components/common/CodeSnippet';
25 getSonarcloudAddonYml,
26 getSonarcloudAddonYmlRender,
28 } from '../AnalysisCommandTravis';
29 import { Props } from '../JavaGradle';
31 export function JavaGradleTravisSonarCloud(props: Props) {
32 const config = `plugins {
33 id "org.sonarqube" version "2.7"
38 sonar.projectKey: ${props.projectKey}
42 const command = `${getSonarcloudAddonYml(props.organization)}
45 - ./gradlew sonarqube`;
47 const renderCommand = () => (
49 {getSonarcloudAddonYmlRender(props.organization)}
52 - ./gradlew sonarqube`}
58 <h2 className="spacer-bottom spacer-top">
59 {translate('onboarding.analysis.with.travis.setup.title.a')}
62 <RequirementJavaBuild />
64 <hr className="no-horizontal-margins" />
66 <h2 className="spacer-bottom spacer-top">
67 {translate('onboarding.analysis.with.travis.setup.title.b')}
71 defaultMessage={translate('onboarding.analysis.java.gradle.text.1.sonarcloud')}
72 id="onboarding.analysis.java.gradle.text.1.sonarcloud"
74 file: <code>build.gradle</code>,
75 plugin: <code>org.sonarqube</code>
79 <CodeSnippet snippet={config} />
82 defaultMessage={translate('onboarding.analysis.java.gradle.text.2.sonarcloud')}
83 id="onboarding.analysis.java.gradle.text.2.sonarcloud"
85 file: <code>.travis.yml</code>
89 <CodeSnippet render={renderCommand} snippet={command} />
92 defaultMessage={translate('onboarding.analysis.sq_scanner.docs_use_case')}
93 id="onboarding.analysis.sq_scanner.docs_use_case"
97 href="http://redirect.sonarsource.com/doc/gradle.html"
98 rel="noopener noreferrer"
100 {translate('onboarding.analysis.sqscanner.docs.gradle.title')}
105 href="https://github.com/SonarSource/sq-com_example_java-gradle-travis"
106 rel="noopener noreferrer"
108 {translate('onboarding.analysis.sqscanner.docs.gradle.example_project.title')}