@@ -4,13 +4,12 @@ gradle-scoverage
4
4
================
5
5
A plugin to enable the use of Scoverage in a gradle Scala project.
6
6
7
- Getting started
8
- ---------------
7
+ Usage
8
+ -----
9
9
10
- http://plugins.gradle.org/plugin/org.scoverage
10
+ You can find instructions on how to apply the plugin at: http://plugins.gradle.org/plugin/org.scoverage
11
11
12
- Available tasks
13
- ---------------
12
+ ### Available tasks
14
13
15
14
1 . ` reportScoverage ` : Produces XML and HTML reports for analysing test code coverage.
16
15
@@ -29,8 +28,7 @@ Available tasks
29
28
` gradle checkScoverage ` will automatically invoke ` reportScoverage ` but it won't generate aggregated reports.
30
29
In order to check coverage of aggregated reports one should use ` gradle checkScoverage aggregateScoverage ` .
31
30
32
- Configuration
33
- -------------
31
+ ### Configuration
34
32
35
33
The plugin exposes multiple options that can be configured by setting them in an ` scoverage ` block within the project's
36
34
build script. These options are as follows:
@@ -58,13 +56,58 @@ required for the validation to pass (otherwise `checkScoverage` will fail the bu
58
56
` checkScoverage ` task. For more information on the different types, please refer to the documentation of the scalac
59
57
plugin (https://github.com/scoverage/scalac-scoverage-plugin ).
60
58
61
- Run without normal compilation
62
- ------------------------------
59
+ ### Run without normal compilation
63
60
64
61
By default, running any of the plugin tasks will compile the code both using "normal" compilation (` compileScala ` )
65
62
and using the scoverage scalac plugin (` compileScoverageScala ` ).
66
63
67
64
In cases where you only wish to generate reports / validate coverage, but are not interested in publishing the code,
68
65
it is possible to only compile the code with the scoverage scalac plugin, thus reducing build times significantly.
69
66
In order to do so, simply add the arguments ` -x compileScala ` to the gradle execution.
70
- For example: ` gradle reportScoverage -x compileScala ` .
67
+ For example: ` gradle reportScoverage -x compileScala ` .
68
+
69
+ Migration to 3.x
70
+ ----------------
71
+
72
+ * No more ` testScoverage ` task; instead, ` test ` will run coverage whenever the build is invoked with any of the scoverage tasks.
73
+
74
+ * No more need to declare scalac dependencies:
75
+ ``` groovy
76
+ // can safely delete this from build scripts
77
+ dependencies {
78
+ scoverage group: 'org.scoverage', name: 'scalac-scoverage-plugin_2.12', version: '1.3.1'
79
+ scoverage group: 'org.scoverage', name: 'scalac-scoverage-runtime_2.12', version: '1.3.1'
80
+ }
81
+ ```
82
+
83
+ * All configurations are configured in ` scoverage ` block. For instance:
84
+ ``` groovy
85
+ // do this
86
+ scoverage {
87
+ minimumRate = 0.5
88
+ }
89
+
90
+ // instead of this
91
+ checkScoverage {
92
+ minimumRate = 0.5
93
+ }
94
+ ```
95
+
96
+ * No more need to declare aggregation task:
97
+ ``` groovy
98
+ // can safely delete this from build scripts
99
+ task aggregateScoverage(type: org.scoverage.ScoverageAggregate)
100
+ checkScoverage {
101
+ reportDir = file("$buildDir/scoverage-aggregate")
102
+ }
103
+ ```
104
+
105
+ Release history
106
+ ---------------
107
+
108
+ ##### (not released yet) - 3.0.0
109
+
110
+ * Auto resolution of scalac plugin dependencies.
111
+ * Aggregation task declared by default.
112
+ * Deletion of non-instrumented classes, allowing for better integration with other coverage tools such as cobertura.
113
+ * Ability to execute coverage without "normal" compilation, thus reducing build times.
0 commit comments