Skip to content

Commit 5104de6

Browse files
committed
Support file and package exclusions for Scala 3.3.4+
1 parent 61b6991 commit 5104de6

File tree

25 files changed

+320
-7
lines changed

25 files changed

+320
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ If you want to customize plugin's configuration parameters used by compilation s
328328
Read [SBT SCoverage Plugin documentation](https://github.com/scoverage/sbt-scoverage) for more information about
329329
[excludedPackages and excludedFiles](https://github.com/scoverage/sbt-scoverage?tab=readme-ov-file#exclude-classes-and-packages-and-files).
330330

331-
File and package exclusions are supported for Scala 2 and Scala 3 since version `3.4.2`.
331+
File and package exclusions are supported for Scala 2, Scala [`3.3.4`-`3.4.0`) and `3.4.2`+.
332332

333333
### Checking minimum test coverage level
334334

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
invoker.goals=clean verify site -e -ntp
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
7+
<parent>
8+
<groupId>it.scoverage-maven-plugin</groupId>
9+
<artifactId>integration_tests_parent</artifactId>
10+
<version>1.0-SNAPSHOT</version>
11+
<relativePath>../integration_tests_parent/pom.xml</relativePath>
12+
</parent>
13+
14+
<artifactId>test_exclusion</artifactId>
15+
<version>1.0-SNAPSHOT</version>
16+
<packaging>jar</packaging>
17+
<name>Test Scoverage exclusion</name>
18+
<description>Test Scoverage exclusion</description>
19+
20+
<properties>
21+
<scala.compat.version>3</scala.compat.version>
22+
<scala.version>3.3.3</scala.version>
23+
<scala.library.artifact.id>scala3-library_3</scala.library.artifact.id>
24+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
25+
</properties>
26+
27+
<build>
28+
<plugins>
29+
<plugin>
30+
<groupId>org.apache.maven.plugins</groupId>
31+
<artifactId>maven-compiler-plugin</artifactId>
32+
</plugin>
33+
<plugin>
34+
<groupId>net.alchim31.maven</groupId>
35+
<artifactId>scala-maven-plugin</artifactId>
36+
</plugin>
37+
<plugin>
38+
<groupId>org.scalatest</groupId>
39+
<artifactId>scalatest-maven-plugin</artifactId>
40+
</plugin>
41+
<plugin>
42+
<groupId>@project.groupId@</groupId>
43+
<artifactId>@project.artifactId@</artifactId>
44+
<configuration>
45+
<excludedPackages>.*package02.*;.*package05</excludedPackages>
46+
<excludedFiles>.*Package03HelloService.*;.*Package03ByeService</excludedFiles>
47+
</configuration>
48+
</plugin>
49+
</plugins>
50+
</build>
51+
</project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.package01
2+
3+
object Package01HelloService {
4+
5+
// gonna be included in coverage report
6+
def hello: String = "Hello from package01"
7+
8+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// gonna be excluded from coverage report by package exclusion
2+
package org.package02.nested02
3+
4+
object ImGonnaBeExcludedCauseImInPackage02Nested02 {
5+
6+
def hello: String = "Hello from package02.nested02"
7+
8+
}
9+
10+
object SameStoryBro {
11+
12+
def hello: String = "Hello from package02.nested02 again"
13+
14+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// gonna be excluded from coverage report by package exclusion
2+
package org.package02
3+
4+
object ImGonnaBeExcludedCauseImInPackage02 {
5+
6+
def hello: String = "Hello from package02"
7+
8+
}
9+
10+
object SameStoryBro {
11+
12+
def hello: String = "Hello from package02 again"
13+
14+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.package03
2+
3+
object Package03ByeService {
4+
5+
// gonna be excluded from coverage report by file exclusion
6+
def bye: String = "Bye from package03"
7+
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.package03
2+
3+
object Package03HelloService1 {
4+
5+
// gonna be excluded from coverage report by file exclusion
6+
def hello: String = "Hello from package03 service 1"
7+
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package org.package03
2+
3+
object Package03HelloService2 {
4+
5+
// gonna be excluded from coverage report by file exclusion
6+
def hello: String = "Hello from package03 service 2"
7+
8+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// gonna be excluded from coverage report by package exclusion
2+
package org.package05
3+
4+
object ImGonnaBeExcludedCauseImInPackage05 {
5+
6+
def hello: String = "Hello from package05"
7+
8+
}
9+
10+
object SameStoryBro {
11+
12+
def hello: String = "Hello from package05 again"
13+
14+
}

0 commit comments

Comments
 (0)