From 5fd9e1e72a29ee73b3339970ab87b96c72a9a989 Mon Sep 17 00:00:00 2001 From: Tyler Veness Date: Fri, 8 Aug 2025 22:48:11 -0700 Subject: [PATCH] [build] Fix Gradle Task.project deprecation warning (#8167) ``` > Task :wpilibcExamples:checkCommands Script '/home/tav/frc/wpilib/allwpilib/shared/examplecheck.gradle': line 135 Invocation of Task.project at execution time has been deprecated. This will fail with an error in Gradle 10.0. This API is incompatible with the configuration cache, which will become the only mode supported by Gradle in a future release. Consult the upgrading guide for further information: https://docs.gradle.org/8.14.3/userguide/upgrading_version_7.html#task_project at examplecheck_4wsg1s37eigy9vs5arzst20ga$_run_closure5$_closure16$_closure17.doCall$original(/home/tav/frc/wpilib/allwpilib/shared/examplecheck.gradle:135) (Run with --stacktrace to get the full stack trace of this deprecation warning.) ``` Moving the project access outside the doLast block makes it occur at confguration time instead. --- shared/examplecheck.gradle | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shared/examplecheck.gradle b/shared/examplecheck.gradle index bbd7f65c80..347475116a 100644 --- a/shared/examplecheck.gradle +++ b/shared/examplecheck.gradle @@ -122,6 +122,7 @@ task checkSnippets(type: Task) { } task checkCommands(type: Task) { + def isCppCommands = project.isCppCommands; doLast { def parsedJson = new groovy.json.JsonSlurper().parseText(commandFile.text) fileCheck(parsedJson, commandDirectory) @@ -132,7 +133,7 @@ task checkCommands(type: Task) { assert it.foldername != null assert it.replacename != null assert it.commandversion != null - if (project.isCppCommands) { + if (isCppCommands) { assert it.headers != null assert !it.headers.isEmpty() assert it.source != null