aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2015-11-10 09:42:10 +0100
committerJulien HENRY <julien.henry@sonarsource.com>2015-11-10 14:32:00 +0100
commit7b6c311c7d076de58cb57b28c6a9a31d5c7c9afe (patch)
tree6be7723852fed64b4dfbe34c6ea6a9f732775793
parent5a8d95da69a698a82faa01e7b396e33de61d4975 (diff)
downloadsonar-scanner-cli-7b6c311c7d076de58cb57b28c6a9a31d5c7c9afe.tar.gz
sonar-scanner-cli-7b6c311c7d076de58cb57b28c6a9a31d5c7c9afe.zip
SQSCANNER-1 Extract SonarQube Scanner as a standalone project
-rw-r--r--.travis.yml12
-rw-r--r--README.md12
-rw-r--r--it/pom.xml6
-rw-r--r--it/src/test/java/com/sonar/runner/it/CacheTest.java2
-rw-r--r--it/src/test/java/com/sonar/runner/it/JavaTest.java2
-rw-r--r--it/src/test/java/com/sonar/runner/it/MultimoduleTest.java2
-rw-r--r--it/src/test/java/com/sonar/runner/it/RunnerTestCase.java2
-rw-r--r--it/src/test/java/com/sonar/runner/it/SonarRunnerTestSuite.java2
-rw-r--r--pom.xml6
-rwxr-xr-xsrc/main/assembly/bin/sonar-runner4
-rw-r--r--src/main/assembly/bin/sonar-runner.bat4
-rwxr-xr-xtravis.sh71
12 files changed, 63 insertions, 62 deletions
diff --git a/.travis.yml b/.travis.yml
index 7dc0f7c..bb57a38 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,13 +8,11 @@ install: true
script: ./travis.sh
env:
- - TESTS=CI
- - TESTS=IT-DEV
- - TESTS=IT-DEV-SQ51
- - TESTS=IT-DEV-LTS
-
-matrix:
- fast_finish: true
+ matrix:
+ - PR_ANALYSIS=true
+ - RUN_ITS=true SQ_VERSION=DEV
+ - RUN_ITS=true SQ_VERSION=5.1.2
+ - RUN_ITS=true SQ_VERSION=LTS
cache:
directories:
diff --git a/README.md b/README.md
index 59c22ce..710373c 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,10 @@
-SonarQube Runner [![Build Status](https://travis-ci.org/SonarSource/sonar-runner.svg?branch=master)](https://travis-ci.org/SonarSource/sonar-runner)
+SonarQube Scanner [![Build Status](https://travis-ci.org/SonarSource/sonar-scanner-cli.svg?branch=master)](https://travis-ci.org/SonarSource/sonar-scanner-cli)
=========================
-Bootstrapper of code analysis
+Official SonarQube Scanner used to start code analysis. Project configuration is read from a sonar-project.properties or passed on command line.
Documentation:
-http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Runner
+http://docs.sonarqube.org/display/SONAR/Analyzing+with+SonarQube+Scanner
Issue Tracker:
-http://jira.sonarsource.com/browse/SONARUNNER
-
-Release:
-sonar-runner-api need to be signed for use in SonarLint for Eclipse. So you need to pass following properties during perform:
-mvn release:perform -Djarsigner.keystore=<path to keystore.jks> -Djarsigner.storepass=<password> \ No newline at end of file
+http://jira.sonarsource.com/browse/SQSCANNER
diff --git a/it/pom.xml b/it/pom.xml
index 8cc71a0..6b3efff 100644
--- a/it/pom.xml
+++ b/it/pom.xml
@@ -11,9 +11,9 @@
</parent>
<groupId>com.sonarsource.it</groupId>
- <artifactId>it-sonar-runner</artifactId>
+ <artifactId>it-sonar-scanner</artifactId>
<version>1.0-SNAPSHOT</version>
- <name>SonarSource :: IT :: SonarQube Runner</name>
+ <name>SonarSource :: IT :: SonarQube Scanner</name>
<inceptionYear>2009</inceptionYear>
<organization>
@@ -31,7 +31,7 @@
<dependency>
<groupId>org.sonarsource.orchestrator</groupId>
<artifactId>sonar-orchestrator</artifactId>
- <version>3.5</version>
+ <version>3.8-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>junit</groupId>
diff --git a/it/src/test/java/com/sonar/runner/it/CacheTest.java b/it/src/test/java/com/sonar/runner/it/CacheTest.java
index 7e9c953..1300cef 100644
--- a/it/src/test/java/com/sonar/runner/it/CacheTest.java
+++ b/it/src/test/java/com/sonar/runner/it/CacheTest.java
@@ -1,5 +1,5 @@
/*
- * SonarSource :: IT :: SonarQube Runner
+ * SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
*
diff --git a/it/src/test/java/com/sonar/runner/it/JavaTest.java b/it/src/test/java/com/sonar/runner/it/JavaTest.java
index 1a8802c..a9ece3b 100644
--- a/it/src/test/java/com/sonar/runner/it/JavaTest.java
+++ b/it/src/test/java/com/sonar/runner/it/JavaTest.java
@@ -1,5 +1,5 @@
/*
- * SonarSource :: IT :: SonarQube Runner
+ * SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
*
diff --git a/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java b/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java
index 6f2a25c..c8941b2 100644
--- a/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java
+++ b/it/src/test/java/com/sonar/runner/it/MultimoduleTest.java
@@ -1,5 +1,5 @@
/*
- * SonarSource :: IT :: SonarQube Runner
+ * SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
*
diff --git a/it/src/test/java/com/sonar/runner/it/RunnerTestCase.java b/it/src/test/java/com/sonar/runner/it/RunnerTestCase.java
index 7323a55..79a1edd 100644
--- a/it/src/test/java/com/sonar/runner/it/RunnerTestCase.java
+++ b/it/src/test/java/com/sonar/runner/it/RunnerTestCase.java
@@ -1,5 +1,5 @@
/*
- * SonarSource :: IT :: SonarQube Runner
+ * SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
*
diff --git a/it/src/test/java/com/sonar/runner/it/SonarRunnerTestSuite.java b/it/src/test/java/com/sonar/runner/it/SonarRunnerTestSuite.java
index b219366..6157d7c 100644
--- a/it/src/test/java/com/sonar/runner/it/SonarRunnerTestSuite.java
+++ b/it/src/test/java/com/sonar/runner/it/SonarRunnerTestSuite.java
@@ -1,5 +1,5 @@
/*
- * SonarSource :: IT :: SonarQube Runner
+ * SonarSource :: IT :: SonarQube Scanner
* Copyright (C) 2009 SonarSource
* sonarqube@googlegroups.com
*
diff --git a/pom.xml b/pom.xml
index ab3ec7e..b54149c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -36,7 +36,7 @@
<issueManagement>
<system>JIRA</system>
- <url>https://jira.sonarsource.com/browse/SONARSCANNER</url>
+ <url>https://jira.sonarsource.com/browse/SQSCANNER</url>
</issueManagement>
<properties>
@@ -129,7 +129,7 @@
<goal>single</goal>
</goals>
<configuration>
- <finalName>sonar-runner-${project.version}</finalName>
+ <finalName>sonar-scanner-${project.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<escapeString>\</escapeString>
<descriptors>
@@ -156,7 +156,7 @@
<minsize>160000</minsize>
<maxsize>185000</maxsize>
<files>
- <file>${project.build.directory}/sonar-runner-${project.version}.zip</file>
+ <file>${project.build.directory}/sonar-scanner-${project.version}.zip</file>
</files>
</requireFilesSize>
</rules>
diff --git a/src/main/assembly/bin/sonar-runner b/src/main/assembly/bin/sonar-runner
index eea044a..ec2f426 100755
--- a/src/main/assembly/bin/sonar-runner
+++ b/src/main/assembly/bin/sonar-runner
@@ -80,7 +80,7 @@ if [ -z "$SONAR_RUNNER_HOME" ] ; then
fi
# check that the SONAR_RUNNER_HOME has been correctly set
-if [ ! -f "$SONAR_RUNNER_HOME/lib/sonar-runner-dist-${project.version}.jar" ] ; then
+if [ ! -f "$SONAR_RUNNER_HOME/lib/sonar-scanner-${project.version}.jar" ] ; then
echo '$SONAR_RUNNER_HOME' does not point to a valid installation directory: $SONAR_RUNNER_HOME
exit 1
fi
@@ -92,7 +92,7 @@ else
JAVA_CMD="`which java`"
fi
-JAR_FILE="${SONAR_RUNNER_HOME}"/lib/sonar-runner-dist-${project.version}.jar
+JAR_FILE="${SONAR_RUNNER_HOME}"/lib/sonar-scanner-${project.version}.jar
PROJECT_HOME=`pwd`
#echo "Info: Using sonar-runner at $SONAR_RUNNER_HOME"
diff --git a/src/main/assembly/bin/sonar-runner.bat b/src/main/assembly/bin/sonar-runner.bat
index 67fa742..72d054b 100644
--- a/src/main/assembly/bin/sonar-runner.bat
+++ b/src/main/assembly/bin/sonar-runner.bat
@@ -58,7 +58,7 @@ goto run
if "%SONAR_RUNNER_HOME:~-1%"=="\" set SONAR_RUNNER_HOME=%SONAR_RUNNER_HOME:~0,-1%
@REM Check if the provided SONAR_RUNNER_HOME is a valid install dir
-IF EXIST "%SONAR_RUNNER_HOME%\lib\sonar-runner-dist-${project.version}.jar" goto run
+IF EXIST "%SONAR_RUNNER_HOME%\lib\sonar-scanner-${project.version}.jar" goto run
echo.
echo ERROR: SONAR_RUNNER_HOME exists but does not point to a valid install
@@ -74,7 +74,7 @@ echo %SONAR_RUNNER_HOME%
set PROJECT_HOME=%CD%
-%JAVA_EXEC% -Djava.awt.headless=true %SONAR_RUNNER_OPTS% -cp "%SONAR_RUNNER_HOME%\lib\sonar-runner-dist-${project.version}.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" "-Dproject.home=%PROJECT_HOME%" org.sonar.runner.cli.Main %*
+%JAVA_EXEC% -Djava.awt.headless=true %SONAR_RUNNER_OPTS% -cp "%SONAR_RUNNER_HOME%\lib\sonar-scanner-${project.version}.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" "-Dproject.home=%PROJECT_HOME%" org.sonar.runner.cli.Main %*
if ERRORLEVEL 1 goto error
goto end
diff --git a/travis.sh b/travis.sh
index 7629444..a4056fb 100755
--- a/travis.sh
+++ b/travis.sh
@@ -8,41 +8,48 @@ function installTravisTools {
source ~/.local/bin/install
}
-case "$TESTS" in
+if [ -n "${PR_ANALYSIS:-}" ] && [ "${PR_ANALYSIS}" == true ]
+then
+ if [ "$TRAVIS_PULL_REQUEST" != "false" ]
+ then
+ # For security reasons environment variables are not available on the pull requests
+ # coming from outside repositories
+ # http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests
+ if [ -n "$SONAR_GITHUB_OAUTH" ]; then
+
+ # Switch to java 8 as the Dory HTTPS certificate is not supported by Java 7
+ export JAVA_HOME=/usr/lib/jvm/java-8-oracle
+ export PATH=$JAVA_HOME/bin:$PATH
+
+ # PR analysis
+ mvn verify sonar:sonar -B -e -V \
+ -Dsonar.analysis.mode=issues \
+ -Dsonar.github.pullRequest=$TRAVIS_PULL_REQUEST \
+ -Dsonar.github.repository=$TRAVIS_REPO_SLUG \
+ -Dsonar.github.login=$SONAR_GITHUB_LOGIN \
+ -Dsonar.github.oauth=$SONAR_GITHUB_OAUTH \
+ -Dsonar.host.url=$SONAR_HOST_URL \
+ -Dsonar.login=$SONAR_LOGIN \
+ -Dsonar.password=$SONAR_PASSWD
+ fi
+ fi
+else
+ # Regular CI (use install for ITs)
+ mvn install -B -e -V
+fi
+
+if [ -n "${RUN_ITS:-}" ] && [ "${RUN_ITS}" == true ]
+then
-CI)
installTravisTools
+ build_snapshot "SonarSource/orchestrator"
- mvn verify -B -e -V
- ;;
-
-IT-DEV)
- installTravisTools
-
- build_snapshot "SonarSource/sonarqube"
-
- mvn install -Dsource.skip=true -Denforcer.skip=true -Danimal.sniffer.skip=true -Dmaven.test.skip=true
-
- cd it
- mvn -DsonarRunner.version="2.5-SNAPSHOT" -Dsonar.runtimeVersion="DEV" -Dmaven.test.redirectTestOutputToFile=false install
- ;;
-
-IT-DEV-SQ51)
- installTravisTools
-
- mvn install -Dsource.skip=true -Denforcer.skip=true -Danimal.sniffer.skip=true -Dmaven.test.skip=true
-
- cd it
- mvn -DsonarRunner.version="2.5-SNAPSHOT" -Dsonar.runtimeVersion="5.1.2" -Dmaven.test.redirectTestOutputToFile=false install
- ;;
-
-IT-DEV-LTS)
- installTravisTools
-
- mvn install -Dsource.skip=true -Denforcer.skip=true -Danimal.sniffer.skip=true -Dmaven.test.skip=true
+ if [ "${SQ_VERSION}" == "DEV" ]
+ then
+ build_snapshot "SonarSource/sonarqube"
+ fi
cd it
- mvn -DsonarRunner.version="2.5-SNAPSHOT" -Dsonar.runtimeVersion="4.5.5" -Dmaven.test.redirectTestOutputToFile=false install
- ;;
+ mvn -DsonarRunner.version="2.5-SNAPSHOT" -Dsonar.runtimeVersion=$SQ_VERSION -Dmaven.test.redirectTestOutputToFile=false install
-esac
+fi