Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: scoverage/gradle-scoverage
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7.0.0
Choose a base ref
...
head repository: scoverage/gradle-scoverage
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Aug 28, 2021

  1. Copy the full SHA
    2cc7085 View commit details
  2. Add a step to the CI build that fails on warnings in the functional t…

    …ests (doesn't fail the build)
    eyalroth committed Aug 28, 2021
    Copy the full SHA
    d7da6b1 View commit details
  3. #163 Fix deprecation warning from Gradle 7.1.1 about undeclared depen…

    …dency between report task and test tasks outputs
    eyalroth committed Aug 28, 2021
    Copy the full SHA
    73bd170 View commit details

Commits on Sep 4, 2021

  1. Copy the full SHA
    c637d55 View commit details
  2. Copy the full SHA
    367b801 View commit details

Commits on Sep 8, 2021

  1. Merge pull request #169 from eyalroth/fix-deprecation-warnings

    Fix remaining deprecation warnings
    maiflai authored Sep 8, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    eec9a26 View commit details

Commits on Nov 17, 2021

  1. Copy the full SHA
    7dbbcf3 View commit details

Commits on Jan 12, 2022

  1. Update src/main/groovy/org/scoverage/ScoverageExtension.groovy

    Co-authored-by: Gabriel Jones <18059585+gabrieljones@users.noreply.github.com>
    xkrogen and gabrieljones authored Jan 12, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f719f21 View commit details

Commits on Aug 21, 2022

  1. Merge pull request #175 from xkrogen/xkrogen-scoverage-1.4.10

    Bump scoverage version from 1.4.8 to 1.4.11 to fix Scala 2.12.15 compatibility
    maiflai authored Aug 21, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    278cf7d View commit details

Commits on Aug 28, 2022

  1. bump publish plugin

    maiflai committed Aug 28, 2022
    Copy the full SHA
    7a8e608 View commit details

Commits on Aug 29, 2022

  1. Copy the full SHA
    3021528 View commit details

Commits on Nov 2, 2022

  1. Copy the full SHA
    206a784 View commit details

Commits on Nov 16, 2022

  1. Scala 3 support; Scoverage v2.0.7

    Lookup Scala version at the right time to avoid forcing early dependency resolution
    msigmond committed Nov 16, 2022
    Copy the full SHA
    7ab41c7 View commit details

Commits on Nov 20, 2022

  1. Scala 3 support; Scoverage v2.0.7

    Fix ScoverageFunctionalTest to use scalaVersionBuild=17 (2.12.17)
    msigmond committed Nov 20, 2022
    Copy the full SHA
    4c2e1bf View commit details

Commits on Nov 24, 2022

  1. Scala 3 support; Scoverage v2.0.7

    Unit test for Scala 3 - picks up wrong Scala 2 compiler - push to ask for help
    msigmond committed Nov 24, 2022
    Copy the full SHA
    07bbcab View commit details

Commits on May 15, 2023

  1. Copy the full SHA
    02ca776 View commit details
  2. fix scala 3.2 test

    maiflai committed May 15, 2023
    Copy the full SHA
    1641c84 View commit details
  3. Copy the full SHA
    be1bf55 View commit details
  4. Copy the full SHA
    f99718a View commit details

Commits on May 17, 2023

  1. Copy the full SHA
    17a18af View commit details
  2. upgrade to gradle 8.1.1

    maiflai committed May 17, 2023
    Copy the full SHA
    32d2564 View commit details
  3. Merge pull request #192 from scoverage/scoverage2

    Scoverage2
    maiflai authored May 17, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    6849ddf View commit details

Commits on May 20, 2023

  1. Copy the full SHA
    1abb277 View commit details
  2. Merge pull request #195 from scoverage/fix_194

    Use File.pathSeparator to support building on Windows (https://github…
    maiflai authored May 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    0793a46 View commit details
  3. Update README.md

    maiflai authored May 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    9ed6e8b View commit details
  4. Update README.md

    maiflai authored May 20, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    84c9730 View commit details

Commits on May 21, 2023

  1. Copy the full SHA
    6bd060c View commit details
  2. Copy the full SHA
    3e386b8 View commit details
  3. Merge pull request #196 from rafalmag/master

    (#194) Fix numbers decimal separator
    maiflai authored May 21, 2023

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    bba6532 View commit details

Commits on Jun 24, 2023

  1. Copy the full SHA
    f8ea2e0 View commit details

Commits on Jun 17, 2024

  1. upgrade to gradle 8.8

    msigmond committed Jun 17, 2024
    Copy the full SHA
    e508620 View commit details
  2. upgrades - scoverage version to 2.1.1; default scala version to 2.13.…

    …14; Scala 3 cross version test to 3.4.2
    msigmond committed Jun 17, 2024
    Copy the full SHA
    b276e62 View commit details

Commits on Jun 22, 2024

  1. Copy the full SHA
    43732c1 View commit details

Commits on Jun 23, 2024

  1. Add support for -coverage-exclude-classlikes and -coverage-exclude-fi…

    …les for Scala 3 (only ScalaSingleModuleTest goes with new scalatest version)
    msigmond committed Jun 23, 2024
    Copy the full SHA
    250b840 View commit details
  2. Add support for -coverage-exclude-classlikes and -coverage-exclude-fi…

    …les for Scala 3 (README.md updated)
    msigmond committed Jun 23, 2024
    Copy the full SHA
    e910bce View commit details

Commits on Jun 24, 2024

  1. upgrade to gradle 8.8 (fix deprecated features)

    msigmond committed Jun 24, 2024
    Copy the full SHA
    04b360f View commit details
  2. Merge pull request #205 from msigmond/master

    Add support for excludedFiles and excludedPackages for Scala 3
    maiflai authored Jun 24, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2364c64 View commit details

Commits on Jun 25, 2024

  1. fix publishing issues

    maiflai committed Jun 25, 2024
    Copy the full SHA
    b238301 View commit details
  2. remove unused code

    maiflai committed Jun 25, 2024
    Copy the full SHA
    ffea9fd View commit details
  3. Copy the full SHA
    007334f View commit details
  4. enable skipped test

    maiflai committed Jun 25, 2024
    Copy the full SHA
    46afb37 View commit details
  5. Merge pull request #206 from scoverage/tidyup

    Tidyup
    maiflai authored Jun 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    9e6c5b3 View commit details

Commits on Jun 30, 2024

  1. A hint for Kotlin DSL users

    msigmond committed Jun 30, 2024
    Copy the full SHA
    7efebd8 View commit details
  2. Merge pull request #207 from msigmond/master

    A hint for Kotlin DSL users
    maiflai authored Jun 30, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ebce78f View commit details

Commits on Dec 16, 2024

  1. upgrade to gradle 8.11.1

    maiflai committed Dec 16, 2024
    Copy the full SHA
    ffde760 View commit details
Showing with 756 additions and 455 deletions.
  1. +12 −1 .github/workflows/gradle.yml
  2. +21 −14 README.md
  3. +19 −21 build.gradle
  4. BIN gradle/wrapper/gradle-wrapper.jar
  5. +2 −1 gradle/wrapper/gradle-wrapper.properties
  6. +155 −109 gradlew
  7. +8 −19 gradlew.bat
  8. +6 −0 src/crossScalaVersionTest/java/org/scoverage/Scala32Test.java
  9. +2 −2 src/crossScalaVersionTest/java/org/scoverage/ScalaCrossVersionAggregationTest.java
  10. +2 −2 src/crossScalaVersionTest/java/org/scoverage/ScalaVersionTest.java
  11. +1 −1 src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_12/build.gradle
  12. +1 −1 src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/2_13/build.gradle
  13. +5 −0 src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/3_2/build.gradle
  14. +14 −0 ...t/resources/projects/scala-multi-module-cross-version/3_2/src/main/scala/org/hello/World3_2.scala
  15. +13 −0 ...ources/projects/scala-multi-module-cross-version/3_2/src/test/scala/org/hello/World3_2Suite.scala
  16. +1 −1 src/crossScalaVersionTest/resources/projects/scala-multi-module-cross-version/settings.gradle
  17. +0 −2 src/functionalTest/java/org/scoverage/CompositeBuildTest.java
  18. +2 −2 src/functionalTest/java/org/scoverage/ScalaJavaAnnotationProcessorTest.java
  19. +4 −4 src/functionalTest/java/org/scoverage/ScalaJavaMultiModuleTest.java
  20. +11 −7 src/functionalTest/java/org/scoverage/ScalaMultiModuleTest.java
  21. +10 −7 src/functionalTest/java/org/scoverage/ScalaMultiModuleWithMultipleTestTasksTest.java
  22. +13 −4 src/functionalTest/java/org/scoverage/ScalaSingleModuleTest.java
  23. +57 −0 src/functionalTest/java/org/scoverage/ScalaSingleModuleTestScala3.java
  24. +2 −2 src/functionalTest/java/org/scoverage/ScalaSingleModuleWithDependencyManagerTest.java
  25. +5 −3 src/functionalTest/java/org/scoverage/ScalaSingleModuleWithMultipleTestTasksTest.java
  26. +33 −0 src/functionalTest/java/org/scoverage/ScalaVersionArguments.java
  27. +12 −12 src/functionalTest/java/org/scoverage/ScoverageFunctionalTest.java
  28. +1 −1 src/functionalTest/resources/projects/detect-scala-library/dependency-management/build.gradle
  29. +1 −1 src/functionalTest/resources/projects/scala-java-annotation-processor/build.gradle
  30. +26 −27 src/functionalTest/resources/projects/scala-multi-module-multiple-test-tasks/build.gradle
  31. +1 −1 src/functionalTest/resources/projects/scala-single-module-dependency-manager/build.gradle
  32. +28 −31 src/functionalTest/resources/projects/scala-single-module-multiple-test-tasks/build.gradle
  33. +13 −3 src/functionalTest/resources/projects/scala-single-module/build.gradle
  34. +3 −3 ...tionalTest/resources/projects/scala-single-module/src/test/scala/org/hello/TestNothingSuite.scala
  35. +3 −3 src/functionalTest/resources/projects/scala-single-module/src/test/scala/org/hello/WorldSuite.scala
  36. +7 −13 src/main/groovy/org/scoverage/CoverageChecker.groovy
  37. +31 −0 src/main/groovy/org/scoverage/ScalaVersion.groovy
  38. +13 −3 src/main/groovy/org/scoverage/ScoverageAggregate.groovy
  39. +1 −6 src/main/groovy/org/scoverage/ScoverageExtension.groovy
  40. +126 −114 src/main/groovy/org/scoverage/ScoveragePlugin.groovy
  41. +8 −5 src/main/groovy/org/scoverage/ScoverageReport.groovy
  42. +62 −12 src/main/groovy/org/scoverage/ScoverageWriter.java
  43. +21 −17 src/test/groovy/org/scoverage/CoverageCheckerTest.groovy
13 changes: 12 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -11,8 +11,19 @@ on:

jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- name: 'ignore warnings'
additional-check-args: ''
continue-on-error: false
- name: 'fail on warning'
additional-check-args: '--warning-mode=fail -PfailOnWarning'
continue-on-error: true

runs-on: ubuntu-latest
continue-on-error: ${{ matrix.continue-on-error }}

steps:
- uses: actions/checkout@v2
@@ -24,4 +35,4 @@ jobs:
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew --info --stacktrace check
run: ./gradlew --info --stacktrace check ${{ matrix.additional-check-args }}
35 changes: 21 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ You can find instructions on how to apply the plugin at http://plugins.gradle.or
The plugin exposes multiple options that can be configured by setting them in an `scoverage` block within the project's
build script. These options are as follows:

* `scoverageVersion = <String>` (default `"1.4.8`): The version of the scoverage scalac plugin. This (gradle) plugin
* `scoverageVersion = <String>` (default `"2.1.1`): The version of the scoverage scalac plugin. This (gradle) plugin
should be compatible with all 1+ versions.

* `scoverageScalaVersion = <String>` (default `detected`): The scala version of the scoverage scalac plugin. This
@@ -64,6 +64,10 @@ required for the validation to pass (otherwise `checkScoverage` will fail the bu
`checkScoverage` task. For more information on the different types, please refer to the documentation of the scalac
plugin (https://github.com/scoverage/scalac-scoverage-plugin).

* `excludedFiles = <files>` (default `not set`): Comma separated list of regexes for files to exclude from coverage.

* `excludedPackages = <packages, classes and modules>` (default `not set`): Comma separated list of regexes for packages, classes and modules to exclude from coverage.

#### Multiple check tasks

It is possible to configure multiple checks; for instance, one check for a statement rate and another for a branch rate:
@@ -103,26 +107,29 @@ scoverage {
coverageType = CoverageType.Statement
}
}
```

### Run without normal compilation

By default, running any of the plugin tasks will compile the code both using "normal" compilation (`compileScala`)
and using the scoverage scalac plugin (`compileScoverageScala`).

In cases where you only wish to generate reports / validate coverage, but are not interested in publishing the code,
it is possible to only compile the code with the scoverage scalac plugin, thus reducing build times significantly.
In order to do so, simply add the arguments `-PscoverageCompileOnly` to the gradle execution.
For example: `gradle reportScoverage -PscoverageCompileOnly`.
```

Note that this mode is incompatible with parallel builds in multi-module projects.
In case you use the Kotlin DSL, the following snippet can give you pointers for configuring Scoverage:
```kotlin
scoverage {
minimumRate.set(BigDecimal("0.80"))
excludedPackages.set(listOf<String>("com.example.scala.demo"))
}
```

### Compatibility with Consistent Versions Plugin

In order for the plugin to work alongside [Palantir's consistent versions plugin](https://github.com/palantir/gradle-consistent-versions),
the Scala version must be manually configured (via `scoverageScalaVersion`); otherwise, the plugin will attempt to
resolve the compilation classpath, which is prohibited by the versions plugin.

Migration to 8.x
----------------

* Requires scoverage 2.0
* Adds support for Scala 3
* Drops support for disabling normal compilation

Migration to 7.x
----------------

@@ -184,4 +191,4 @@ task aggregateScoverage(type: org.scoverage.ScoverageAggregate)
checkScoverage {
reportDir = file("$buildDir/scoverage-aggregate")
}
```
```
40 changes: 19 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'java-gradle-plugin'
id "com.gradle.plugin-publish" version "0.15.0"
id "com.gradle.plugin-publish" version "1.1.0"
id "org.jetbrains.gradle.plugin.idea-ext" version "1.0"
}

@@ -11,7 +11,7 @@ repositories {
group 'org.scoverage'
description = 'gradle-scoverage is a Gradle plugin for calculating code coverage using Scoverage'
if (project.version == 'unspecified') {
version = '7.0.0-SNAPSHOT'
version = '8.0.0-SNAPSHOT'
}
ext {
website = 'http://scoverage.org'
@@ -22,31 +22,32 @@ ext {
}

gradlePlugin {
website = project.ext.website
vcsUrl = project.ext.vcsUrl
description = project.description
plugins {
gradleScoverage {
id = 'org.scoverage'
implementationClass = 'org.scoverage.ScoveragePlugin'
displayName = 'Gradle Scoverage plugin'
description = 'gradle-scoverage is a Gradle plugin for calculating code coverage using Scoverage'
tags.set(['coverage', 'scala', 'scoverage'])
}
}
}

pluginBundle {
website = project.website
vcsUrl = ext.vcsUrl
description = project.description
tags = ['coverage', 'scala', 'scoverage']
}

apply plugin: 'maven-publish'
apply plugin: 'groovy'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
compileOnly "org.scoverage:scalac-scoverage-plugin_2.13:1.4.2"
compileOnly 'org.scoverage:scalac-scoverage-plugin_2.13.14:2.1.1'
compileOnly 'org.scoverage:scalac-scoverage-reporter_2.13:2.1.1'

implementation group: 'commons-io', name: 'commons-io', version: '2.6'

testImplementation 'junit:junit:4.12'
@@ -104,6 +105,8 @@ task functionalTest(type: Test) {
showStandardStreams = System.env.CI == 'true'
}

systemProperty 'failOnWarning', project.hasProperty('failOnWarning')

mustRunAfter crossScalaVersionTest
}
check.dependsOn functionalTest
@@ -114,12 +117,7 @@ gradlePlugin {

task groovydocJar(type: Jar, dependsOn: groovydoc) {
from "$buildDir/docs/groovydoc"
classifier 'groovydoc'
}

task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier 'sources'
archiveClassifier.set('groovydoc')
}

def propOrDefault(String property) {
@@ -177,7 +175,6 @@ publishing {
}
from components.java
artifact groovydocJar
artifact sourcesJar
}
}
}
@@ -187,6 +184,7 @@ if (project.properties.containsKey('signing.keyId')) {
signing {
sign publishing.publications.mavenJava
}
project.tasks.publishMavenJavaPublicationToMavenRepository.inputs.files(project.tasks.signMavenJavaPublication)
}

// see https://stackoverflow.com/questions/44679007
@@ -206,4 +204,4 @@ idea.project.settings {
taskTriggers {
beforeBuild fixIdeaPluginClasspath, pluginUnderTestMetadata
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
distributionSha256Sum=f397b287023acdba1e9f6fc5ea72d22dd63669d59ed4a289a29b1a76eee151c6
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading