Skip to content

Commit

Permalink
Defer gradle tasks creation with new gradle API
Browse files Browse the repository at this point in the history
  • Loading branch information
shobhitagarwal1612 committed Mar 27, 2019
1 parent 30a77a2 commit a9ebbe0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion config/jacoco.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}

task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
tasks.register("jacocoTestReport", JacocoReport) {
dependsOn 'testDebugUnitTest'
description = 'Generate JaCoCo coverage reports'

doFirst {
Expand Down
9 changes: 5 additions & 4 deletions config/quality.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.github.spotbugs.SpotBugsTask

buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
Expand All @@ -16,7 +18,7 @@ apply plugin: 'checkstyle'

checkstyle.toolVersion = '7.6.1'

task checkstyle(type: Checkstyle) {
tasks.register("checkstyle", Checkstyle) {
configFile file("$configDir/checkstyle.xml")

ignoreFailures false // Fail early
Expand All @@ -34,8 +36,7 @@ apply plugin: 'com.github.spotbugs'

spotbugs.toolVersion = '3.1.3'

task("spotbugs", type: com.github.spotbugs.SpotBugsTask, dependsOn: "assembleDebug") {

tasks.register("spotbugs", SpotBugsTask) {
ignoreFailures false // Fail early
effort = 'max' // Search better

Expand Down Expand Up @@ -80,7 +81,7 @@ pmd {
toolVersion = '6.4.0'
}

task pmd(type: Pmd) {
tasks.register("pmd", Pmd) {
ignoreFailures = false // Fail early
ruleSetFiles = files("$configDir/pmd-ruleset.xml")
ruleSets = []
Expand Down

0 comments on commit a9ebbe0

Please sign in to comment.