Giter Club home page Giter Club logo

gradle-plugins's Introduction

Gradle plugins

This is a collection of handy Gradle plugins I end up using over and over.

integration-test

Adds integration testing to Gradle projects, supporting java, groovy and scala. It's completely dynamic, so it'll only add source directories for the source plugins you have (e.g. java, resources and groovy but not scala).

How it works

  • It'll automatically pick directories under src/integration-test/ that match java, resources, groovy and scala, depending on whether you have any (or all) of those plugins enabled.

How to use

apply from: 'https://raw.github.com/brunodecarvalho/gradle-plugins/master/integration-test.gradle'

To add to all subprojects of a multi-project build:

subprojects {
  apply from: 'https://raw.github.com/brunodecarvalho/gradle-plugins/master/integration-test.gradle'
}

ProTip™

If you're building projects with IntelliJ idea, you can automatically add the integration test sources by configuring the module model's test sources:

idea {
  // ...
  module {
    testSourceDirs += file('src/integration-test/java')
  }
}

Or, if you're using a multi-project build:

// On the root project's build.gradle
subprojects {
  // ...
  idea {
    module {
      testSourceDirs += file('src/integration-test/java')
      testSourceDirs += file('src/integration-test/groovy')
    }
  }
}

colored-test-output

A picture worth a thousand words:

colored test output sample

How to use

apply from: 'https://raw.github.com/brunodecarvalho/gradle-plugins/master/colored-test-output.gradle'

jacoco-multiproject-aggregator

Adds coverage reports for multi-project Gradle projects.

How it works

  • Root project has no code;
  • Coverage tracking is only done for submodules;
  • A single coverage report is generated which aggregates all coverage data from subprojects.

How to use

Apply on the root build.gradle project:

allprojects {
  apply from: 'https://raw.github.com/brunodecarvalho/gradle-plugins/master/jacoco-multiproject-aggregator.gradle'
}

The plugin must be applied to all subprojects. Here's what happens:

  • If the project is a subproject, it introduces a pre-test hook to run JaCoCo agent and track coverage;
  • If the project is the root project, a new task, coverageReport, is created.

The coverageReport task depends on test task so from a clean project, running gradle coverageReport will test the code and generate a coverage report.

gradle-plugins's People

Contributors

biasedbit avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.