This repository has been archived by the owner on Jul 8, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SonarQube 6.* support, and fixing various minor Linux issues
- Loading branch information
1 parent
cc8c4be
commit 1c2ac3a
Showing
28 changed files
with
1,101 additions
and
1,139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
language: java | ||
jdk: | ||
- oraclejdk8 | ||
|
||
addons: | ||
artifacts: | ||
s3_region: "us-west-2" | ||
paths: | ||
- $(ls ./target/*.jar | tr "\n" ":") | ||
target_paths: builds/$TRAVIS_BRANCH/$TRAVIS_BUILD_NUMBER | ||
|
||
after_success: | ||
- mvn clean cobertura:cobertura coveralls:report | ||
- mvn cobertura:cobertura coveralls:report |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
<groupId>com.pablissimo.sonar</groupId> | ||
<artifactId>sonar-typescript-plugin</artifactId> | ||
<packaging>sonar-plugin</packaging> | ||
<version>0.9-SNAPSHOT</version> | ||
<version>0.94-SNAPSHOT</version> | ||
|
||
<name>TypeScript</name> | ||
<description>Analyse TypeScript projects</description> | ||
|
@@ -29,7 +29,7 @@ | |
<connection>scm:git:[email protected]:Pablissimo/SonarTsPlugin.git</connection> | ||
<developerConnection>scm:git:[email protected]:Pablissimo/SonarTsPlugin.git</developerConnection> | ||
<url>https://github.com/Pablissimo/SonarTsPlugin</url> | ||
<tag>0.9</tag> | ||
<tag>1.0</tag> | ||
</scm> | ||
<issueManagement> | ||
<system>Github</system> | ||
|
@@ -42,14 +42,15 @@ | |
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
|
||
<sonar.buildVersion>4.4</sonar.buildVersion> | ||
<jdk.min.version>1.7</jdk.min.version> | ||
|
||
<sonar.buildVersion>5.6</sonar.buildVersion> | ||
<jdk.min.version>1.8</jdk.min.version> | ||
<sslr.version>1.21</sslr.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.codehaus.sonar</groupId> | ||
<groupId>org.sonarsource.sonarqube</groupId> | ||
<artifactId>sonar-plugin-api</artifactId> | ||
<version>${sonar.buildVersion}</version> | ||
<scope>provided</scope> | ||
|
@@ -60,14 +61,35 @@ | |
<artifactId>gson</artifactId> | ||
<version>2.3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.4</version> | ||
</dependency> | ||
|
||
<!-- unit tests --> | ||
<dependency> | ||
<groupId>org.codehaus.sonar</groupId> | ||
<groupId>org.sonarsource.sonarqube</groupId> | ||
<artifactId>sonar-testing-harness</artifactId> | ||
<version>${sonar.buildVersion}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.sonarsource.sslr</groupId> | ||
<artifactId>sslr-testing-harness</artifactId> | ||
<version>${sslr.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-lang</groupId> | ||
<artifactId>commons-lang</artifactId> | ||
<version>2.6</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>commons-collections</groupId> | ||
<artifactId>commons-collections</artifactId> | ||
<version>3.0</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
|
@@ -97,9 +119,9 @@ | |
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.codehaus.sonar</groupId> | ||
<groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId> | ||
<artifactId>sonar-packaging-maven-plugin</artifactId> | ||
<version>1.3</version> | ||
<version>1.16</version> | ||
<extensions>true</extensions> | ||
<configuration> | ||
<pluginKey>typescript</pluginKey> | ||
|
@@ -113,6 +135,12 @@ | |
<configuration> | ||
<source>${jdk.min.version}</source> | ||
<target>${jdk.min.version}</target> | ||
|
||
<showDeprecation>true</showDeprecation> | ||
<compilerArgs> | ||
<arg>-Xlint:all</arg> | ||
<arg>-Werror</arg> | ||
</compilerArgs> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
|
@@ -136,7 +164,7 @@ | |
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>cobertura-maven-plugin</artifactId> | ||
<version>2.6</version> | ||
<version>2.7</version> | ||
<configuration> | ||
<formats> | ||
<format>xml</format> | ||
|
37 changes: 37 additions & 0 deletions
37
src/main/java/com/pablissimo/sonar/CombinedCoverageSensor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.pablissimo.sonar; | ||
|
||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import org.sonar.api.batch.fs.InputFile; | ||
import org.sonar.api.batch.sensor.Sensor; | ||
import org.sonar.api.batch.sensor.SensorContext; | ||
import org.sonar.api.batch.sensor.SensorDescriptor; | ||
|
||
public class CombinedCoverageSensor implements Sensor { | ||
|
||
protected LOCSensor getLOCSensor() { | ||
return new LOCSensorImpl(); | ||
} | ||
|
||
protected TsCoverageSensor getCoverageSensor() { | ||
return new TsCoverageSensorImpl(); | ||
} | ||
|
||
@Override | ||
public void describe(SensorDescriptor descriptor) { | ||
descriptor.name("Combined LCOV and LOC sensor"); | ||
descriptor.onlyOnLanguage(TypeScriptLanguage.LANGUAGE_KEY); | ||
} | ||
|
||
@Override | ||
public void execute(SensorContext context) { | ||
// First - LOC everything up, as we'll need LOC for uncovered lines metrics | ||
Map<InputFile, Set<Integer>> nonCommentLinesByFile = getLOCSensor().execute(context); | ||
|
||
// Now the LCOV pass can properly handle files that don't appear in | ||
// configuration and set lines-to-cover values as required | ||
getCoverageSensor().execute(context, nonCommentLinesByFile); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.