You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2025/06/17 10:04:08 UTC

(lucene) branch main updated: Use project version eagerly, it's constant and set early. #14779

This is an automated email from the ASF dual-hosted git repository.

dweiss pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/lucene.git


The following commit(s) were added to refs/heads/main by this push:
     new 37dce49a2de Use project version eagerly, it's constant and set early. #14779
37dce49a2de is described below

commit 37dce49a2de1eb40a603f733ddec9fbabc2745e8
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Tue Jun 17 11:53:46 2025 +0200

    Use project version eagerly, it's constant and set early. #14779
---
 build-tools/build-infra/src/main/groovy/lucene.java.modules.gradle | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/build-tools/build-infra/src/main/groovy/lucene.java.modules.gradle b/build-tools/build-infra/src/main/groovy/lucene.java.modules.gradle
index 7ad3eada166..0df59d1973c 100644
--- a/build-tools/build-infra/src/main/groovy/lucene.java.modules.gradle
+++ b/build-tools/build-infra/src/main/groovy/lucene.java.modules.gradle
@@ -232,21 +232,20 @@ allprojects {
     // Configure module versions.
     tasks.withType(JavaCompile).configureEach { task ->
       // TODO: LUCENE-10267: workaround for gradle bug. Remove when the corresponding issue is fixed.
+      String projectVersion = project.version.toString()
       task.options.compilerArgumentProviders.add((CommandLineArgumentProvider) {
         ->
         if (task.getClasspath().isEmpty()) {
           return [
             "--module-version",
-            project.version.toString()
+            projectVersion
           ]
         } else {
           return []
         }
       })
 
-      task.options.javaModuleVersion.set(provider {
-        return project.version.toString()
-      })
+      task.options.javaModuleVersion.set(projectVersion)
     }
   }
 }