mirror of
https://github.com/apple/pkl.git
synced 2026-07-10 23:22:46 +02:00
Revert configuration cache (#1659)
This reverts the commits that enabled Gradle's configuration cache feature. IMO: this feature is too hard to use. We don't know if a task is valid for the configuration cache until it runs, and it's very hard to tell if something is safe when authoring Gradle code. For example, our publish tasks are currently failing; I don't know how I would fix this without running the publish task again on my dev machine. Also, some of our build scripts become more brittle because of this; for example, see https://github.com/apple/pkl/blob/bb07589eae0b3195a589559a3245cbc12c29b394/build-logic/src/main/kotlin/BuildInfo.kt#L291-L296
This commit is contained in:
@@ -93,29 +93,21 @@ fun createCompatibilityTestTask(versionInfo: GradleVersionInfo): TaskProvider<Te
|
||||
createCompatibilityTestTask(versionInfo.version, versionInfo.downloadUrl)
|
||||
|
||||
fun createCompatibilityTestTask(version: String, downloadUrl: String): TaskProvider<Test> {
|
||||
val currentGradleVersion = gradle.gradleVersion
|
||||
return tasks.register("compatibilityTest$version", Test::class.java) {
|
||||
mustRunAfter(tasks.test)
|
||||
|
||||
val myMaxHeapSize = tasks.test.map { it.maxHeapSize }
|
||||
val myJvmArgs = tasks.test.map { it.jvmArgs }
|
||||
val myClasspath = tasks.test.map { it.classpath }
|
||||
|
||||
maxHeapSize = tasks.test.get().maxHeapSize
|
||||
jvmArgs = tasks.test.get().jvmArgs
|
||||
classpath = tasks.test.get().classpath
|
||||
systemProperty("testGradleVersion", version)
|
||||
systemProperty("testGradleDistributionUrl", downloadUrl)
|
||||
|
||||
doFirst {
|
||||
if (
|
||||
version == currentGradleVersion &&
|
||||
project.gradle.taskGraph.hasTask(project.tasks.getByName("test"))
|
||||
) {
|
||||
if (version == gradle.gradleVersion && gradle.taskGraph.hasTask(tasks.test.get())) {
|
||||
// don't test same version twice
|
||||
println("This version has already been tested by the `test` task.")
|
||||
throw StopExecutionException()
|
||||
}
|
||||
maxHeapSize = myMaxHeapSize.get()
|
||||
jvmArgs = myJvmArgs.get()
|
||||
classpath = myClasspath.get()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user