Closed davidburstrom closed 9 months ago
I've confirmed that such a fix is sufficient:
diff --git a/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy b/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy
index 311b4ad..9108fc7 100644
--- a/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy
+++ b/src/main/groovy/info/solidsoft/gradle/pitest/PitestTask.groovy
@@ -249,10 +249,14 @@ class PitestTask extends JavaExec {
@Optional
List<String> overriddenTargetTests //should be Set<String> or SetProperty but it's not supported in Gradle as of 5.6.1
+ @Internal
+ File rootDir
+
PitestTask() {
getMainClass().set("org.pitest.mutationtest.commandline.MutationCoverageReport")
ObjectFactory of = project.objects
+ rootDir = project.rootDir
testPlugin = of.property(String)
reportDir = of.directoryProperty()
@@ -305,19 +309,19 @@ class PitestTask extends JavaExec {
@Input
String getAdditionalClasspathFilePath() {
- return additionalClasspathFile.asFile.get().relativePath(project.rootProject.rootDir)
+ return additionalClasspathFile.asFile.get().relativePath(rootDir)
}
@Input
@Optional
String getHistoryInputLocationPath() {
//?. operator doesn't work with Gradle Providers
- return historyInputLocation.isPresent() ? historyInputLocation.asFile.get().relativePath(project.rootProject.rootDir) : null
+ return historyInputLocation.isPresent() ? historyInputLocation.asFile.get().relativePath(rootDir) : null
}
@Input
String getDefaultFileForHistoryDataPath() {
- return defaultFileForHistoryData.asFile.get().relativePath(project.rootProject.rootDir)
+ return defaultFileForHistoryData.asFile.get().relativePath(rootDir)
}
@Input
Any progress here?
@davidburstrom if that fixes it, you should make it into a PR. Wouldn't be your first to add CC compatibility here. :-)
This should be close now with #345 being merged, shouldn't it? :-)
This should be close now with #345 being merged, shouldn't it? :-)
Yes, but it's just merged into devel and I plan to close it once merged into master and release. Hopefully "soon"...
I took the plugin for a spin today and hit this issue. It would be much appreciated if this was released. 🙏
Implemented in 1.15.0. Sorry for delay with releasing...
Using Gradle 8.1-rc-3 with configuration cache turned on, it finds the following issues. It looks like it should be simple enough to simply store
project.rootProject.rootDir
in the task constructor and use it later.and