Skip to content

Commit 751f49c

Browse files
authored
fix: remove method from GradleUtils (#15126)
Usage can be expressed simpler via `as Type` directly.
1 parent b275bb2 commit 751f49c

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/GradleUtils.groovy

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,4 @@ class GradleUtils {
4141
static <T> T lookupProperty(Project project, String name, T defaultValue = null) {
4242
project.findProperty(name) as T ?: defaultValue
4343
}
44-
45-
static <T> T lookupPropertyByType(Project project, String name, Class<T> type) {
46-
project.findProperty(name) as T
47-
}
4844
}

build-logic/plugins/src/main/groovy/org/apache/grails/buildsrc/SbomPlugin.groovy

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import java.time.format.DateTimeFormatter
4848
import java.time.temporal.ChronoUnit
4949

5050
import static org.apache.grails.buildsrc.GradleUtils.lookupProperty
51-
import static org.apache.grails.buildsrc.GradleUtils.lookupPropertyByType
5251

5352
@CompileStatic
5453
class SbomPlugin implements Plugin<Project> {
@@ -125,8 +124,8 @@ class SbomPlugin implements Plugin<Project> {
125124
def sbomOutputLocation = project.layout.buildDirectory.file(
126125
project.provider {
127126
def artifactId = lookupProperty(project, 'pomArtifactId', project.name)
128-
def version = lookupPropertyByType(project, 'projectVersion', String)
129-
"${artifactId}-${version}-sbom.json" as String
127+
def version = project.findProperty('projectVersion')
128+
"$artifactId-$version-sbom.json" as String
130129
}
131130
)
132131

0 commit comments

Comments
 (0)