Skip to content

Commit ca064c4

Browse files
committed
Merge branch 'devel'
2 parents a7668af + cec8a76 commit ca064c4

16 files changed

+83
-71
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# gradle-pitest-plugin changelog
22

3+
## 1.19.0-rc.2 - Unreleased
4+
5+
- pitestReportAggregate task is compatible with configuration cache in Gradle 9 - [#381](https://github.com/szpak/gradle-pitest-plugin/issues/381) - PR by [Luis Guillermo Gómez Galeano ](https://github.com/luisgomez29)
6+
- PIT 1.20.3 by default
7+
- Upgrade Gradle wrapper to 8.14.3
8+
9+
Thanks to all the contributors to this release: @luisgomez29.
10+
311
## 1.19.0-rc.1 - 2025-06-07
412

513
- Java 17 is minimal supported* version

build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ buildscript {
1616
}
1717
}
1818
dependencies {
19-
classpath 'pl.allegro.tech.build.axion-release:pl.allegro.tech.build.axion-release.gradle.plugin:1.18.18'
19+
classpath 'pl.allegro.tech.build.axion-release:pl.allegro.tech.build.axion-release.gradle.plugin:1.20.1'
2020
classpath 'io.github.gradle-nexus.publish-plugin:io.github.gradle-nexus.publish-plugin.gradle.plugin:2.0.0'
21-
classpath 'com.gradle.publish:plugin-publish-plugin:1.3.1'
22-
classpath 'com.github.ben-manes:gradle-versions-plugin:0.52.0'
21+
classpath 'com.gradle.publish:plugin-publish-plugin:2.0.0'
22+
classpath 'com.github.ben-manes:gradle-versions-plugin:0.53.0'
2323
}
2424
}
2525

2626
java {
2727
sourceCompatibility = 1.8
2828
}
2929

30-
ext.pitestAggregatorVersion = "1.19.5" //Must be equal to default PIT version in PitestPlugin
30+
ext.pitestAggregatorVersion = "1.20.3" //Must be equal to default PIT version in PitestPlugin
3131

