aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--assembly.xml17
-rw-r--r--pom.xml29
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/Cli.java4
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/Main.java10
-rw-r--r--src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java (renamed from src/main/java/org/sonarsource/scanner/cli/RunnerFactory.java)12
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/MainTest.java12
-rw-r--r--src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java (renamed from src/test/java/org/sonarsource/scanner/cli/RunnerFactoryTest.java)17
-rwxr-xr-xtravis.sh1
8 files changed, 43 insertions, 59 deletions
diff --git a/assembly.xml b/assembly.xml
index d438fdf..e1ba25c 100644
--- a/assembly.xml
+++ b/assembly.xml
@@ -7,16 +7,6 @@
<format>zip</format>
</formats>
<includeBaseDirectory>true</includeBaseDirectory>
- <dependencySets>
- <dependencySet>
- <outputDirectory>lib</outputDirectory>
- <useTransitiveFiltering>true</useTransitiveFiltering>
- <useProjectArtifact>true</useProjectArtifact>
- <excludes>
- <exclude>org.sonarsource.sonar-runner:sonar-runner-api</exclude>
- </excludes>
- </dependencySet>
- </dependencySets>
<fileSets>
<fileSet>
<directory>src/main/assembly/bin</directory>
@@ -43,5 +33,12 @@
<fileMode>0644</fileMode>
<lineEnding>dos</lineEnding>
</fileSet>
+ <fileSet>
+ <directory>${project.build.directory}</directory>
+ <outputDirectory>lib</outputDirectory>
+ <includes>
+ <include>${project.build.finalName}.jar</include>
+ </includes>
+ </fileSet>
</fileSets>
</assembly>
diff --git a/pom.xml b/pom.xml
index 0bd8cc3..d490039 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
<parent>
<groupId>org.sonarsource.parent</groupId>
<artifactId>parent</artifactId>
- <version>28</version>
+ <version>31</version>
</parent>
<groupId>org.sonarsource.scanner.cli</groupId>
@@ -48,9 +48,9 @@
<dependencies>
<dependency>
- <groupId>org.sonarsource.sonar-runner</groupId>
- <artifactId>sonar-runner-api</artifactId>
- <version>2.5.1</version>
+ <groupId>org.sonarsource.scanner.api</groupId>
+ <artifactId>sonar-scanner-api</artifactId>
+ <version>2.6-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.code.findbugs</groupId>
@@ -98,13 +98,10 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
- <excludes>
- <exclude>org/sonar/runner/commonsio/*</exclude>
- </excludes>
<archive>
<manifest>
<addClasspath>false</addClasspath>
- <mainClass>org.sonar.runner.cli.Main</mainClass>
+ <mainClass>org.sonarsource.scanner.cli.Main</mainClass>
</manifest>
</archive>
</configuration>
@@ -113,7 +110,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
- <version>2.3</version>
<executions>
<execution>
<phase>package</phase>
@@ -123,17 +119,6 @@
<configuration>
<createDependencyReducedPom>true</createDependencyReducedPom>
<minimizeJar>true</minimizeJar>
- <filters>
- <!-- Remove signatures from SQ Runner API -->
- <filter>
- <artifact>org.sonarsource.sonar-runner:sonar-runner-api</artifact>
- <excludes>
- <exclude>META-INF/*.SF</exclude>
- <exclude>META-INF/*.DSA</exclude>
- <exclude>META-INF/*.RSA</exclude>
- </excludes>
- </filter>
- </filters>
</configuration>
</execution>
</executions>
@@ -173,8 +158,8 @@
<configuration>
<rules>
<requireFilesSize>
- <minsize>510000</minsize>
- <maxsize>520000</maxsize>
+ <minsize>490000</minsize>
+ <maxsize>500000</maxsize>
<files>
<file>${project.build.directory}/sonar-scanner-${project.version}.zip</file>
</files>
diff --git a/src/main/java/org/sonarsource/scanner/cli/Cli.java b/src/main/java/org/sonarsource/scanner/cli/Cli.java
index f8f1fb8..6544cc2 100644
--- a/src/main/java/org/sonarsource/scanner/cli/Cli.java
+++ b/src/main/java/org/sonarsource/scanner/cli/Cli.java
@@ -20,7 +20,7 @@
package org.sonarsource.scanner.cli;
import java.util.Properties;
-import org.sonar.runner.api.RunnerProperties;
+import org.sonarsource.scanner.api.ScannerProperties;
class Cli {
@@ -63,7 +63,7 @@ class Cli {
for (int i = 0; i < args.length; i++) {
String arg = args[i];
if (i == 0 && arg.charAt(0) != '-') {
- props.setProperty(RunnerProperties.TASK, arg);
+ props.setProperty(ScannerProperties.TASK, arg);
} else if ("-h".equals(arg) || "--help".equals(arg)) {
printUsage();
diff --git a/src/main/java/org/sonarsource/scanner/cli/Main.java b/src/main/java/org/sonarsource/scanner/cli/Main.java
index 7ea4f30..0f6c1eb 100644
--- a/src/main/java/org/sonarsource/scanner/cli/Main.java
+++ b/src/main/java/org/sonarsource/scanner/cli/Main.java
@@ -24,7 +24,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Properties;
-import org.sonar.runner.api.EmbeddedRunner;
+import org.sonarsource.scanner.api.EmbeddedScanner;
/**
* Arguments :
@@ -43,12 +43,12 @@ public class Main {
private final Shutdown shutdown;
private final Cli cli;
private final Conf conf;
- private EmbeddedRunner runner;
+ private EmbeddedScanner runner;
private BufferedReader inputReader;
- private RunnerFactory runnerFactory;
+ private ScannerFactory runnerFactory;
private Logs logger;
- Main(Shutdown shutdown, Cli cli, Conf conf, RunnerFactory runnerFactory, Logs logger) {
+ Main(Shutdown shutdown, Cli cli, Conf conf, ScannerFactory runnerFactory, Logs logger) {
this.shutdown = shutdown;
this.cli = cli;
this.conf = conf;
@@ -62,7 +62,7 @@ public class Main {
Cli cli = new Cli(exit, logs).parse(args);
cli.verify();
Shutdown shutdown = new Shutdown(exit, cli.isInteractive());
- Main main = new Main(shutdown, cli, new Conf(cli, logs), new RunnerFactory(logs), logs);
+ Main main = new Main(shutdown, cli, new Conf(cli, logs), new ScannerFactory(logs), logs);
main.execute();
}
diff --git a/src/main/java/org/sonarsource/scanner/cli/RunnerFactory.java b/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java
index 4bc1dce..c8144d7 100644
--- a/src/main/java/org/sonarsource/scanner/cli/RunnerFactory.java
+++ b/src/main/java/org/sonarsource/scanner/cli/ScannerFactory.java
@@ -20,19 +20,19 @@
package org.sonarsource.scanner.cli;
import java.util.Properties;
-import org.sonar.runner.api.EmbeddedRunner;
-import org.sonar.runner.api.LogOutput;
+import org.sonarsource.scanner.api.EmbeddedScanner;
+import org.sonarsource.scanner.api.LogOutput;
-class RunnerFactory {
+class ScannerFactory {
private final Logs logger;
- public RunnerFactory(Logs logger) {
+ public ScannerFactory(Logs logger) {
this.logger = logger;
}
- EmbeddedRunner create(Properties props) {
- return EmbeddedRunner.create(new DefaultLogOutput()).addGlobalProperties(props);
+ EmbeddedScanner create(Properties props) {
+ return EmbeddedScanner.create(new DefaultLogOutput()).addGlobalProperties(props);
}
class DefaultLogOutput implements LogOutput {
diff --git a/src/test/java/org/sonarsource/scanner/cli/MainTest.java b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
index c0fbd65..4e5da4e 100644
--- a/src/test/java/org/sonarsource/scanner/cli/MainTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/MainTest.java
@@ -32,7 +32,7 @@ import org.mockito.InOrder;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
-import org.sonar.runner.api.EmbeddedRunner;
+import org.sonarsource.scanner.api.EmbeddedScanner;
import static org.fest.assertions.Assertions.assertThat;
import static org.mockito.Matchers.any;
@@ -54,9 +54,9 @@ public class MainTest {
@Mock
private Properties properties;
@Mock
- private RunnerFactory runnerFactory;
+ private ScannerFactory runnerFactory;
@Mock
- private EmbeddedRunner runner;
+ private EmbeddedScanner runner;
@Mock
private Logs logs;
@@ -82,7 +82,7 @@ public class MainTest {
@Test
public void should_stop_on_error() {
- EmbeddedRunner runner = mock(EmbeddedRunner.class);
+ EmbeddedScanner runner = mock(EmbeddedScanner.class);
Exception e = new NullPointerException("NPE");
e = new IllegalStateException("Error", e);
doThrow(e).when(runner).runAnalysis(any(Properties.class));
@@ -126,7 +126,7 @@ public class MainTest {
when(cli.isDebugEnabled()).thenReturn(debugEnabled);
when(cli.isDisplayStackTrace()).thenReturn(stackTraceEnabled);
- EmbeddedRunner runner = mock(EmbeddedRunner.class);
+ EmbeddedScanner runner = mock(EmbeddedScanner.class);
doThrow(e).when(runner).runAnalysis(any(Properties.class));
when(runnerFactory.create(any(Properties.class))).thenReturn(runner);
@@ -140,7 +140,7 @@ public class MainTest {
@Test
public void should_not_stop_on_error_in_interactive_mode() throws Exception {
- EmbeddedRunner runner = mock(EmbeddedRunner.class);
+ EmbeddedScanner runner = mock(EmbeddedScanner.class);
doThrow(new IllegalStateException("Error")).when(runner).runAnalysis(any(Properties.class));
when(runnerFactory.create(any(Properties.class))).thenReturn(runner);
when(cli.isInteractive()).thenReturn(true);
diff --git a/src/test/java/org/sonarsource/scanner/cli/RunnerFactoryTest.java b/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java
index 5807952..2e60e81 100644
--- a/src/test/java/org/sonarsource/scanner/cli/RunnerFactoryTest.java
+++ b/src/test/java/org/sonarsource/scanner/cli/ScannerFactoryTest.java
@@ -19,10 +19,11 @@
*/
package org.sonarsource.scanner.cli;
-import org.sonar.runner.api.LogOutput.Level;
+import org.sonarsource.scanner.api.EmbeddedScanner;
+import org.sonarsource.scanner.api.LogOutput;
+import org.sonarsource.scanner.api.LogOutput.Level;
import org.sonarsource.scanner.cli.Logs;
-import org.sonarsource.scanner.cli.RunnerFactory;
-import org.sonar.runner.api.LogOutput;
+import org.sonarsource.scanner.cli.ScannerFactory;
import org.junit.Before;
import java.util.Properties;
@@ -33,10 +34,10 @@ import static org.mockito.Mockito.reset;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.mock;
import org.junit.Test;
-import org.sonar.runner.api.EmbeddedRunner;
+
import static org.fest.assertions.Assertions.assertThat;
-public class RunnerFactoryTest {
+public class ScannerFactoryTest {
Properties props = new Properties();
Logs logs;
@@ -49,15 +50,15 @@ public class RunnerFactoryTest {
@Test
public void should_create_embedded_runner() {
props.setProperty("foo", "bar");
- EmbeddedRunner runner = new RunnerFactory(logs).create(props);
+ EmbeddedScanner runner = new ScannerFactory(logs).create(props);
- assertThat(runner).isInstanceOf(EmbeddedRunner.class);
+ assertThat(runner).isInstanceOf(EmbeddedScanner.class);
assertThat(runner.globalProperties().get("foo")).isEqualTo("bar");
}
@Test
public void should_fwd_logs() {
- LogOutput logOutput = new RunnerFactory(logs).new DefaultLogOutput();
+ LogOutput logOutput = new ScannerFactory(logs).new DefaultLogOutput();
String msg = "test";
diff --git a/travis.sh b/travis.sh
index 5fba286..f9a9784 100755
--- a/travis.sh
+++ b/travis.sh
@@ -9,6 +9,7 @@ function configureTravis {
}
configureTravis
+build_snapshot SonarSource/sonar-scanner-api
case "$TARGET" in