Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 24 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<artifactId>diff-coverage-maven-plugin</artifactId>
<name>${project.groupId}:${project.artifactId}</name>
<packaging>maven-plugin</packaging>
<version>0.3.1</version>
<version>0.3.2.2</version>
<description>
Diff coverage maven plugin builds code coverage report of new and modified code based on a provided diff
</description>
Expand Down Expand Up @@ -55,13 +55,19 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<kotlin.code.style>official</kotlin.code.style>
<diff.source>HEAD</diff.source>

<maven.version>3.9.4</maven.version>
<maven.plugin.tools.version>3.9.0</maven.plugin.tools.version>

<kotlin.version>1.4.32</kotlin.version>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<kotlin.code.style>official</kotlin.code.style>
<junit.version>4.13.2</junit.version>
<maven.version>3.8.6</maven.version>

<diff.source>HEAD</diff.source>
<jacoco.version>0.8.10</jacoco.version>
<delt.coverage.core.version>0.9.5</delt.coverage.core.version>
<diff.coverage.plugin.version>0.3.2</diff.coverage.plugin.version>
</properties>

<pluginRepositories>
Expand All @@ -82,7 +88,7 @@
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
<version>3.6.4</version>
<version>${maven.plugin.tools.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand All @@ -107,24 +113,30 @@
<dependency>
<groupId>com.github.form-com.diff-coverage-gradle</groupId>
<artifactId>jacoco-filtering-extension</artifactId>
<version>0.9.5</version>
<version>${delt.coverage.core.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.core</artifactId>
<version>0.8.8</version>
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.report</artifactId>
<version>0.8.8</version>
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>6.2.0.202206071550-r</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.5.1</version>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down Expand Up @@ -159,13 +171,13 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.4</version>
<version>${maven.plugin.tools.version}</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>${jacoco.version}</version>
<executions>
<execution>
<id>pre-unit-test</id>
Expand Down Expand Up @@ -257,7 +269,7 @@
<plugin>
<groupId>com.github.surpsg</groupId>
<artifactId>diff-coverage-maven-plugin</artifactId>
<version>0.3.0</version>
<version>${diff.coverage.plugin.version}</version>
<configuration>
<dataFile>${project.build.directory}/fullCoverage.exec</dataFile>
<diffSource>
Expand Down Expand Up @@ -346,4 +358,4 @@
</profile>
</profiles>

</project>
</project>
1 change: 0 additions & 1 deletion src/it/exclude-classes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<plugin>
<groupId>com.github.surpsg</groupId>
<artifactId>diff-coverage-maven-plugin</artifactId>
<version>0.3.0</version>
<configuration>
<diffSource>
<file>diffFile.patch</file>
Expand Down
1 change: 0 additions & 1 deletion src/it/excluded-all-classes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<plugin>
<groupId>com.github.surpsg</groupId>
<artifactId>diff-coverage-maven-plugin</artifactId>
<version>0.3.0</version>
<configuration>
<diffSource>
<file>diffFile.patch</file>
Expand Down
1 change: 0 additions & 1 deletion src/it/include-classes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<plugin>
<groupId>com.github.surpsg</groupId>
<artifactId>diff-coverage-maven-plugin</artifactId>
<version>0.3.0</version>
<configuration>
<diffSource>
<file>diffFile.patch</file>
Expand Down
1 change: 0 additions & 1 deletion src/it/include-exclude-classes/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<plugin>
<groupId>com.github.surpsg</groupId>
<artifactId>diff-coverage-maven-plugin</artifactId>
<version>0.3.0</version>
<configuration>
<diffSource>
<file>diffFile.patch</file>
Expand Down
24 changes: 24 additions & 0 deletions src/it/multi-module-reports-exclusions-check/report/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,30 @@
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-resource-one</id>
<phase>package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>target</outputDirectory>
<resources>
<resource>
<directory>../moduleA/target</directory>
</resource>
<resource>
<directory>../moduleB/target</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
6 changes: 3 additions & 3 deletions src/it/multi-module-reports-exclusions-check/verify.bsh
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ if ( !csvReportFile.exists() || !csvReportFile.isFile() ) {
throw new RuntimeException( "CSV report file wasn't found: " + csvReportFile.getAbsolutePath() );
}

String expectedInstructionsErrMsg = "[INFO] New violation: Rule violated for bundle multi-module-reports-exclusions-check: instructions covered ratio is 0.5, but expected minimum is 0.6";
String expectedLinesErrMsg = "[INFO] New violation: Rule violated for bundle multi-module-reports-exclusions-check: lines covered ratio is 0.5, but expected minimum is 0.7";
String unexpectedBranchesErrMsg = "[INFO] New violation: Rule violated for bundle multi-module-reports-exclusions-check: branches covered ratio";
String expectedInstructionsErrMsg = "[INFO] New violation: Rule violated for bundle report: instructions covered ratio is 0.5, but expected minimum is 0.6";
String expectedLinesErrMsg = "[INFO] New violation: Rule violated for bundle report: lines covered ratio is 0.5, but expected minimum is 0.7";
String unexpectedBranchesErrMsg = "[INFO] New violation: Rule violated for bundle report: branches covered ratio";

String buildLog = FileUtils.fileRead( new File( basedir, "build.log" ) );
if ( !buildLog.contains( expectedInstructionsErrMsg ) ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ new file mode 100644
+ }
+ System.out.println("return");
+ }
+}
+}
25 changes: 25 additions & 0 deletions src/it/multi-module-reports-generation-check/moduleA/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,30 @@
<artifactId>it-check-passes</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<build>
<plugins>
<plugin>
<groupId>com.github.surpsg</groupId>
<artifactId>diff-coverage-maven-plugin</artifactId>
<configuration>
<diffSource>
<file>diffFile.patch</file>
</diffSource>
<dataFileIncludes>**/custom-jacoco-name.exec</dataFileIncludes>
<excludes>
<exclude>**/exclude/**/ExcludeMe.class</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>diffCoverage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Index: src/it/multi-module-reports-generation-check/moduleB/src/main/java/com/test/moduleB/ClassModuleB.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/it/multi-module-reports-generation-check/moduleB/src/main/java/com/test/moduleB/ClassModuleB.java b/src/it/multi-module-reports-generation-check/moduleB/src/main/java/com/test/moduleB/ClassModuleB.java
new file mode 100644
--- /dev/null (date 1628714536415)
+++ b/src/it/multi-module-reports-generation-check/moduleB/src/main/java/com/test/moduleB/ClassModuleB.java (date 1628714536415)
@@ -0,0 +1,12 @@
+package com.test.moduleB;
+
+public class ClassModuleB {
+ public void sayHello(boolean a) {
+ if (a) {
+ System.out.println("if");
+ } else {
+ System.out.println("else");
+ }
+ System.out.println("return");
+ }
+}
Index: src/it/multi-module-reports-generation-check/moduleA/src/main/java/com/test/moduleA/ClassModuleA.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/it/multi-module-reports-generation-check/moduleA/src/main/java/com/test/moduleA/ClassModuleA.java b/src/it/multi-module-reports-generation-check/moduleA/src/main/java/com/test/moduleA/ClassModuleA.java
new file mode 100644
--- /dev/null (date 1628714375075)
+++ b/src/it/multi-module-reports-generation-check/moduleA/src/main/java/com/test/moduleA/ClassModuleA.java (date 1628714375075)
@@ -0,0 +1,12 @@
+package com.test.moduleA;
+
+public class ClassModuleA {
+ public void sayHello(boolean a) {
+ if (a) {
+ System.out.println("if");
+ } else {
+ System.out.println("else");
+ }
+ System.out.println("return");
+ }
+}
24 changes: 24 additions & 0 deletions src/it/multi-module-reports-generation-check/moduleB/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,28 @@
<artifactId>it-check-passes</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>
<build>
<plugins>
<plugin>
<groupId>com.github.surpsg</groupId>
<artifactId>diff-coverage-maven-plugin</artifactId>
<configuration>
<diffSource>
<file>diffFile.patch</file>
</diffSource>
<dataFileIncludes>**/custom-jacoco-name.exec</dataFileIncludes>
<excludes>
<exclude>**/exclude/**/ExcludeMe.class</exclude>
</excludes>
</configuration>
<executions>
<execution>
<goals>
<goal>diffCoverage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
1 change: 0 additions & 1 deletion src/it/multi-module-reports-generation-check/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<modules>
<module>moduleA</module>
<module>moduleB</module>
<module>report</module>
</modules>

<build>
Expand Down
54 changes: 0 additions & 54 deletions src/it/multi-module-reports-generation-check/report/pom.xml

This file was deleted.

Loading