I'm trying to figure out how I can conditionally skip the Jacoco instrumentation and coverage analysis in a Gradle build. I don't want the coverage tasks to run in every execution of the build, I'd like to be able to control that using a command line property. I tried extracting the Jacoco code to its own Gradle file and using apply from: as in https://stackoverflow.com/questions/42501869/gradle-skip-jacoco-during-test, but this results in:
java.lang.ClassNotFoundException: org.jacoco.agent.rt.internal_1f1cc91.PreMain
Any insight on how to accomplish this?
Thanks,
Edward