Interface TemplateSet

All Superinterfaces:
org.gradle.api.Named
All Known Subinterfaces:
ResourceTemplateSet, SourceTemplateSet, TemplateSetInternal
All Known Implementing Classes:
ResourceTemplateSetImpl, SourceTemplateSetImpl, TemplateSetImpl

@NonExtendable public interface TemplateSet extends org.gradle.api.Named
A set of templates associated with one source sets.

A template set can represent source or resource templates, including source templates for different languages.

Since:
2.0.0
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Method Summary

    Modifier and Type
    Method
    Description
    @NotNull org.gradle.api.provider.Property<String>
    A literal header to insert at the top of generated source files.
    @NotNull org.gradle.api.file.SourceDirectorySet
    Directories providing templates which can be included into process templates, but which will not be processed for output themselves.
    @NotNull String
     
    @NotNull org.gradle.api.provider.MapProperty<String,Object>
    Runtime-defined properties.
    @NotNull org.gradle.api.file.ConfigurableFileCollection
    A collection of data files in YAML format.
    @NotNull org.gradle.api.file.SourceDirectorySet
    Directories containing templates.
    @NotNull org.gradle.api.NamedDomainObjectContainer<Variant>
    A container of template variants.
    default void
    include(@NotNull Object @NotNull ... includes)
    Add includes directories to the template path.
    default void
    property(String property, String value)
    Set a single property for this template.
    default void
    property(String property, org.gradle.api.provider.Provider<String> value)
    Set a single property for this template.
    default void
    propertyFile(@NotNull Object dataFile)
    Add a data file for variable data.
    default void
    templates(@NotNull Object @NotNull ... templates)
    Add one or more directories containing templates.
    default void
    variants(@NotNull String @NotNull ... variants)
    Register variants with certain names to be produced.
    default void
    variants(@NotNull org.gradle.api.Action<org.gradle.api.NamedDomainObjectSet<Variant>> configureAction)
    Configure produced variants.
  • Method Details

    • getName

      @Internal @NotNull @NotNull String getName()
      Specified by:
      getName in interface org.gradle.api.Named
    • getPropertyFiles

      @InputFiles @NotNull @NotNull org.gradle.api.file.ConfigurableFileCollection getPropertyFiles()
      A collection of data files in YAML format.
      Returns:
      the data file collection
      Since:
      2.0.0
    • propertyFile

      default void propertyFile(@NotNull @NotNull Object dataFile)
      Add a data file for variable data.
      Parameters:
      dataFile - the data file to add, evaluated as per Project.file(Object)
      Since:
      2.0.0
    • getProperties

      @Input @NotNull @NotNull org.gradle.api.provider.MapProperty<String,Object> getProperties()
      Runtime-defined properties.

      These properties will override anything in the data files.

      Returns:
      the properties
      Since:
      2.0.0
    • property

      default void property(String property, String value)
      Set a single property for this template.
      Parameters:
      property - the property
      value - the value for the property
      Since:
      2.0.0
    • property

      default void property(String property, org.gradle.api.provider.Provider<String> value)
      Set a single property for this template.
      Parameters:
      property - the property
      value - the provider providing a value for the property
      Since:
      2.0.0
    • getHeader

      @Input @Optional @NotNull @NotNull org.gradle.api.provider.Property<String> getHeader()
      A literal header to insert at the top of generated source files.

      This property is optional.

      Returns:
      the header
      Since:
      2.0.0
    • getVariants

      @NotNull @NotNull org.gradle.api.NamedDomainObjectContainer<Variant> getVariants()
      A container of template variants.

      Variants will process the same templates, but with different property values.

      Returns:
      the variants collection
      Since:
      2.0.0
    • variants

      default void variants(@NotNull @NotNull String @NotNull ... variants)
      Register variants with certain names to be produced.
      Parameters:
      variants - the variants to produce
      Since:
      2.0.0
    • variants

      default void variants(@NotNull @NotNull org.gradle.api.Action<org.gradle.api.NamedDomainObjectSet<Variant>> configureAction)
      Configure produced variants.
      Parameters:
      configureAction - an action to configure variants
      Since:
      2.0.0
    • getTemplates

      @Internal @NotNull @NotNull org.gradle.api.file.SourceDirectorySet getTemplates()
      Directories containing templates.

      All templates share a common namespace, so templates in directories that come first will override templates that come later.

      Returns:
      the templates to process
      Since:
      2.0.0
    • templates

      default void templates(@NotNull @NotNull Object @NotNull ... templates)
      Add one or more directories containing templates.
      Parameters:
      templates - the template directories to add, evaluated following Project.files(Object...)
      Since:
      2.0.0
    • getIncludes

      @Internal @NotNull @NotNull org.gradle.api.file.SourceDirectorySet getIncludes()
      Directories providing templates which can be included into process templates, but which will not be processed for output themselves.
      Returns:
      the includes directories
      Since:
      2.0.0
    • include

      default void include(@NotNull @NotNull Object @NotNull ... includes)
      Add includes directories to the template path.
      Parameters:
      includes - the includes directories to add, processed as in Project.files(Object...)
      Since:
      2.0.0
      See Also: