From a7cc754e1fc69ba33df8119518af4bb16b5ed07f Mon Sep 17 00:00:00 2001 From: Scott Murphy Heiberg Date: Thu, 15 Aug 2024 21:25:23 -0600 Subject: [PATCH] Gradle 8.10 compatibility --- .../web/gsp/GroovyPageForkCompileTask.groovy | 11 ++++++-- .../plugin/web/gsp/GspCompileOptions.groovy | 25 ++++++++++++------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPageForkCompileTask.groovy b/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPageForkCompileTask.groovy index 043520f1..6d8cdc43 100644 --- a/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPageForkCompileTask.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/web/gsp/GroovyPageForkCompileTask.groovy @@ -4,11 +4,13 @@ import groovy.transform.CompileDynamic import groovy.transform.CompileStatic import org.gradle.api.Action import org.gradle.api.file.FileTree +import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.* import org.gradle.api.tasks.compile.AbstractCompile import org.gradle.process.ExecResult import org.gradle.process.JavaExecSpec +import javax.inject.Inject import java.nio.file.Files import java.nio.file.Path import java.nio.file.Paths @@ -22,7 +24,7 @@ import java.nio.file.Paths * @since 4.0 */ @CompileStatic -class GroovyPageForkCompileTask extends AbstractCompile { +abstract class GroovyPageForkCompileTask extends AbstractCompile { @Input @Optional @@ -46,8 +48,13 @@ class GroovyPageForkCompileTask extends AbstractCompile { @Optional String serverpath + @Inject + protected ObjectFactory getObjectFactory() { + throw new UnsupportedOperationException(); + } + @Nested - GspCompileOptions compileOptions = new GspCompileOptions() + GspCompileOptions compileOptions = getObjectFactory().newInstance(GspCompileOptions.class) @Override @PathSensitive(PathSensitivity.RELATIVE) diff --git a/src/main/groovy/org/grails/gradle/plugin/web/gsp/GspCompileOptions.groovy b/src/main/groovy/org/grails/gradle/plugin/web/gsp/GspCompileOptions.groovy index d093490f..a21376fb 100644 --- a/src/main/groovy/org/grails/gradle/plugin/web/gsp/GspCompileOptions.groovy +++ b/src/main/groovy/org/grails/gradle/plugin/web/gsp/GspCompileOptions.groovy @@ -1,22 +1,29 @@ package org.grails.gradle.plugin.web.gsp +import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.Input import org.gradle.api.tasks.Nested -import org.gradle.api.tasks.compile.BaseForkOptions +import org.gradle.api.tasks.compile.AbstractOptions import org.gradle.api.tasks.compile.GroovyForkOptions +import javax.inject.Inject; /** -* Presents the Compile Options used by the {@llink GroovyPageForkCompileTask} -* -* @author David Estes -* @since 4.0 -*/ -class GspCompileOptions implements Serializable { + * Presents the Compile Options used by the {@llink GroovyPageForkCompileTask} + * + * @author David Estes + * @since 4.0 + */ +abstract class GspCompileOptions extends AbstractOptions { private static final long serialVersionUID = 0L; @Input - String encoding = "UTF-8" + String encoding = "UTF-8" + + @Inject + protected ObjectFactory getObjectFactory() { + throw new UnsupportedOperationException(); + } @Nested - GroovyForkOptions forkOptions = new GroovyForkOptions() + GroovyForkOptions forkOptions = getObjectFactory().newInstance(GroovyForkOptions.class) } \ No newline at end of file