summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authormickael-caro-sonarsource <50556955+mickael-caro-sonarsource@users.noreply.github.com>2019-06-24 14:47:59 +0200
committersonartech <sonartech@sonarsource.com>2019-06-28 08:45:48 +0200
commit11dbbfb798f8cdd5fb3564fda2098919cbba3658 (patch)
tree4a287fcca46d3092b4b5768517cfdb11920f5e8e /server
parent36a2571ece01e51f104523ed98f43e6f27f03f75 (diff)
downloadsonarqube-11dbbfb798f8cdd5fb3564fda2098919cbba3658.tar.gz
sonarqube-11dbbfb798f8cdd5fb3564fda2098919cbba3658.zip
Updated documentation for scanner for msbuild (#1746)
* SC-724 Updated documentation for scanner for msbuild (Update versions + link according, added organization parameter documentation and snippet) * Added FAQ on the Azure DevOps detailed page for SonarCloud
Diffstat (limited to 'server')
-rw-r--r--server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md32
-rw-r--r--server/sonar-docs/src/pages/sonarcloud/integrations/vsts.md6
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/commands/MSBuildScanner.tsx2
-rw-r--r--server/sonar-web/src/main/js/apps/tutorials/components/commands/__tests__/__snapshots__/MSBuildScanner-test.tsx.snap2
4 files changed, 26 insertions, 16 deletions
diff --git a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md
index 9bad72828f8..6b9ab6833d5 100644
--- a/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md
+++ b/server/sonar-docs/src/pages/analysis/scan/sonarscanner-for-msbuild.md
@@ -4,12 +4,12 @@ url: /analysis/scan/sonarscanner-for-msbuild/
---
[[info]]
-| **Download SonarQube Scanner for MSBuild 4.6.0.1930** - Compatible with SonarQube 6.7+ (LTS)
-| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://github.com/SonarSource/sonar-scanner-msbuild/issues) – [Source](https://github.com/SonarSource-VisualStudio/sonar-msbuild-runner)
+| **Download SonarScanner for MSBuild 4.6.2.2108** - Compatible with SonarQube 6.7+ (LTS)
+| By [SonarSource](https://www.sonarsource.com/) – GNU LGPL 3 – [Issue Tracker](https://github.com/SonarSource/sonar-scanner-msbuild/issues) – [Source](https://github.com/SonarSource/sonar-scanner-msbuild)
|
-| [.NET Framework 4.6+](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.6.0.1930/sonar-scanner-msbuild-4.6.0.1930-net46.zip) |
-| [.NET Core 2.0+](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.6.0.1930/sonar-scanner-msbuild-4.6.0.1930-netcoreapp2.0.zip) |
-| [.NET Core Global Tool](https://www.nuget.org/packages/dotnet-sonarscanner)
+| [.NET Framework 4.6+](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.6.2.2108/sonar-scanner-msbuild-4.6.2.2108-net46.zip) |
+| [.NET Core 2.0+](https://github.com/SonarSource/sonar-scanner-msbuild/releases/download/4.6.2.2108/sonar-scanner-msbuild-4.6.2.2108-netcoreapp2.0.zip) |
+| [.NET Core Global Tool](https://www.nuget.org/packages/dotnet-sonarscanner)
The SonarScanner for MSBuild is the recommended way to launch an analysis for projects/solutions using MSBuild or dotnet command as a build tool. It is the result of a [collaboration between SonarSource and Microsoft](http://www.sonarqube.org/announcing-sonarqube-integration-with-msbuild-and-team-build/).
@@ -59,26 +59,29 @@ There are two versions of the SonarScanner for MSBuild.
The first version is based on the “classic” .NET Framework. To use it, execute the following commands from the root folder of your project:
```
-SonarScanner.MSBuild.exe begin /k:"project-key"
+SonarScanner.MSBuild.exe begin /k:"project-key" <!-- sonarcloud -->/d:sonar.organization="<organization>" /d:sonar.login="<token>" <!-- /sonarcloud -->
MSBuild.exe <path to solution.sln> /t:Rebuild
-SonarScanner.MSBuild.exe end
+SonarScanner.MSBuild.exe end <!-- sonarcloud -->/d:sonar.login="<token>" <!-- /sonarcloud -->
```
Note: On Mac OS or Linux, you can also use `mono <path to SonarScanner.MSBuild.exe>`.
+
The second version is based on .NET Core which has a very similar usage:
```
-dotnet <path to SonarScanner.MSBuild.dll> begin /k:"project-key"
+dotnet <path to SonarScanner.MSBuild.dll> begin /k:"project-key" <!-- sonarcloud -->/d:sonar.organization="<organization>" /d:sonar.login="<token>" <!-- /sonarcloud -->
dotnet build <path to solution.sln>
-dotnet <path to SonarScanner.MSBuild.dll> end
+dotnet <path to SonarScanner.MSBuild.dll> end <!-- sonarcloud -->/d:sonar.login="<token>" <!-- /sonarcloud -->
```
The .NET Core version can also be used as a .NET Core Global Tool.
-After installing the Scanner as a global tool as described above it can be invoked as follows:
+After installing the Scanner as a global tool as described above it can be invoked as follows:
```
-dotnet sonarscanner begin /k:"project-key"
+dotnet sonarscanner begin /k:"project-key" <!-- sonarcloud -->/d:sonar.organization="<organization>" /d:sonar.login="<token>" <!-- /sonarcloud -->
dotnet build <path to solution.sln>
-dotnet sonarscanner end
+dotnet sonarscanner end <!-- sonarcloud -->/d:sonar.login="<token>" <!-- /sonarcloud -->
```
+Same as above, if you are targetting a SonarCloud project, will have to add both the organization and a login for authentication.
+
Notes:
* The .NET Core version of the scanner does not support TFS XAML builds. Apart from that, the two versions of scanner have the same capabilities and command line arguments.
@@ -86,7 +89,7 @@ Notes:
## Analysis steps
### Begin
-The begin step is executed when you add the `begin` command line argument. It hooks into the MSBuild pipeline, downloads SonarQube quality profiles and settings and prepares your project for the analysis.
+The begin step is executed when you add the `begin` command line argument. It hooks into the MSBuild pipeline, downloads SonarQube quality profiles and settings and prepares your project for the analysis.
Command Line Parameters:
@@ -95,6 +98,7 @@ Parameter|Description
`/k:<project-key>`|[required] Specifies the key of the analyzed project in SonarQube
`/n:<project name>`|[optional] Specifies the name of the analyzed project in SonarQube. Adding this argument will overwrite the project name in SonarQube if it already exists.
`/v:<version>`|[recommended] Specifies the version of your project.
+<!-- sonarcloud --> `/d:sonar.organization=<organization>`|[required] Specifies the name of the target organization in SonarCloud <!-- /sonarcloud -->
`/d:sonar.login=<username> or <token>`| [optional] Specifies the username or access token to authenticate with to SonarQube. If this argument is added to the begin step, it must also be added on the end step.
`/d:sonar.password=<password>`|[optional] Specifies the password for the SonarQube username in the `sonar.login` argument. This argument is not needed if you use authentication token. If this argument is added to the begin step, it must also be added on the end step.
`/d:sonar.verbose=true`|[optional] Sets the logging verbosity to detailed. Add this argument before sending logs for troubleshooting.
@@ -199,5 +203,5 @@ To instruct the Java VM to use specific proxy settings or when there is no syste
```
SONAR_SCANNER_OPTS = "-Dhttp.proxyHost=yourProxyHost -Dhttp.proxyPort=yourProxyPort"
```
-Where _yourProxyHost_ and _yourProxyPort_ are the hostname and the port of your proxy server. There are additional proxy settings for https, authentication and exclusions that could be passed to the Java VM, for full reference visit the following article: https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
+Where _yourProxyHost_ and _yourProxyPort_ are the hostname and the port of your proxy server. There are additional proxy settings for https, authentication and exclusions that could be passed to the Java VM. For more information see the following article: https://docs.oracle.com/javase/8/docs/technotes/guides/net/proxies.html
diff --git a/server/sonar-docs/src/pages/sonarcloud/integrations/vsts.md b/server/sonar-docs/src/pages/sonarcloud/integrations/vsts.md
index f4555796885..564c1094563 100644
--- a/server/sonar-docs/src/pages/sonarcloud/integrations/vsts.md
+++ b/server/sonar-docs/src/pages/sonarcloud/integrations/vsts.md
@@ -37,3 +37,9 @@ You can monitor the Quality Gate status of your projects directly in your Azure
* **For public projects:** you can simply select your project from the dropdown. A searchbar inside the dropdown will help you find it easily. Just select it and click on the "Save" button.
* **For private projects:** you'll have to log in using the links provided under the dropdown. Once logged in, your private projects will appear in the dropdown. Select the one you are interested in, and click on "Save".
+
+## FAQ
+
+1. Which kind of analysis scenario are supported for .Net projects ?
+
+ * Using Sonar Scanner for MSBuild, you can build multiple .Net projects / solutions between the "Prepare Analysis on SonarCloud" and "Run Analysis" tasks. You will have full support of Issues and Code Coverage on both branches and PR Analysis. Other kind of scenarios are not yet supported. \ No newline at end of file
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/commands/MSBuildScanner.tsx b/server/sonar-web/src/main/js/apps/tutorials/components/commands/MSBuildScanner.tsx
index 02c69437a2c..292adee51df 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/commands/MSBuildScanner.tsx
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/commands/MSBuildScanner.tsx
@@ -39,7 +39,7 @@ export default function MSBuildScanner(props: Props) {
<p>
<a
className="button"
- href="http://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html"
+ href="https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-msbuild/"
rel="noopener noreferrer"
target="_blank">
{translate('download_verb')}
diff --git a/server/sonar-web/src/main/js/apps/tutorials/components/commands/__tests__/__snapshots__/MSBuildScanner-test.tsx.snap b/server/sonar-web/src/main/js/apps/tutorials/components/commands/__tests__/__snapshots__/MSBuildScanner-test.tsx.snap
index 094b637da72..f1d82f50660 100644
--- a/server/sonar-web/src/main/js/apps/tutorials/components/commands/__tests__/__snapshots__/MSBuildScanner-test.tsx.snap
+++ b/server/sonar-web/src/main/js/apps/tutorials/components/commands/__tests__/__snapshots__/MSBuildScanner-test.tsx.snap
@@ -25,7 +25,7 @@ exports[`renders correctly 1`] = `
<p>
<a
className="button"
- href="http://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html"
+ href="https://sonarcloud.io/documentation/analysis/scan/sonarscanner-for-msbuild/"
rel="noopener noreferrer"
target="_blank"
>