Class BuildInfo

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.springframework.boot.gradle.tasks.buildinfo.BuildInfo
All Implemented Interfaces:
Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, Named, ExtensionAware, Task, Configurable<Task>

@DisableCachingByDefault(because="Not worth caching") public abstract class BuildInfo extends DefaultTask
Task for generating a build info properties file from BuildInfoProperties.
Since:
2.0.0
Author:
Andy Wilkinson
  • Constructor Details

    • BuildInfo

      public BuildInfo()
  • Method Details

    • getExcludes

      @Internal public abstract SetProperty<String> getExcludes()
      Returns the names of the properties to exclude from the output.
      Returns:
      names of the properties to exclude
      Since:
      3.0.0
    • getFilename

      @Input public abstract Property<String> getFilename()
      Returns the name of the file that is written to the destination dir. Convention is META-INF/build-info.properties.
      Returns:
      the name of the written file
      Since:
      4.1.0
    • generateBuildProperties

      public void generateBuildProperties()
      Generates the build info properties file in the configured destination dir.
    • getDestinationDir

      @OutputDirectory public abstract DirectoryProperty getDestinationDir()
      Returns the directory to which the build info file will be written. Convention is build/${taskName}.
      Returns:
      the destination directory
    • getProperties

      public BuildInfoProperties getProperties()
      Returns the properties that will be included in the written file.
      Returns:
      the properties
    • properties

      public void properties(Action<BuildInfoProperties> action)
      Executes the given action on the getProperties() properties.
      Parameters:
      action - the action