<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>
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;
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();
+ }
}
-#!/usr/bin/env bash
+#!/usr/bin/env sh
usage() {
echo usage: $0 path/to/sonar-scanner
scanner=$1
if type mktemp &>/dev/null; then
- tempdir=$(mktemp -d)
- tempdir=$(cd "$tempdir"; pwd -P)
+ tempdir=`mktemp -d`
+ tempdir=`cd "$tempdir"; pwd -P`
else
- tempdir=/tmp/"$(basename "$0")-$$"
+ tempdir=/tmp/"`basename "$0"`-$$"
mkdir -p "$tempdir"
fi
trap 'cleanup; exit 0' 0
abspath() {
- (cd "$(dirname "$1")"; echo $PWD/"$(basename "$1")")
+ (cd "`dirname "$1"`"; echo $PWD/"`basename "$1"`")
}
verify() {
)
}
-ln -s "$(abspath "$scanner")" "$tempdir"/scanner
+ln -s "`abspath "$scanner"`" "$tempdir"/scanner
verify 'launch from abs symlink to abs path' "$tempdir"/scanner -h
-ln -s "$(relpath_to_root "$tempdir")$(abspath "$scanner")" "$tempdir"/scanner-rel
+ln -s "`relpath_to_root "$tempdir"``abspath "$scanner"`" "$tempdir"/scanner-rel
verify 'symlink to rel path is valid' test -e "$tempdir"/scanner-rel
verify 'launch from abs symlink to rel path' "$tempdir"/scanner-rel -h
-#!/bin/sh
+#!/usr/bin/env sh
#
# SonarScanner Startup Script for Unix
#
(
while true; do
- cd "$(dirname "$target")"
- target=$(basename "$target")
+ cd "`dirname "$target"`"
+ target=`basename "$target"`
test -L "$target" || break
- target=$(readlink "$target")
+ target=`readlink "$target"`
done
- echo "$(pwd -P)/$target"
+ echo "`pwd -P`/$target"
)
}
-script_path=$(real_path "$0")
-sonar_scanner_home=$(dirname "$script_path")/..
+script_path=`real_path "$0"`
+sonar_scanner_home=`dirname "$script_path"`/..
# make it fully qualified
-sonar_scanner_home=$(cd "$sonar_scanner_home" && pwd -P)
+sonar_scanner_home=`cd "$sonar_scanner_home" && pwd -P`
jar_file=$sonar_scanner_home/lib/sonar-scanner-cli-${project.version}.jar
then
java_cmd="$JAVA_HOME/bin/java"
else
- java_cmd="$(which java)"
+ java_cmd="`which java`"
fi
if [ -z "$java_cmd" -o ! -x "$java_cmd" ] ; then
exit 1
fi
-project_home=$(pwd)
+project_home=`pwd`
#echo "Info: Using sonar-scanner at $sonar_scanner_home"
#echo "Info: Using java at $java_cmd"
-#!/bin/sh
+#!/usr/bin/env sh
#
# SonarScanner Startup Script for Unix
#
echo "Executing SonarScanner in Debug Mode"
echo "SONAR_SCANNER_DEBUG_OPTS=\"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=8000\""
-env SONAR_SCANNER_OPTS="$SONAR_SCANNER_OPTS" SONAR_SCANNER_DEBUG_OPTS="$SONAR_SCANNER_DEBUG_OPTS" "$(dirname "$0")"/sonar-scanner "$@"
+env SONAR_SCANNER_OPTS="$SONAR_SCANNER_OPTS" SONAR_SCANNER_DEBUG_OPTS="$SONAR_SCANNER_DEBUG_OPTS" "`dirname "$0"`"/sonar-scanner "$@"