mirror of
https://github.com/apple/pkl.git
synced 2026-07-08 22:15:11 +02:00
Fix gradle configuration cache issues for gradle-compatibility (#1658)
This commit is contained in:
@@ -93,21 +93,29 @@ fun createCompatibilityTestTask(versionInfo: GradleVersionInfo): TaskProvider<Te
|
|||||||
createCompatibilityTestTask(versionInfo.version, versionInfo.downloadUrl)
|
createCompatibilityTestTask(versionInfo.version, versionInfo.downloadUrl)
|
||||||
|
|
||||||
fun createCompatibilityTestTask(version: String, downloadUrl: String): TaskProvider<Test> {
|
fun createCompatibilityTestTask(version: String, downloadUrl: String): TaskProvider<Test> {
|
||||||
|
val currentGradleVersion = gradle.gradleVersion
|
||||||
return tasks.register("compatibilityTest$version", Test::class.java) {
|
return tasks.register("compatibilityTest$version", Test::class.java) {
|
||||||
mustRunAfter(tasks.test)
|
mustRunAfter(tasks.test)
|
||||||
|
|
||||||
maxHeapSize = tasks.test.get().maxHeapSize
|
val myMaxHeapSize = tasks.test.map { it.maxHeapSize }
|
||||||
jvmArgs = tasks.test.get().jvmArgs
|
val myJvmArgs = tasks.test.map { it.jvmArgs }
|
||||||
classpath = tasks.test.get().classpath
|
val myClasspath = tasks.test.map { it.classpath }
|
||||||
|
|
||||||
systemProperty("testGradleVersion", version)
|
systemProperty("testGradleVersion", version)
|
||||||
systemProperty("testGradleDistributionUrl", downloadUrl)
|
systemProperty("testGradleDistributionUrl", downloadUrl)
|
||||||
|
|
||||||
doFirst {
|
doFirst {
|
||||||
if (version == gradle.gradleVersion && gradle.taskGraph.hasTask(tasks.test.get())) {
|
if (
|
||||||
|
version == currentGradleVersion &&
|
||||||
|
project.gradle.taskGraph.hasTask(project.tasks.getByName("test"))
|
||||||
|
) {
|
||||||
// don't test same version twice
|
// don't test same version twice
|
||||||
println("This version has already been tested by the `test` task.")
|
println("This version has already been tested by the `test` task.")
|
||||||
throw StopExecutionException()
|
throw StopExecutionException()
|
||||||
}
|
}
|
||||||
|
maxHeapSize = myMaxHeapSize.get()
|
||||||
|
jvmArgs = myJvmArgs.get()
|
||||||
|
classpath = myClasspath.get()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user