Skip to content

Commit d6f1c81

Browse files
committed
Add docs for coverage services
1 parent a752950 commit d6f1c81

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![SBT 1.0 version](https://img.shields.io/badge/sbt_1.0-3.0.3-blue.svg)](https://bintray.com/stringbean/sbt-plugins/sbt-jacoco)
77

88
This is an [sbt](http://scala-sbt.org/) plugin for code coverage analysis via [JaCoCo](http://www.eclemma.org/jacoco/).
9+
Supports uploading results to [Coveralls](https://coveralls.io) and [Codecov](https://codecov.io).
910

1011
Install the plugin by adding the following to `project/plugins.sbt`:
1112

src/paradox/coverage-services.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Coverage Services
2+
3+
Examples of uploading to [Coveralls](https://coveralls.io/) and [Codecov](https://codecov.io/gh) can be found in the
4+
example project: [stringbean/sbt-jacoco-example](https://github.com/stringbean/sbt-jacoco-example)
5+
6+
## Coveralls
7+
8+
Enable the Coveralls plugin:
9+
10+
```scala
11+
enablePlugins(JacocoCoverallsPlugin)
12+
```
13+
14+
Then run `sbt jacocoCoveralls` to upload the results to Coveralls:
15+
16+
```
17+
[info] Upload complete
18+
```
19+
20+
<!-- TODO extra config -->
21+
22+
## Codecov
23+
24+
The Codecov uploader script will upload coverage automatically if the XML formatter is enabled. For example:
25+
26+
```scala
27+
jacocoReportSettings := JacocoReportSettings(
28+
"Jacoco Coverage Report",
29+
None,
30+
JacocoThresholds(),
31+
Seq(JacocoReportFormats.ScalaHTML, JacocoReportFormats.XML), // note XML formatter
32+
"utf-8")
33+
```
34+
35+
With this enabled run the Codecov script:
36+
37+
```shell
38+
bash <(curl -s https://codecov.io/bash)
39+
```

src/paradox/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Key features of _sbt-jacoco_ include:
1414
* [Getting Started](getting-started.md)
1515
* [Integration Tests](integration-tests.md)
1616
* [Multi-Project Builds](multi-project.md)
17+
* [Coverage Services](coverage-services.md)
1718
* [Settings Reference](settings.md)
1819
* [Contributors](contributors.md)
1920

0 commit comments

Comments
 (0)