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 7b7b94f3..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 @@ -4,26 +4,25 @@ import org.gradle.api.model.ObjectFactory import org.gradle.api.tasks.Input import org.gradle.api.tasks.Nested import org.gradle.api.tasks.compile.AbstractOptions -import org.gradle.api.tasks.compile.BaseForkOptions 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 extends AbstractOptions { + * 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(); - } + @Inject + protected ObjectFactory getObjectFactory() { + throw new UnsupportedOperationException(); + } @Nested GroovyForkOptions forkOptions = getObjectFactory().newInstance(GroovyForkOptions.class)