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

matrei pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/grails-core.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new 751f49cb75 fix: remove method from `GradleUtils` (#15126)
751f49cb75 is described below

commit 751f49cb751fb7450bc7ed73dd62a43c913af876
Author: Mattias Reichel <[email protected]>
AuthorDate: Tue Oct 14 22:27:06 2025 +0200

    fix: remove method from `GradleUtils` (#15126)
    
    Usage can be expressed simpler via `as Type` directly.
---
 .../src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy    | 4 ----
 .../src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy     | 5 ++---
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git 
a/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy
 
b/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy
index 2b1e9057a9..2ee3b782f1 100644
--- 
a/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy
+++ 
b/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy
@@ -41,8 +41,4 @@ class GradleUtils {
     static <T> T lookupProperty(Project project, String name, T defaultValue = 
null) {
         project.findProperty(name) as T ?: defaultValue
     }
-
-    static <T> T lookupPropertyByType(Project project, String name, Class<T> 
type) {
-        project.findProperty(name) as T
-    }
 }
diff --git 
a/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy
 
b/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy
index bde5353d5d..0f7acf4256 100644
--- 
a/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy
+++ 
b/build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy
@@ -48,7 +48,6 @@ import java.time.format.DateTimeFormatter
 import java.time.temporal.ChronoUnit
 
 import static org.apache.grails.buildsrc.GradleUtils.lookupProperty
-import static org.apache.grails.buildsrc.GradleUtils.lookupPropertyByType
 
 @CompileStatic
 class SbomPlugin implements Plugin<Project> {
@@ -125,8 +124,8 @@ class SbomPlugin implements Plugin<Project> {
         def sbomOutputLocation = project.layout.buildDirectory.file(
             project.provider {
                 def artifactId = lookupProperty(project, 'pomArtifactId', 
project.name)
-                def version = lookupPropertyByType(project, 'projectVersion', 
String)
-                "${artifactId}-${version}-sbom.json" as String
+                def version = project.findProperty('projectVersion')
+                "$artifactId-$version-sbom.json" as String
             }
         )
 

Reply via email to