Skip to content

Commit 6849ddf

Browse files
authored
Merge pull request #192 from scoverage/scoverage2
Scoverage2
2 parents 3021528 + 32d2564 commit 6849ddf

File tree

23 files changed

+291
-204
lines changed

23 files changed

+291
-204
lines changed

README.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -105,24 +105,17 @@ scoverage {
105105
}
106106
```
107107

108-
### Run without normal compilation
109-
110-
By default, running any of the plugin tasks will compile the code both using "normal" compilation (`compileScala`)
111-
and using the scoverage scalac plugin (`compileScoverageScala`).
112-
113-
In cases where you only wish to generate reports / validate coverage, but are not interested in publishing the code,
114-
it is possible to only compile the code with the scoverage scalac plugin, thus reducing build times significantly.
115-
In order to do so, simply add the arguments `-PscoverageCompileOnly` to the gradle execution.
116-
For example: `gradle reportScoverage -PscoverageCompileOnly`.
117-
118-
Note that this mode is incompatible with parallel builds in multi-module projects.
119-
120108
### Compatibility with Consistent Versions Plugin
121109

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

114+
Migration to 8.x
115+
----------------
116+
117+
* Running without normal compilation is no longer supported.
118+
126119
Migration to 7.x
127120
----------------
128121

build.gradle

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java-gradle-plugin'
3-
id "com.gradle.plugin-publish" version "1.0.0"
3+
id "com.gradle.plugin-publish" version "1.1.0"
44
id "org.jetbrains.gradle.plugin.idea-ext" version "1.0"
55
}
66

@@ -11,7 +11,7 @@ repositories {
1111
group 'org.scoverage'
1212
description = 'gradle-scoverage is a Gradle plugin for calculating code coverage using Scoverage'
1313
if (project.version == 'unspecified') {
14-
version = '7.0.0-SNAPSHOT'
14+
version = '8.0.0-SNAPSHOT'
1515
}
1616
ext {
1717
website = 'http://scoverage.org'
@@ -22,22 +22,19 @@ ext {
2222
}
2323

2424
gradlePlugin {
25+
website = project.ext.website
26+
vcsUrl = project.ext.vcsUrl
27+
description = project.description
2528
plugins {
2629
gradleScoverage {
2730
id = 'org.scoverage'
2831
implementationClass = 'org.scoverage.ScoveragePlugin'
2932
displayName = 'Gradle Scoverage plugin'
33+
tags.set(['coverage', 'scala', 'scoverage'])
3034
}
3135
}
3236
}
3337

34-
pluginBundle {
35-
website = project.website
36-
vcsUrl = ext.vcsUrl
37-
description = project.description
38-
tags = ['coverage', 'scala', 'scoverage']
39-
}
40-
4138
apply plugin: 'maven-publish'
4239
apply plugin: 'groovy'
4340

@@ -46,7 +43,8 @@ targetCompatibility = '1.8'
4643

4744

4845
dependencies {
49-
compileOnly "org.scoverage:scalac-scoverage-plugin_2.13:1.4.2"
46+
compileOnly "org.scoverage:scalac-scoverage-plugin_2.13.8:2.0.7"
47+
compileOnly "org.scoverage:scalac-scoverage-reporter_2.13:2.0.7"
5048
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
5149

5250
testImplementation 'junit:junit:4.12'
@@ -116,7 +114,7 @@ gradlePlugin {
116114

117115
task groovydocJar(type: Jar, dependsOn: groovydoc) {
118116
from "$buildDir/docs/groovydoc"
119-
classifier 'groovydoc'
117+
archiveClassifier.set('groovydoc')
120118
}
121119

122120
def propOrDefault(String property) {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
4+
distributionSha256Sum=e111cb9948407e26351227dabce49822fb88c37ee72f1d1582a69c68af2e702f
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package org.scoverage;
2+
3+
public class Scala32Test extends ScalaVersionTest {
4+
5+
public Scala32Test() { super("3_2"); }
6+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dependencies {
2-
implementation group: 'org.scala-lang', name: 'scala-library', version: "2.12.8"
2+
implementation group: 'org.scala-lang', name: 'scala-library', version: "2.12.17"
33
testImplementation group: 'org.scalatest', name: "scalatest_2.12", version: scalatestVersion
44
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dependencies {
2-
implementation group: 'org.scala-lang', name: 'scala-library', version: "2.13.1"
2+
implementation group: 'org.scala-lang', name: 'scala-library', version: "2.13.10"
33
testImplementation group: 'org.scalatest', name: "scalatest_2.13", version: scalatestVersion
44
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
dependencies {
2+
implementation 'org.scala-lang:scala3-library_3:3.2.0'
3+
testImplementation 'org.scalatest:scalatest_3:3.2.14'
4+
testImplementation "org.scalatestplus:junit-4-13_3:3.2.14.0"
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.hello
2+
3+
class World3_2 {
4+
5+
// Scala 3 enum to force Scala 3 (Dotty) compiler
6+
enum Num(val value: String):
7+
case Three extends Num("3")
8+
case Two extends Num("2")
9+
10+
def foo(): String = {
11+
val s = Num.Three.value + Num.Two.value
12+
s
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package org.hello
2+
3+
import org.junit.runner.RunWith
4+
import org.scalatest.funsuite.AnyFunSuite
5+
import org.scalatestplus.junit.JUnitRunner
6+
7+
@RunWith(classOf[JUnitRunner])
8+
class World3_2Suite extends AnyFunSuite {
9+
10+
test("foo") {
11+
new World3_2().foo()
12+
}
13+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include '2_12', '2_13'
1+
include '2_12', '2_13', '3_2'

0 commit comments

Comments
 (0)