@@ -6,8 +6,8 @@ | |||
<version>23</version> | |||
</parent> | |||
<groupId>org.sonarsource.scanner</groupId> | |||
<artifactId>sonar-scanner</artifactId> | |||
<groupId>org.sonarsource.scanner.cli</groupId> | |||
<artifactId>sonar-scanner-cli</artifactId> | |||
<version>2.5-SNAPSHOT</version> | |||
<packaging>jar</packaging> | |||
<name>SonarQube Scanner</name> |
@@ -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-scanner-${project.version}.jar" ] ; then | |||
if [ ! -f "$SONAR_RUNNER_HOME/lib/sonar-scanner-cli-${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-scanner-${project.version}.jar | |||
JAR_FILE="${SONAR_RUNNER_HOME}"/lib/sonar-scanner-cli-${project.version}.jar | |||
PROJECT_HOME=`pwd` | |||
#echo "Info: Using sonar-runner at $SONAR_RUNNER_HOME" | |||
@@ -106,5 +106,5 @@ exec "$JAVA_CMD" \ | |||
-classpath $JAR_FILE \ | |||
"-Drunner.home=\${SONAR_RUNNER_HOME}" \ | |||
"-Dproject.home=\${PROJECT_HOME}" \ | |||
org.sonar.runner.cli.Main "$@" | |||
org.sonarsource.scanner.cli.Main "$@" | |||
@@ -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-scanner-${project.version}.jar" goto run | |||
IF EXIST "%SONAR_RUNNER_HOME%\lib\sonar-scanner-cli-${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-scanner-${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-cli-${project.version}.jar" "-Drunner.home=%SONAR_RUNNER_HOME%" "-Dproject.home=%PROJECT_HOME%" org.sonarsource.scanner.cli.Main %* | |||
if ERRORLEVEL 1 goto error | |||
goto end | |||
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import java.util.Properties; | |||
import org.sonar.runner.api.RunnerProperties; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import java.io.File; | |||
import java.io.FileInputStream; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
class Exit { | |||
static final int SUCCESS = 0; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import java.io.PrintStream; | |||
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import java.io.BufferedReader; | |||
import java.io.IOException; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import java.util.Properties; | |||
import org.sonar.runner.api.EmbeddedRunner; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
class Shutdown { | |||
static final int SUCCESS = 0; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
class Stats { | |||
private final Logs logger; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import org.sonar.runner.api.RunnerVersion; | |||
@@ -18,7 +18,7 @@ | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import javax.annotation.ParametersAreNonnullByDefault; | |||
@@ -17,9 +17,12 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import org.junit.Test; | |||
import org.sonarsource.scanner.cli.Cli; | |||
import org.sonarsource.scanner.cli.Exit; | |||
import org.sonarsource.scanner.cli.Logs; | |||
import static org.fest.assertions.Assertions.assertThat; | |||
import static org.mockito.Mockito.mock; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import java.io.File; | |||
import java.util.Properties; | |||
@@ -47,7 +47,7 @@ public class ConfTest { | |||
@Test | |||
public void should_load_global_settings_by_home() throws Exception { | |||
File home = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByHome/").toURI()); | |||
File home = new File(getClass().getResource("ConfTest/shouldLoadRunnerSettingsByHome/").toURI()); | |||
args.setProperty("runner.home", home.getCanonicalPath()); | |||
assertThat(conf.properties().get("sonar.prop")).isEqualTo("value"); | |||
@@ -60,7 +60,7 @@ public class ConfTest { | |||
@Test | |||
public void should_load_conf_by_direct_path() throws Exception { | |||
File settings = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadRunnerSettingsByDirectPath/other-conf.properties").toURI()); | |||
File settings = new File(getClass().getResource("ConfTest/shouldLoadRunnerSettingsByDirectPath/other-conf.properties").toURI()); | |||
args.setProperty("runner.settings", settings.getCanonicalPath()); | |||
assertThat(conf.properties().get("sonar.prop")).isEqualTo("otherValue"); | |||
@@ -68,8 +68,8 @@ public class ConfTest { | |||
@Test | |||
public void shouldLoadCompleteConfiguration() throws Exception { | |||
File runnerHome = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadCompleteConfiguration/runner").toURI()); | |||
File projectHome = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadCompleteConfiguration/project").toURI()); | |||
File runnerHome = new File(getClass().getResource("ConfTest/shouldLoadCompleteConfiguration/runner").toURI()); | |||
File projectHome = new File(getClass().getResource("ConfTest/shouldLoadCompleteConfiguration/project").toURI()); | |||
args.setProperty("runner.home", runnerHome.getCanonicalPath()); | |||
args.setProperty("project.home", projectHome.getCanonicalPath()); | |||
@@ -82,7 +82,7 @@ public class ConfTest { | |||
@Test | |||
public void shouldLoadModuleConfiguration() throws Exception { | |||
File projectHome = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadModuleConfiguration/project").toURI()); | |||
File projectHome = new File(getClass().getResource("ConfTest/shouldLoadModuleConfiguration/project").toURI()); | |||
args.setProperty("project.home", projectHome.getCanonicalPath()); | |||
Properties properties = conf.properties(); | |||
@@ -93,7 +93,7 @@ public class ConfTest { | |||
@Test | |||
public void shouldSupportDeepModuleConfigurationInRoot() throws Exception { | |||
File projectHome = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldSupportDeepModuleConfigurationInRoot/project").toURI()); | |||
File projectHome = new File(getClass().getResource("ConfTest/shouldSupportDeepModuleConfigurationInRoot/project").toURI()); | |||
args.setProperty("project.home", projectHome.getCanonicalPath()); | |||
Properties properties = conf.properties(); | |||
@@ -110,7 +110,7 @@ public class ConfTest { | |||
@Test | |||
public void shouldLoadModuleConfigurationOverrideBasedir() throws Exception { | |||
File projectHome = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadModuleConfigurationOverrideBasedir/project").toURI()); | |||
File projectHome = new File(getClass().getResource("ConfTest/shouldLoadModuleConfigurationOverrideBasedir/project").toURI()); | |||
args.setProperty("project.home", projectHome.getCanonicalPath()); | |||
Properties properties = conf.properties(); | |||
@@ -122,7 +122,7 @@ public class ConfTest { | |||
@Test | |||
public void shouldSupportSettingBaseDirFromCli() throws Exception { | |||
File projectHome = new File(getClass().getResource("/org/sonar/runner/ConfTest/shouldLoadModuleConfiguration/project").toURI()); | |||
File projectHome = new File(getClass().getResource("ConfTest/shouldLoadModuleConfiguration/project").toURI()); | |||
args.setProperty("project.home", temp.newFolder().getCanonicalPath()); | |||
args.setProperty("sonar.projectBaseDir", projectHome.getCanonicalPath()); | |||
@@ -134,7 +134,7 @@ public class ConfTest { | |||
@Test | |||
public void ignoreEmptyModule() throws Exception { | |||
File projectHome = new File(getClass().getResource("/org/sonar/runner/ConfTest/emptyModules/project").toURI()); | |||
File projectHome = new File(getClass().getResource("ConfTest/emptyModules/project").toURI()); | |||
args.setProperty("project.home", temp.newFolder().getCanonicalPath()); | |||
args.setProperty("sonar.projectBaseDir", projectHome.getCanonicalPath()); | |||
@@ -17,13 +17,13 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import org.junit.Before; | |||
import org.junit.Test; | |||
import org.mockito.Mock; | |||
import org.mockito.MockitoAnnotations; | |||
import org.sonarsource.scanner.cli.Logs; | |||
import java.io.PrintStream; | |||
import static org.mockito.Mockito.verifyNoMoreInteractions; |
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import java.io.BufferedReader; | |||
import java.io.ByteArrayInputStream; | |||
@@ -32,6 +32,13 @@ import org.mockito.Mock; | |||
import org.mockito.Mockito; | |||
import org.mockito.MockitoAnnotations; | |||
import org.sonar.runner.api.EmbeddedRunner; | |||
import org.sonarsource.scanner.cli.Cli; | |||
import org.sonarsource.scanner.cli.Conf; | |||
import org.sonarsource.scanner.cli.Exit; | |||
import org.sonarsource.scanner.cli.Logs; | |||
import org.sonarsource.scanner.cli.Main; | |||
import org.sonarsource.scanner.cli.RunnerFactory; | |||
import org.sonarsource.scanner.cli.Shutdown; | |||
import static org.mockito.Matchers.any; | |||
import static org.mockito.Mockito.doThrow; |
@@ -17,9 +17,11 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import org.sonar.runner.api.LogOutput.Level; | |||
import org.sonarsource.scanner.cli.Logs; | |||
import org.sonarsource.scanner.cli.RunnerFactory; | |||
import org.sonar.runner.api.LogOutput; | |||
import org.junit.Before; | |||
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import com.jayway.awaitility.Duration; | |||
import java.util.concurrent.Callable; | |||
@@ -26,6 +26,8 @@ import org.junit.Before; | |||
import org.junit.Test; | |||
import org.mockito.Mock; | |||
import org.mockito.MockitoAnnotations; | |||
import org.sonarsource.scanner.cli.Exit; | |||
import org.sonarsource.scanner.cli.Shutdown; | |||
import static com.jayway.awaitility.Awaitility.await; | |||
import static org.fest.assertions.Assertions.assertThat; |
@@ -17,10 +17,11 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import org.mockito.Mockito; | |||
import org.sonarsource.scanner.cli.Logs; | |||
import org.sonarsource.scanner.cli.Stats; | |||
import java.io.PrintStream; | |||
import java.io.UnsupportedEncodingException; | |||
@@ -17,7 +17,7 @@ | |||
* License along with this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||
*/ | |||
package org.sonar.runner.cli; | |||
package org.sonarsource.scanner.cli; | |||
import static org.mockito.Mockito.mock; | |||
import static org.mockito.Mockito.when; | |||
@@ -26,10 +26,12 @@ import static org.mockito.Mockito.verify; | |||
import static org.mockito.Mockito.verifyNoMoreInteractions; | |||
import org.sonar.runner.api.RunnerVersion; | |||
import org.sonarsource.scanner.cli.Logs; | |||
import org.sonarsource.scanner.cli.SystemInfo; | |||
import org.sonarsource.scanner.cli.SystemInfo.System2; | |||
import org.junit.Before; | |||
import org.sonar.runner.cli.SystemInfo.System2; | |||
import org.junit.Test; | |||
import org.sonar.runner.cli.SystemInfo; | |||
import static org.fest.assertions.Assertions.assertThat; | |||
public class SystemInfoTest { |