api / org.gradle.play.tasks / TwirlCompile

TwirlCompile

@Incubating open class TwirlCompile : SourceTask

Task for compiling Twirl templates into Scala code.

Constructors

<init>

TwirlCompile()

Task for compiling Twirl templates into Scala code.

Functions

addUserTemplateFormat

open fun addUserTemplateFormat(extension: String, templateType: String, vararg imports: String): Unit

Adds a custom template format.

getAdditionalImports

open fun getAdditionalImports(): MutableList<String>

Returns the list of additional imports to add to the generated Scala code.

getDefaultImports

open fun getDefaultImports(): TwirlImports

Returns the default imports that will be used when compiling templates.

getDependencyNotation

open fun getDependencyNotation(): Any

getForkOptions

open fun getForkOptions(): BaseForkOptions

fork options for the twirl compiler.

getOutputDirectory

open fun getOutputDirectory(): File

Returns the directory to generate the parser source files into.

getToolChain

open fun getToolChain(): PlayToolChain

Returns the tool chain that will be used to compile the twirl source.

getUserTemplateFormats

open fun getUserTemplateFormats(): MutableList<TwirlTemplateFormat>

Returns the custom template formats configured for this task.

setAdditionalImports

open fun setAdditionalImports(additionalImports: MutableList<String>): Unit

Sets the additional imports to add to all generated Scala code.

setDefaultImports

open fun setDefaultImports(defaultImports: TwirlImports): Unit

Sets the default imports to be used when compiling templates.

setOutputDirectory

open fun setOutputDirectory(outputDirectory: File): Unit

Specifies the directory to generate the parser source files into.

setPlatform

open fun setPlatform(platform: PlayPlatform): Unit

setToolChain

open fun setToolChain(toolChain: PlayToolChain): Unit

Sets the tool chain that will be used to compile the twirl source.

setUserTemplateFormats

open fun setUserTemplateFormats(userTemplateFormats: MutableList<TwirlTemplateFormat>): Unit

Sets the custom template formats for this task.

Inherited Functions

exclude

open fun exclude(vararg excludes: String): SourceTask
open fun exclude(excludes: MutableIterable<String>): SourceTask
open fun exclude(excludeSpec: Spec<FileTreeElement>): SourceTask
open fun exclude(excludeSpec: Closure<Any>): SourceTask

{@inheritDoc}

getExcludes

open fun getExcludes(): MutableSet<String>

{@inheritDoc}

getIncludes

open fun getIncludes(): MutableSet<String>

{@inheritDoc}

getSource

open fun getSource(): FileTree

Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist.

include

open fun include(vararg includes: String): SourceTask
open fun include(includes: MutableIterable<String>): SourceTask
open fun include(includeSpec: Spec<FileTreeElement>): SourceTask
open fun include(includeSpec: Closure<Any>): SourceTask

{@inheritDoc}

setExcludes

open fun setExcludes(excludes: MutableIterable<String>): SourceTask

{@inheritDoc}

setIncludes

open fun setIncludes(includes: MutableIterable<String>): SourceTask

{@inheritDoc}

setSource

open fun setSource(source: FileTree): Unit

Sets the source for this task.

open fun setSource(source: Any): Unit

Sets the source for this task. The given source object is evaluated as per org.gradle.api.Project#files(Object...).

source

open fun source(vararg sources: Any): SourceTask

Adds some source to this task. The given source objects will be evaluated as per org.gradle.api.Project#files(Object...).