This is an automated email from the ASF dual-hosted git repository. paulk pushed a commit to branch GROOVY_4_0_X in repository https://gitbox.apache.org/repos/asf/groovy.git
commit baf793de9a6817295dce9bd349e26f1de6e376db Author: Paul King <[email protected]> AuthorDate: Mon Apr 14 22:44:18 2025 +1000 later gradle syntax --- .../groovy/org/apache/groovy/gradle/DgmConverter.groovy | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/build-logic/src/main/groovy/org/apache/groovy/gradle/DgmConverter.groovy b/build-logic/src/main/groovy/org/apache/groovy/gradle/DgmConverter.groovy index e639c41883..6e61315c98 100644 --- a/build-logic/src/main/groovy/org/apache/groovy/gradle/DgmConverter.groovy +++ b/build-logic/src/main/groovy/org/apache/groovy/gradle/DgmConverter.groovy @@ -24,8 +24,11 @@ import org.gradle.api.DefaultTask import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.ConfigurableFileTree import org.gradle.api.file.DirectoryProperty +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.Provider import org.gradle.api.tasks.CacheableTask import org.gradle.api.tasks.Classpath +import org.gradle.api.tasks.Input import org.gradle.api.tasks.InputFiles import org.gradle.api.tasks.OutputDirectory import org.gradle.api.tasks.PathSensitive @@ -41,6 +44,7 @@ class DgmConverter extends DefaultTask { private final ExecOperations execOperations + @Input Provider<String> groovyTargetBytecodeVersion = project.rootProject.extensions.getByType(SharedConfiguration).groovyTargetBytecodeVersion @OutputDirectory final DirectoryProperty outputDirectory @@ -54,13 +58,13 @@ class DgmConverter extends DefaultTask { final ConfigurableFileCollection classpath @Inject - DgmConverter(ExecOperations execOperations) { + DgmConverter(ExecOperations execOperations, ObjectFactory objects) { description = 'Generates DGM info file required for faster startup.' this.execOperations = execOperations - classpath = project.objects.fileCollection() - sources = project.objects.fileTree() - outputDirectory = project.objects.directoryProperty().convention( - project.layout.buildDirectory.dir("dgm") + classpath = objects.fileCollection() + sources = objects.fileTree() + outputDirectory = objects.directoryProperty().convention( + project.layout.buildDirectory.dir("dgm") ) } @@ -71,7 +75,7 @@ class DgmConverter extends DefaultTask { execOperations.javaexec { it.mainClass.set('org.codehaus.groovy.tools.DgmConverter') it.classpath = this.classpath - it.jvmArgs("-Dgroovy.target.bytecode=${project.rootProject.extensions.getByType(SharedConfiguration).groovyTargetBytecodeVersion.get()}" as String) + it.jvmArgs("-Dgroovy.target.bytecode=${groovyTargetBytecodeVersion.get()}" as String) it.args('--info', outputDirectory.asFile.get().absolutePath) } }
