https://github.com/codecov/example-kotlin-flat
Kotlin codecov example with standard file structure
https://github.com/codecov/example-kotlin-flat
Last synced: 7 months ago
JSON representation
Kotlin codecov example with standard file structure
- Host: GitHub
- URL: https://github.com/codecov/example-kotlin-flat
- Owner: codecov
- License: mit
- Created: 2020-08-25T16:16:12.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-01-23T17:15:42.000Z (almost 2 years ago)
- Last Synced: 2025-06-22T01:02:25.916Z (7 months ago)
- Language: Kotlin
- Size: 65.4 KB
- Stars: 2
- Watchers: 9
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# [Codecov](https://codecov.io) Kotlin Example with standard file structure
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-kotlin-flat?ref=badge_shield)
## Guide
**Using maven?** See [maven kotlin example](https://github.com/codecov/example-kotlin)
### Travis Setup
Add to your `.travis.yml` file.
```yml
language: java
after_success:
- bash <(curl -s https://codecov.io/bash)
```
### Produce Coverage Reports
#### Add Jacoco plugin
```xml
plugins {
...
jacoco
}
...
tasks.withType {
reports {
xml.isEnabled = true
csv.isEnabled = false
html.isEnabled = false
}
}
```
## Caveats
### Fixes for the report file paths
The standard file structure for kotlin omits the common prefix for packages, for example: `org.jacoco.examples.gradle`. Jacoco will render its reports with the complete import path, which can throw off codecov when it start looking for the files. To fix the issues, create a `codecov.yml` and add this content in it.
```yaml
fixes:
- "src/main/org/jacoco/examples/gradle/kotlin/::src/main/kotlin/"
- "src/test/org/jacoco/examples/gradle/kotlin/::src/test/kotlin/"
```
Replacing `org/jacoco/examples/gradle` with your own package prefix.
### Private Repo
Repository tokens are required for (a) all private repos, (b) public repos not using Travis-CI, CircleCI or AppVeyor. Find your repository token at Codecov and provide via appending `-t ` to you where you upload reports.
## Links
- [Community Boards](https://community.codecov.io)
- [Support](https://codecov.io/support)
- [Documentation](https://docs.codecov.io)
## License
[](https://app.fossa.com/projects/git%2Bgithub.com%2Fcodecov%2Fexample-kotlin-flat?ref=badge_large)