__html: translate('onboarding.analysis.sq_scanner.execute.text')
}}
/>
- <Command command={command1} />
- <Command command={command2} />
+ <Command command={command1} isWindows={props.os === 'win'} />
+ <Command command={command2} isWindows={props.os === 'win'} />
<p
className="big-spacer-top markdown"
dangerouslySetInnerHTML={{ __html: translate('onboarding.analysis.sq_scanner.docs') }}
// @flow
import React from 'react';
import Clipboard from 'clipboard';
+import classNames from 'classnames';
import Tooltip from '../../../../components/controls/Tooltip';
import { translate } from '../../../../helpers/l10n';
/*::
type Props = {
- command: string | Array<?string>
+ command: string | Array<?string>,
+ isWindows?: boolean
};
*/
this.clipboard.on('success', this.showTooltip);
}
+ componentDidUpdate() {
+ this.clipboard.destroy();
+ this.clipboard = new Clipboard(this.copyButton);
+ this.clipboard.on('success', this.showTooltip);
+ }
+
componentWillUnmount() {
this.mounted = false;
this.clipboard.destroy();
};
render() {
- const { command } = this.props;
+ const { command, isWindows } = this.props;
const commandArray = Array.isArray(command) ? command.filter(line => line != null) : [command];
- const finalCommand = commandArray.join(s);
+ const finalCommand = isWindows ? commandArray.join(' ') : commandArray.join(s);
const button = (
<button data-clipboard-text={finalCommand} ref={node => (this.copyButton = node)}>
);
return (
- <div className="onboarding-command">
+ <div
+ className={classNames('onboarding-command', { 'onboarding-command-windows': isWindows })}>
<pre>{finalCommand}</pre>
{this.state.tooltipShown ? (
<Tooltip defaultVisible={true} placement="top" overlay="Copied!" trigger="manual">
const command1 = [
'SonarQube.Scanner.MSBuild.exe begin',
`/k:"${props.projectKey}"`,
- props.organization && `/d:"sonar.organization=${props.organization}"`,
- `/d:"sonar.host.url=${props.host}`,
- `/d:"sonar.login=${props.token}"`
+ props.organization && `/d:sonar.organization="${props.organization}"`,
+ `/d:sonar.host.url="${props.host}"`,
+ `/d:sonar.login="${props.token}"`
];
const command2 = 'MsBuild.exe /t:Rebuild';
- const command3 = ['SonarQube.Scanner.MSBuild.exe end', `/d:"sonar.login=${props.token}"`];
+ const command3 = ['SonarQube.Scanner.MSBuild.exe end', `/d:sonar.login="${props.token}"`];
return (
<div>
__html: translate('onboarding.analysis.msbuild.execute.text')
}}
/>
- <Command command={command1} />
- <Command command={command2} />
- <Command command={command3} />
+ <Command command={command1} isWindows={true} />
+ <Command command={command2} isWindows={true} />
+ <Command command={command3} isWindows={true} />
<p
className="big-spacer-top markdown"
dangerouslySetInnerHTML={{ __html: translate('onboarding.analysis.msbuild.docs') }}
const command1 = [
'SonarQube.Scanner.MSBuild.exe begin',
`/k:"${props.projectKey}"`,
- props.organization && `/d:"sonar.organization=${props.organization}"`,
- '/d:"sonar.cfamily.build-wrapper-output=bw-output"',
- `/d:"sonar.host.url=${props.host}`,
- `/d:"sonar.login=${props.token}"`
+ props.organization && `/d:sonar.organization="${props.organization}"`,
+ '/d:sonar.cfamily.build-wrapper-output=bw-output',
+ `/d:sonar.host.url="${props.host}"`,
+ `/d:sonar.login="${props.token}"`
];
- const command2 = ['build-wrapper-win-x86-64.exe', '--out-dir bw-output MsBuild.exe /t:Rebuild'];
+ const command2 = 'build-wrapper-win-x86-64.exe --out-dir bw-output MsBuild.exe /t:Rebuild';
- const command3 = ['SonarQube.Scanner.MSBuild.exe end', `/d:"sonar.login=${props.token}"`];
+ const command3 = ['SonarQube.Scanner.MSBuild.exe end', `/d:sonar.login="${props.token}"`];
return (
<div>
__html: translate('onboarding.analysis.msbuild.execute.text')
}}
/>
- <Command command={command1} />
- <Command command={command2} />
- <Command command={command3} />
+ <Command command={command1} isWindows={true} />
+ <Command command={command2} isWindows={true} />
+ <Command command={command3} isWindows={true} />
<p
className="big-spacer-top markdown"
dangerouslySetInnerHTML={{ __html: translate('onboarding.analysis.msbuild.docs') }}
__html: translate('onboarding.analysis.sq_scanner.execute.text')
}}
/>
- <Command command={command} />
+ <Command command={command} isWindows={props.os === 'win'} />
<p
className="big-spacer-top markdown"
dangerouslySetInnerHTML={{ __html: translate('onboarding.analysis.sq_scanner.docs') }}
/>
<Command
command="build-wrapper-win-x86-64.exe --out-dir bw-output make clean all"
+ isWindows={true}
/>
<Command
command={
"-Dsonar.login=token",
]
}
+ isWindows={true}
/>
<p
className="big-spacer-top markdown"
/>
<Command
command="build-wrapper-linux-x86-64 --out-dir bw-output make clean all"
+ isWindows={false}
/>
<Command
command={
"-Dsonar.login=token",
]
}
+ isWindows={false}
/>
<p
className="big-spacer-top markdown"
/>
<Command
command="build-wrapper-linux-x86-64 --out-dir bw-output make clean all"
+ isWindows={false}
/>
<Command
command={
"-Dsonar.login=token",
]
}
+ isWindows={false}
/>
<p
className="big-spacer-top markdown"
"SonarQube.Scanner.MSBuild.exe begin",
"/k:\\"projectKey\\"",
undefined,
- "/d:\\"sonar.host.url=host",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.host.url=\\"host\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<Command
command="MsBuild.exe /t:Rebuild"
+ isWindows={true}
/>
<Command
command={
Array [
"SonarQube.Scanner.MSBuild.exe end",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<p
className="big-spacer-top markdown"
Array [
"SonarQube.Scanner.MSBuild.exe begin",
"/k:\\"projectKey\\"",
- "/d:\\"sonar.organization=organization\\"",
- "/d:\\"sonar.host.url=host",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.organization=\\"organization\\"",
+ "/d:sonar.host.url=\\"host\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<Command
command="MsBuild.exe /t:Rebuild"
+ isWindows={true}
/>
<Command
command={
Array [
"SonarQube.Scanner.MSBuild.exe end",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<p
className="big-spacer-top markdown"
"SonarQube.Scanner.MSBuild.exe begin",
"/k:\\"projectKey\\"",
undefined,
- "/d:\\"sonar.cfamily.build-wrapper-output=bw-output\\"",
- "/d:\\"sonar.host.url=host",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.cfamily.build-wrapper-output=bw-output",
+ "/d:sonar.host.url=\\"host\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<Command
- command={
- Array [
- "build-wrapper-win-x86-64.exe",
- "--out-dir bw-output MsBuild.exe /t:Rebuild",
- ]
- }
+ command="build-wrapper-win-x86-64.exe --out-dir bw-output MsBuild.exe /t:Rebuild"
+ isWindows={true}
/>
<Command
command={
Array [
"SonarQube.Scanner.MSBuild.exe end",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<p
className="big-spacer-top markdown"
Array [
"SonarQube.Scanner.MSBuild.exe begin",
"/k:\\"projectKey\\"",
- "/d:\\"sonar.organization=organization\\"",
- "/d:\\"sonar.cfamily.build-wrapper-output=bw-output\\"",
- "/d:\\"sonar.host.url=host",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.organization=\\"organization\\"",
+ "/d:sonar.cfamily.build-wrapper-output=bw-output",
+ "/d:sonar.host.url=\\"host\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<Command
- command={
- Array [
- "build-wrapper-win-x86-64.exe",
- "--out-dir bw-output MsBuild.exe /t:Rebuild",
- ]
- }
+ command="build-wrapper-win-x86-64.exe --out-dir bw-output MsBuild.exe /t:Rebuild"
+ isWindows={true}
/>
<Command
command={
Array [
"SonarQube.Scanner.MSBuild.exe end",
- "/d:\\"sonar.login=token\\"",
+ "/d:sonar.login=\\"token\\"",
]
}
+ isWindows={true}
/>
<p
className="big-spacer-top markdown"
"-Dsonar.login=token",
]
}
+ isWindows={true}
/>
<p
className="big-spacer-top markdown"
"-Dsonar.login=token",
]
}
+ isWindows={false}
/>
<p
className="big-spacer-top markdown"
"-Dsonar.login=token",
]
}
+ isWindows={false}
/>
<p
className="big-spacer-top markdown"
color: #fff;
font-size: 11px;
font-weight: normal;
+ user-select: none;
}
.onboarding-command button:hover,
color: #404040;
}
+.onboarding-command-windows pre {
+ padding-bottom: 40px;
+}
+
+.onboarding-command-windows button {
+ top: auto;
+ top: 40px;
+}
+
.onboarding .page-actions {
text-align: right;
margin-bottom: 0;