Hyewon Seok
Hyewon Seok

Reputation: 21

Is there a way to enable and disable gradle-jacoco freely?

I applied jacoco plugin via init.gradle.

What I want to enable is as follows:

  1. test without jacoco
  2. test with jacoco
initscript {
    repositories {
        mavenCentral()
    }
}

allprojects {
    apply plugin: 'java'
    apply plugin: 'jacoco'

    jacoco {
        toolVersion = '0.8.11'
    }

    test {
        jacoco {
            destinationFile = file("$buildDir/jacoco/jacoco.exec")
        }
    }
}

This is my init.gradle. I need just jacoco.exec as the output of jacoco.

I also tried registering new task, but it seems that there is no way to test without jacoco.

Upvotes: 0

Views: 12

Answers (0)

Related Questions