3232
repositories {
3333
mavenCentral()
@@ -51,7 +51,7 @@ dependencies {
5151
exclude group: 'org.codehaus.groovy'
5252
}
5353
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
54-
testImplementation 'net.bytebuddy:byte-buddy:1.17.5' //for Spying in Spock
54+
testImplementation 'net.bytebuddy:byte-buddy:1.17.7' //for Spying in Spock
5555

5656
funcTestImplementation sourceSets.main.output //to make production plugin classes visible in functional tests (it's not in testCompile configuration)
5757
funcTestImplementation sourceSets.test.output
@@ -67,6 +67,7 @@ tasks.register("funcTest", Test) {
6767
classpath = sourceSets.funcTest.runtimeClasspath
6868
jvmArgs '-Xmx1g'
6969
}
70+
7071
funcTest.shouldRunAfter test
7172
check.shouldRunAfter funcTest
7273
check.dependsOn funcTestClasses //or more generically: tasks.withType(AbstractCompile)

gradle/cdeliveryboy-release.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ if (hasProperty('pluginPortal')) {
104104

105105
if (hasProperty('changelogSync')) {
106106

107-
task syncChangelog(type: Exec) {
107+
tasks.register('syncChangelog', Exec) {
108108
doFirst { logger.info("Synchronizing changelog with GitHub for version ${project.version}") }
109109
commandLine 'chandler', 'push', "release/${project.version}", '--tag-prefix=release/'
110110
}

gradle/report-version-consistency-check.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def validatePitestVersionProvider = tasks.register("validatePitestVersion") {
88
inputs.files(sourceSets.main.output)
99
inputs.file("build.gradle")
1010
inputs.file("gradle//report-version-consistency-check.gradle")
11-
outputs.files(file("$buildDir/dummyVersionValidationOutput.txt")) //just to not be always up-to-date
11+
outputs.files(layout.buildDirectory.file("dummyVersionValidationOutput.txt")) //just to not be always up-to-date
1212

1313
Action<Void> validationAction = {
1414
logger.info("Configured 'pitestAggregatorVersion': {}", pitestAggregatorVersion)

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=443c9c8ee2ac1ee0e11881a40f2376d79c66386264a44b24a9f8ca67e633375f
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-all.zip
3+
distributionSha256Sum=ed1a8d686605fd7c23bdf62c7fc7add1c5b23b2bbc3721e661934ef4a4911d7c
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

src/funcTest/groovy/info/solidsoft/gradle/pitest/functional/AbstractPitestFunctionalSpec.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ abstract class AbstractPitestFunctionalSpec extends IntegrationSpec {
1515
void setup() {
1616
fork = true //to make stdout assertion work with Gradle 2.x - http://forums.gradle.org/gradle/topics/unable-to-catch-stdout-stderr-when-using-tooling-api-i-gradle-2-x#reply_15357743
1717
memorySafeMode = true //shutdown Daemon after a few seconds of inactivity
18+
enableConfigurationCache() // Create gradle.properties file with configuration cache enabled
19+
}
20+
21+
private void enableConfigurationCache() {
22+
File gradlePropsFile = new File(getProjectDir(), "gradle.properties")
23+
gradlePropsFile.text = """
24+
org.gradle.configuration-cache=true
25+
""".stripIndent()
1826
}
1927

2028
protected static String getBasicGradlePitestConfig() {

src/funcTest/groovy/info/solidsoft/gradle/pitest/functional/PitestPluginGeneralFunctionalSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class PitestPluginGeneralFunctionalSpec extends AbstractPitestFunctionalSpec {
134134
result2.getStandardOutput().contains("Task :pitest FROM-CACHE")
135135
}
136136

137-
private String quoteBackslashesInWindowsPath(File file) {
137+
private static String quoteBackslashesInWindowsPath(File file) {
138138
//There is problem with backslash within '' or "" while running this test on Windows: "unexpected char"
139139
return file.absolutePath.replaceAll('\\\\', '\\\\\\\\')
140140
}

src/funcTest/groovy/info/solidsoft/gradle/pitest/functional/PitestPluginGradleVersionFunctionalSpec.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class PitestPluginGradleVersionFunctionalSpec extends AbstractPitestFunctionalSp
120120
private static final List<String> GRADLE7_VERSIONS = ["7.6.4", "7.5.1", "7.4.2", "7.3.3", "7.2", "7.5.1", "7.4.1", "7.3.3", "7.2", "7.1.1", "7.0.2"]
121121
private static final List<String> GRADLE8_VERSIONS = [LATEST_KNOWN_GRADLE_VERSION.version, "8.14.2", "8.13", "8.12.1", "8.11.1", "8.10.2",
122122
"8.9", "8.8", "8.7", "8.6.4", "8.5", "8.4", "8.3", "8.2.1", "8.1.1", "8.0.2"]
123-
private static final List<String> GRADLE9_VERSIONS = ["9.0.0-milestone-9"]
123+
private static final List<String> GRADLE9_VERSIONS = ["9.1.0", "9.0.0"]
124124
private static final List<String> GRADLE_LATEST_VERSIONS = [GRADLE6_VERSIONS.first(), GRADLE7_VERSIONS.first(), GRADLE8_VERSIONS.first(),
125125
GRADLE9_VERSIONS.first(), PitestPlugin.MINIMAL_SUPPORTED_GRADLE_VERSION.version]
126126

src/main/groovy/info/solidsoft/gradle/pitest/AggregateReportTask.groovy

Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import org.gradle.api.Incubating
66
import org.gradle.api.file.ConfigurableFileCollection
77
import org.gradle.api.file.DirectoryProperty
88
import org.gradle.api.file.RegularFileProperty
9-
import org.gradle.api.model.ObjectFactory
109
import org.gradle.api.provider.Property
1110
import org.gradle.api.tasks.Classpath
1211
import org.gradle.api.tasks.Input
@@ -36,30 +35,29 @@ import java.nio.charset.Charset
3635
abstract class AggregateReportTask extends DefaultTask {
3736

3837
@OutputDirectory
39-
final DirectoryProperty reportDir
38+
abstract DirectoryProperty getReportDir()
4039

4140
@OutputFile
42-
final RegularFileProperty reportFile
41+
abstract RegularFileProperty getReportFile()
4342

4443
@SkipWhenEmpty
4544
@InputFiles
4645
@PathSensitive(PathSensitivity.RELATIVE)
47-
final ConfigurableFileCollection sourceDirs
46+
abstract ConfigurableFileCollection getSourceDirs()
4847

4948
@SkipWhenEmpty
5049
@InputFiles
5150
@Classpath
52-
final ConfigurableFileCollection additionalClasspath
51+
abstract ConfigurableFileCollection getAdditionalClasspath()
5352

5453
@SkipWhenEmpty
5554
@InputFiles
5655
@PathSensitive(PathSensitivity.RELATIVE)
57-
final ConfigurableFileCollection mutationFiles
56+
abstract ConfigurableFileCollection getMutationFiles()
5857

59-
@SkipWhenEmpty
6058
@InputFiles
6159
@PathSensitive(PathSensitivity.RELATIVE)
62-
final ConfigurableFileCollection lineCoverageFiles
60+
abstract ConfigurableFileCollection getLineCoverageFiles()
6361

6462
//Stricter isolation level - https://docs.gradle.org/nightly/userguide/worker_api.html#changing_the_isolation_mode
6563
@InputFiles
@@ -68,42 +66,27 @@ abstract class AggregateReportTask extends DefaultTask {
6866

6967
@Input
7068
@Optional
71-
final Property<Charset> inputCharset
69+
abstract Property<Charset> getInputCharset()
7270

7371
@Input
7472
@Optional
75-
final Property<Charset> outputCharset
73+
abstract Property<Charset> getOutputCharset()
7674

7775
@Input
7876
@Optional
79-
final Property<Integer> testStrengthThreshold
77+
abstract Property<Integer> getTestStrengthThreshold()
8078

8179
@Input
8280
@Optional
83-
final Property<Integer> mutationThreshold
81+
abstract Property<Integer> getMutationThreshold()
8482

8583
@Input
8684
@Optional
87-
final Property<Integer> maxSurviving
85+
abstract Property<Integer> getMaxSurviving()
8886

8987
@Inject
9088
abstract WorkerExecutor getWorkerExecutor()
9189

92-
AggregateReportTask() {
93-
ObjectFactory of = project.objects
94-
reportDir = of.directoryProperty()
95-
reportFile = of.fileProperty()
96-
sourceDirs = of.fileCollection()
97-
additionalClasspath = of.fileCollection()
98-
mutationFiles = of.fileCollection()
99-
lineCoverageFiles = of.fileCollection()
100-
inputCharset = of.property(Charset)
101-
outputCharset = of.property(Charset)
102-
testStrengthThreshold = of.property(Integer)
103-
mutationThreshold = of.property(Integer)
104-
maxSurviving = of.property(Integer)
105-
}
106-
10790
@TaskAction
10891
void aggregate() {
10992
logger.info("Aggregating pitest reports (mutationFiles: {}, lineCoverageFiles: {})", mutationFiles.elements.getOrNull(), lineCoverageFiles.elements.getOrNull())

src/main/groovy/info/solidsoft/gradle/pitest/PitestAggregatorPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class PitestAggregatorPlugin implements Plugin<Project> {
108108
if (project.extensions.findByType(ReportingExtension)) {
109109
return project.extensions.getByType(ReportingExtension).baseDirectory.asFile.get()
110110
}
111-
return new File(project.buildDir, "reports")
111+
return project.layout.buildDirectory.dir("reports").get().asFile
112112
}
113113

114114
private Set<Project> getProjectsWithPitestPlugin() {

0 commit comments

Comments
 (0)