All Projects → vanniktech → Gradle Android Junit Jacoco Plugin

vanniktech / Gradle Android Junit Jacoco Plugin

Licence: apache-2.0
Gradle plugin that generates JaCoCo reports from an Android Gradle Project

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Gradle Android Junit Jacoco Plugin

Android Junit5
Testing with JUnit 5 for Android.
Stars: ✭ 580 (+84.13%)
Mutual labels:  gradle-plugin, junit
scalatest-junit-runner
JUnit 5 runner for Scalatest
Stars: ✭ 30 (-90.48%)
Mutual labels:  gradle-plugin, junit
gradle-console-reporter
Gradle plugin to report various kinds of summaries to console.
Stars: ✭ 49 (-84.44%)
Mutual labels:  gradle-plugin, junit
Rspec junit formatter
RSpec results that your CI can read
Stars: ✭ 255 (-19.05%)
Mutual labels:  junit
Androidsvgdrawable Plugin
Gradle plugin that generates qualified, density specific PNG drawables from SVG files at build time for your Android projects.
Stars: ✭ 263 (-16.51%)
Mutual labels:  gradle-plugin
Clean Mvvm Archcomponents
👽 Android app consuming Star Wars API.Built with clean architecture ,MVVM pattern, Koin , Coroutines + Flows ,Architecture Components, Data Binding , Firebase , Unit/UI Tests ,Motion Layout
Stars: ✭ 285 (-9.52%)
Mutual labels:  junit
Jest Junit
A Jest reporter that creates compatible junit xml files
Stars: ✭ 307 (-2.54%)
Mutual labels:  junit
schema-registry-plugin
Gradle plugin to interact with Confluent Schema-Registry.
Stars: ✭ 60 (-80.95%)
Mutual labels:  gradle-plugin
Android Maven Publish
Modification of the standard Maven Publish plugin to be compatible with android-library projects (aar).
Stars: ✭ 297 (-5.71%)
Mutual labels:  gradle-plugin
Gradle Code Quality Tools Plugin
Gradle plugin that generates ErrorProne, Findbugs, Checkstyle, PMD, CPD, Lint, Detekt & Ktlint Tasks for every subproject.
Stars: ✭ 282 (-10.48%)
Mutual labels:  gradle-plugin
Gradle Unused Resources Remover Plugin
Gradle Plugin that removes unused resources in Android projects.
Stars: ✭ 282 (-10.48%)
Mutual labels:  gradle-plugin
Jqwik
Property-Based Testing on the JUnit Platform
Stars: ✭ 265 (-15.87%)
Mutual labels:  junit
Javapackager
📦 Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.
Stars: ✭ 285 (-9.52%)
Mutual labels:  gradle-plugin
Blog Tutorials
⭐️ Codebase for the tutorials on my blog about Java, Spring Boot, AWS, Kotlin and Testing
Stars: ✭ 257 (-18.41%)
Mutual labels:  junit
Gradle Apt Plugin
[OBSOLETE] Gradle plugin making it easier/safer to use Java annotation processors
Stars: ✭ 299 (-5.08%)
Mutual labels:  gradle-plugin
build-time-tracker
Gradle plugin that prints the time taken by the tasks in a build
Stars: ✭ 27 (-91.43%)
Mutual labels:  gradle-plugin
Fat Aar Plugin
[DEPRECATED]A gradle plugin that helps to output fat aar from android library
Stars: ✭ 297 (-5.71%)
Mutual labels:  gradle-plugin
Dependencycheck
OWASP dependency-check is a software composition analysis utility that detects publicly disclosed vulnerabilities in application dependencies.
Stars: ✭ 3,571 (+1033.65%)
Mutual labels:  gradle-plugin
Gradle Aws Plugin
Gradle plugin to manage Amazon Web Services
Stars: ✭ 269 (-14.6%)
Mutual labels:  gradle-plugin
Gradle Nexus Plugin
Gradle plugin for configuring and uploading artifacts to Sonatype Nexus
Stars: ✭ 284 (-9.84%)
Mutual labels:  gradle-plugin

gradle-android-junit-jacoco-plugin

Gradle plugin that generates Jacoco reports from a Gradle Project. Android Application, Android Library, Kotlin and Java Plugins are supported by this plugin. When this plugin is applied it goes over every subproject and creates the corresponding Jacoco tasks.

Android project

JVM Unit-Tests

  • Task jacocoTestReport<Flavor><BuildType>
    • Executes the test<Flavor><BuildType>UnitTest task before
    • Gets executed when the check task is executed
    • Generated Jacoco reports can be found under build/reports/jacoco/<Flavor>/<BuildType>.

Instrumented tests

  • Task combinedTestReport<Flavor><BuildType>
    • Executes the test<Flavor><BuildType>UnitTest and create<Flavor><BuildType>CoverageReports tasks before (JVM and instrumented tests)
    • Gets executed when the check task is executed
    • Generated Jacoco reports can be found under build/reports/jacocoCombined/<Flavor>/<BuildType>. Note that this task is only generated, if you set testCoverageEnabled = true for your build type, e.g.
android {
  buildTypes {
    debug {
      testCoverageEnabled true
    }
  }
}

Where <BuildType> is usually debug & release unless additional build types where specified. <Flavor> is optional and will be ignored if not specified.

For instance when having debug & release build types and no flavors the following tasks would be created: jacocoTestReportDebug and jacocoTestReportRelease.

When having debug & release build types and red & blue flavors the following tasks would be created: jacocoTestReportRedDebug, jacocoTestReportBlueDebug, jacocoTestReportRedRelease and jacocoTestReportBlueRelease.

Java project

  • Task jacocoTestReport
    • Executes the test task before
    • Gets executed when the check task is executed
    • Generated Jacoco reports can be found under build/reports/jacoco/.

In addition the plugin generates mergeJacocoReports & jacocoTestReportMerged tasks.

mergeJacocoReports will merge all of the jacoco reports together.

jacocoTestReportMerged will output an xml and html file for the merged report.

Works with the latest Gradle Android Tools version 3.4.0. This plugin is compiled using Java 7 hence you also need Java 7 in order to use it.

Set up

root/build.gradle

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath "com.vanniktech:gradle-android-junit-jacoco-plugin:0.16.0"
  }
}

apply plugin: "com.vanniktech.android.junit.jacoco"

Information: This plugin is also available on Gradle plugins

Snapshot

buildscript {
  repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
  }
  dependencies {
    classpath "com.vanniktech:gradle-android-junit-jacoco-plugin:0.17.0-SNAPSHOT"
  }
}

apply plugin: "com.vanniktech.android.junit.jacoco"

Configuration

Those are all available configurations - shown with default values and their types. More information can be found in the Java Documentation of the Extension.

junitJacoco {
  jacocoVersion = '0.8.2' // type String
  ignoreProjects = [] // type String array
  excludes // type String List
  includeNoLocationClasses = false // type boolean
  includeInstrumentationCoverageInMergedReport = false // type boolean
  xml.enabled = true
  csv.enabled = true
  html.enabled = true
}

License

Copyright (C) 2015 Vanniktech - Niklas Baudy

Licensed under the Apache License, Version 2.0

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].