Skip to content

JEsperancinhaOrg/omni-reporter-gradle-plugin

Repository files navigation

omni-reporter-gradle-plugin

Generic badge

GitHub release Maven Central Sonatype Nexus

javadoc

GitHub License

Snyk Score

omni-reporter-gradle-plugin

Codacy Badge codebeat badge BCH compliance

Coverage Status Codacy Badge codecov

GitHub language count GitHub top language GitHub top language

Introduction

This plugin allows to publish reports from different formats to different APIs. As an example you can already send reports from CoveragePy, LCov, Jacoco and OpenClover to frameworks like Coveralls, Codecov and Codacy.

This plugin is a spin-off from the development of it's maven counterpart: Generic badge. Both the maven plugin and this one are developed hand in hand. However, their versions may deviate a bit:

Maven Plugin Gradle Plugin
Maven Central Maven Central
Sonatype Nexus Sonatype Nexus

Please check the Docs for further information on how to configure the plugin. The configurations are very much alike. The main difference is that where in Maven you work with XML format, with gradle you work with JSON like these examples:

1. Gradle Groovy

omniConfig {
    extraSourceFolders = [new File("$rootDir/international-airports-gui")]
    extraReportFolders = [new File("$rootDir/international-airports-gui/coverage")]
}

2. Gradle Kotlin

configure<OmniReporterPluginExtension> {
    extraSourceFolders = listOf(File("$rootDir/international-airports-gui"))
    extraReportFolders = listOf(File("$rootDir/international-airports-gui/coverage"))
}

Example projects

  1. Generic badge
  2. Generic badge
  3. Generic badge

Release notes

Please find all the release notes on this separate document ReleaseNotes.md.

Compatibility notes

Gradle Minimal Support version 7.3.3.

This plugin is being tested for versions >= Gradle 7.3.3. For older versions, I cannot guarantee compatibility. During the migration of one of my projects ( i.e. Generic badge), I noticed that I was getting a Kotlin related error. The first thought was just to add one of the Kotlin SDK's as a dependency. However, after thorough search, I also noticed that my Gradle Wrapper was version 5.2.1. Just by doing an update, it started working as expected. This is not to say that anything in between won't work. I'm just not promising any compatibility with older versions than the stated one.

Making a release

gradle clean build test
./gradlew publishMavenPublicationToOSSRHRepository

The rest manually in Nexus Sonatype.

This file is mandatory before a release:

gradle.properties:

ossrhUsername=<ossrhUsername>
ossrhPassword=<ossrhPassword>
signing.keyId=<signing.keyId>
signing.password=<signing.password>
signing.secretKeyRingFile=/Users/<user>/.gnupg/secring.gpg

Generate the signing fields(if not already available. check with gpg -K first!):

gpg --full-generate-key
gpg -K
gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg
gpg --keyserver keyserver.ubuntu.com --send-keys <KEY>
  • gpg --full-generate-key - Key generation
  • gpg -K - Lists keys. The KeyId is the last 8 Digits of the GPG key
  • gpg --keyring secring.gpg --export-secret-keys > ~/.gnupg/secring.gpg - Exports the keys to secring.gpg
  • gpg --keyserver keyserver.ubuntu.com --send-keys <KEY> - Exports the key so that Sonatype can verify the release

Coverage report Graphs

References

About me

GitHub followers