Skip to content

Commit f102d09

Browse files
author
Steve Peak
authored
Update README.md
1 parent 9ac4cba commit f102d09

File tree

1 file changed

+12
-54
lines changed

1 file changed

+12
-54
lines changed

README.md

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,19 @@
1-
Codecov Java Example
2-
====================
1+
[Codecov][1] Gradle Example
2+
===========================
33

4-
| [https://codecov.io][1] | [@codecov][2] | [[email protected]][3] |
5-
| ----------------------- | ------------- | --------------------- |
4+
1. Add Jacoco Plugin to your `build.gradle`. [See here](https://github.com/codecov/example-gradle/blob/master/build.gradle#L5
5+
1. Set Jacoco to export xml. [See here](https://github.com/codecov/example-gradle/blob/master/build.gradle#L18-L23)
6+
1. Execute your tests as normal
7+
1. Call `if [ -e ./gradlew ]; then ./gradlew jacocoTestReport;else gradle jacocoTestReport;fi` to generate report. [See here](https://github.com/codecov/example-gradle/blob/65f88382659cf17c8693c3079941a12c8d004f03/circle.yml#L3)
8+
1. Call `bash <(curl -s https://codecov.io/bash)` to upload reports to Codecov. [See here](https://github.com/codecov/example-gradle/blob/65f88382659cf17c8693c3079941a12c8d004f03/circle.yml#L4)
9+
- Public project? Using TravisCI, CircleCI or AppVeyor? You're all set! No upload token required.
10+
- Otherwise please include your repository upload token. [See here](http://docs.codecov.io/v4.3.0/docs/about-the-codecov-bash-uploader#section-upload-token)
611

7-
This repository serves as an **example** on how to use [Codecov Global][4] for Java with a [Gradle][5] build script.
812

9-
## Usage
13+
## Frequently Asked Questions
1014

15+
####❔ Do you support Multi-module projects?
1116

12-
### Add Jacoco plugin
13-
Gradle ships with a [JaCoCo plugin][6]. Just add it to your `build.gradle`.
14-
```groovy
15-
apply plugin: 'jacoco'
16-
```
17-
18-
And enable the `jacoco` XML report.
19-
```groovy
20-
jacocoTestReport {
21-
reports {
22-
xml.enabled true
23-
}
24-
}
25-
```
26-
27-
# Circle CI
28-
29-
Add to your `circle.yml` file.
30-
```yml
31-
test:
32-
post:
33-
- if [ -e ./gradlew ]; then ./gradlew jacocoTestReport;else gradle jacocoTestReport;fi
34-
- bash <(curl -s https://codecov.io/bash)
35-
```
36-
37-
> Another option is our [Bash uploader][7]
38-
39-
## Private Repos
40-
41-
Add to your `.travis.yml` file.
42-
```yml
43-
test:
44-
post:
45-
- if [ -e ./gradlew ]; then ./gradlew jacocoTestReport;else gradle jacocoTestReport;fi
46-
- bash <(curl -s https://codecov.io/bash) -t uuid-repo-token
47-
```
48-
49-
View source and learn more about [Codecov Global Uploader][4]
50-
51-
## Multi-module projects (exmple with Travis CI)
5217
Update your parent (root) `build.gradle`:
5318
```groovy
5419
allprojects {
@@ -112,14 +77,7 @@ after_success:
11277
11378
No need to have anything else report-related in child modules
11479
115-
[Credits for multi-module][8]
80+
[Credits for multi-module](https://csiebler.github.io/blog/2014/02/09/multi-project-code-coverage-using-gradle-and-jacoco/)
11681
11782
11883
[1]: https://codecov.io/
119-
[2]: https://twitter.com/codecov
120-
[3]: mailto:[email protected]
121-
[4]: https://github.com/codecov/codecov-python
122-
[5]: http://gradle.org/
123-
[6]: https://docs.gradle.org/current/userguide/jacoco_plugin.html
124-
[7]: https://github.com/codecov/codecov-bash
125-
[8]: https://csiebler.github.io/blog/2014/02/09/multi-project-code-coverage-using-gradle-and-jacoco/

0 commit comments

Comments
 (0)