From 95c3260a31c0fae5ce76ee7cde456552800a7fd2 Mon Sep 17 00:00:00 2001 From: Alex Hochheiden Date: Wed, 19 Nov 2025 09:42:49 -0800 Subject: [PATCH] Bug 1997963 - glean-gradle-plugin configuration-cache compatibly changes Replace `onlyIf` closures with `outputs.dir()` declarations for configuration cache compatibility. The closures were capturing non-serializable references which prevented caching. --- .../GleanGradlePlugin.groovy | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy b/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy index e9f7adfae4..15aae152b0 100644 --- a/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy +++ b/gradle-plugin/src/main/groovy/mozilla/telemetry/glean-gradle-plugin/GleanGradlePlugin.groovy @@ -372,9 +372,9 @@ except: ) TaskProvider createGleanPythonVirtualEnv = project.tasks.register("createGleanPythonVirtualEnv", Exec) { - onlyIf { - !envDir.exists() - } + description = "Create a Python virtual environment for Glean" + + outputs.dir(envDir) String pythonBinary = System.getenv("GLEAN_PYTHON") if (!pythonBinary) { @@ -395,9 +395,9 @@ except: } TaskProvider installGleanParser = project.tasks.register("installGleanParser", Exec) { - onlyIf { - !envDir.exists() - } + description = "Install glean_parser" + + outputs.dir(envDir) String pythonPackagesDir = System.getenv("GLEAN_PYTHON_WHEELS_DIR") if (!pythonPackagesDir) { @@ -445,9 +445,9 @@ except: // task alone isn't early enough. TaskProvider createBuildDir = project.tasks.register("createBuildDir") { description = "Make sure the build dir exists before creating the Python Environments" - onlyIf { - !project.file(project.buildDir).exists() - } + + outputs.dir(project.buildDir) + doLast { project.logger.lifecycle("Creating build directory:" + project.buildDir.getPath()) project.buildDir.mkdir()