@Incubating interface TwirlSourceSet : LanguageSourceSet
Represents a source set containing twirl templates
apply plugin: 'play' model { components { play { sources { withType(TwirlSourceSet) { // Use template format views.formats.csv.CsvFormat for all files named *.scala.csv // Additionally, include views.formats.csv._ package imports in generated sources. addUserTemplateFormat("csv", "views.formats.csv.CsvFormat", "views.formats.csv._") // Add these additional imports to all generated Scala code from Twirl templates additionalImports = [ 'my.pkg._', 'my.pkg.MyClass' ] } } } } }
abstract fun addUserTemplateFormat(extension: String, templateType: String, vararg imports: String): Unit
Adds a custom template format. |
|
abstract fun getAdditionalImports(): MutableList<String>
Returns the list of additional imports to add to the generated Scala code. |
|
abstract fun getDefaultImports(): TwirlImports
The default imports that should be added to generated source files |
|
abstract fun getUserTemplateFormats(): MutableList<TwirlTemplateFormat>
Returns the custom template formats configured for this source set. |
|
abstract fun setAdditionalImports(additionalImports: MutableList<String>): Unit
Sets the additional imports to add to all generated Scala code. |
|
abstract fun setDefaultImports(defaultImports: TwirlImports): Unit
Sets the default imports that should be added to generated source files to the given language |
|
abstract fun setUserTemplateFormats(userTemplateFormats: MutableList<TwirlTemplateFormat>): Unit
Sets the custom template formats for this source set. |
abstract fun generatedBy(generatorTask: Task): Unit |
|
abstract fun getParentName(): String |
|
abstract fun getSource(): SourceDirectorySet
The source files. |