Enable Gradle configuration cache (#1646)

Enable the configuration cache feature in Gradle, and adjust various
pieces of build logic that aren't configuration cache compatible.
This commit is contained in:
Daniel Chao
2026-06-05 11:05:19 -07:00
committed by GitHub
parent 74eae0388e
commit 87ec8ee730
20 changed files with 296 additions and 177 deletions
+12 -4
View File
@@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.io.ByteArrayOutputStream
import java.io.OutputStream
import org.gradle.kotlin.dsl.support.serviceOf
@@ -118,9 +117,15 @@ private fun setupJavaExecutableRun(
null -> "java"
else -> launcher.get().executablePath.asFile.absolutePath
}
standardOutput = OutputStream.nullOutputStream()
args("-jar", tasks.javaExecutable.get().outputs.files.singleFile.toString(), *args)
doFirst { standardOutput = OutputStream.nullOutputStream() }
val javaExecutableFile = tasks.javaExecutable.map { it.outputs.files.singleFile }
argumentProviders.add(
CommandLineArgumentProvider {
listOf("-jar", javaExecutableFile.get().absolutePath) + args.toList()
}
)
doFirst { outputFile.get().asFile.delete() }
@@ -133,7 +138,10 @@ val evalTestFlags = arrayOf("eval", "-x", "1 + 1", "pkl:base")
fun Exec.useRootDirAndSuppressOutput() {
workingDir = rootProject.layout.projectDirectory.asFile
standardOutput = ByteArrayOutputStream() // we only care that this exec doesn't fail
doFirst {
// we only care that this exec doesn't fail
standardOutput = OutputStream.nullOutputStream()
}
}
// 0.28 Preparing for JDK21 toolchains revealed that `testStartJavaExecutable` may pass, even though