Closed remal closed 4 years ago
It's a know issue - #62. I plan to change it in 1.5.0, but it would not be backward compatible.
@szpak I don't know why but recently I could use a workaround:
configurations.maybeCreate("pitest")
dependencies {
pitest "org.pitest:pitest-command-line"
pitest "org.pitest:pitest-junit5-plugin"
}
tasks.pitest.configure {
launchClasspath = project.configurations.pitest
}
Now I'm getting this error:
Caused by: groovy.lang.GroovyRuntimeException: Cannot set the value of read-only property 'launchClasspath' for task ':pitest' of type info.solidsoft.gradle.pitest.PitestTask.
I'd like to add JUnit5 plugin as a dependency, as later it can be handled by smth like Dependabot.
Please try to use:
launchClasspath.set(project.configurations.pitest)
It was migrated to the new lazy API.
Gradle should allow to use pitest { lanchClasspath = ... }
, but it seems that in the configuration block it doesn't work.
Looks like launchClasspath
doesn't use Lazy API. So only with W/A works for me:
launchClasspath.setFrom(project.configurations.pitest)
But it's just a workaround. Please use configurations only from project where plugin is used and tasks is executed.
I missed that you was using the task property directly. ConfigurableFileCollection
is a lazy structure, but it slightly different API (it is much older). Guys from Gradle recommended it as a replacement for Set
Let's move discussion to #62.
Currently pitest Gradle plugin relies on configuration
rootProject.buildscript
.It would be much better to rely on
pitest
configuration in each own project separately. BTW al lot of Gradle plugins do exactly this.Please remove this change, as Gradle logs this warning message: