diff options
author | Mark Rekveld <mark.rekveld@sonarsource.com> | 2020-09-24 08:29:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 08:29:18 +0200 |
commit | 4a8d1e3fda2a772671383ac6f6201a6b97605ac1 (patch) | |
tree | a94504cdaea34e69dfb9b14328f31e1431f5f25e /it | |
parent | 31dca6f1920a3468794a93e04b8dff30673e31e4 (diff) | |
download | sonar-scanner-cli-4a8d1e3fda2a772671383ac6f6201a6b97605ac1.tar.gz sonar-scanner-cli-4a8d1e3fda2a772671383ac6f6201a6b97605ac1.zip |
SQSCANNER-78 - backtick syntax (#83)
Diffstat (limited to 'it')
-rw-r--r-- | it/pom.xml | 2 | ||||
-rw-r--r-- | it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java | 26 |
2 files changed, 22 insertions, 6 deletions
@@ -36,7 +36,7 @@ <dependency> <groupId>org.sonarsource.orchestrator</groupId> <artifactId>sonar-orchestrator</artifactId> - <version>3.29.0.2543</version> + <version>3.30.0.2630</version> </dependency> <dependency> <groupId>junit</groupId> diff --git a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java index 5d76042..bc795b2 100644 --- a/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java +++ b/it/src/test/java/com/sonarsource/scanner/it/SonarScannerTestSuite.java @@ -20,6 +20,7 @@ package com.sonarsource.scanner.it; import com.sonar.orchestrator.Orchestrator; +import com.sonar.orchestrator.OrchestratorBuilder; import com.sonar.orchestrator.locator.MavenLocation; import org.junit.ClassRule; import org.junit.runner.RunWith; @@ -27,17 +28,32 @@ import org.junit.runners.Suite; import org.junit.runners.Suite.SuiteClasses; @RunWith(Suite.class) -@SuiteClasses({ScannerTest.class, MultimoduleTest.class, DistributionTest.class}) +@SuiteClasses({ScannerTest.class, MultimoduleTest.class, + DistributionTest.class}) public class SonarScannerTestSuite { @ClassRule - public static final Orchestrator ORCHESTRATOR = Orchestrator.builderEnv() - .setSonarVersion(System.getProperty("sonar.runtimeVersion", "LATEST_RELEASE[6.7]")) + public static final Orchestrator ORCHESTRATOR = createOrchestrator(); + + private static Orchestrator createOrchestrator() { + String sonarVersion = System + .getProperty("sonar.runtimeVersion", "LATEST_RELEASE[6.7]"); + OrchestratorBuilder builder = Orchestrator.builderEnv() + .setSonarVersion( + sonarVersion); // The scanner cli should still be compatible with previous LTS 6.7, and not the 7.9 // at the time of writing, so the installed plugins should be compatible with // both 6.7 and 8.x. The latest releases of analysers drop the compatibility with // 6.7, that's why versions are hardcoded here. - .addPlugin(MavenLocation.of("org.sonarsource.javascript", "sonar-javascript-plugin", "5.2.1.7778")) - .build(); + MavenLocation javascriptPlugin = MavenLocation + .of("org.sonarsource.javascript", "sonar-javascript-plugin", + "5.2.1.7778"); + if (sonarVersion.startsWith("DEV")) { + builder.addBundledPlugin(javascriptPlugin); + } else { + builder.addPlugin(javascriptPlugin); + } + return builder.build(); + } } |