-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ITs for S4NET netcore versions (#1233)
- Loading branch information
1 parent
c8ab09f
commit 3ee16c0
Showing
3 changed files
with
145 additions
and
16 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
its/src/test/java/com/sonar/it/scanner/msbuild/ScannerClassifier.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* SonarScanner for .NET | ||
* Copyright (C) 2016-2022 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. | ||
*/ | ||
package com.sonar.it.scanner.msbuild; | ||
|
||
import com.sonar.orchestrator.locator.FileLocation; | ||
import com.sonar.orchestrator.locator.Location; | ||
|
||
import java.nio.file.Paths; | ||
|
||
public enum ScannerClassifier { | ||
NETCORE_2_1("netcoreapp2.0"), | ||
NETCORE_3_1("netcoreapp3.0"), | ||
NET_5("net5.0"), | ||
NET_FRAMEWORK_46("net46"); | ||
|
||
private final String classifier; | ||
|
||
ScannerClassifier(String classifier) { | ||
this.classifier = classifier; | ||
} | ||
|
||
public String toString() { | ||
return classifier; | ||
} | ||
|
||
public String toZipName() { | ||
return "sonarscanner-msbuild-" + classifier + ".zip"; | ||
} | ||
|
||
public Location toLocation(String scannerLocation) { | ||
return FileLocation.of(Paths.get(scannerLocation, toZipName()).toFile()); | ||
} | ||
|
||
public boolean isDotNetCore() { | ||
return !classifier.equals(NET_FRAMEWORK_46.classifier); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters