Skip to content

Commit

Permalink
Fixes #314
Browse files Browse the repository at this point in the history
  • Loading branch information
codeconsole committed Aug 16, 2024
1 parent 2f5d2a8 commit 8cdbb11
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,7 +24,7 @@ import java.nio.file.Paths
* @since 4.0
*/
@CompileStatic
class GroovyPageForkCompileTask extends AbstractCompile {
abstract class GroovyPageForkCompileTask extends AbstractCompile {

@Input
@Optional
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 8cdbb11

Please sign in to comment.