Class PropertiesTask

  • All Implemented Interfaces:
    java.lang.Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

    public class PropertiesTask
    extends org.gradle.api.DefaultTask
    Task to generate a thin.properties file including all runtime dependencies. It saves some time on startup to have the dependencies pre-computed, but it makes it less flexible, so this task is optional. If you enable it, you probably want to make it a dependency of the main java plugin task so that it runs automatically on build.
    Author:
    Andy Wilkinson, Dave Syer
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gradle.api.Task

        org.gradle.api.Task.Namer
    • Field Summary

      • Fields inherited from interface org.gradle.api.Task

        TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertiesTask()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void generate()  
      protected java.util.Properties getThinProperties​(org.gradle.api.artifacts.Configuration configuration)  
      void setConfiguration​(org.gradle.api.artifacts.Configuration configuration)
      Sets the Configuration that will be used to resolve the dependencies that are listed in thin.properties.
      void setName​(java.lang.String name)
      The name of the thin properties file (defaults to "thin").
      void setOutput​(java.io.File output)
      Sets the location to which the properties file will be written.
      void setProfile​(java.lang.String profile)
      The profile to use for the generated properties (default null)
      • Methods inherited from class org.gradle.api.internal.AbstractTask

        addValidator, appendParallelSafeAction, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, doFirst, doFirst, doLast, doLast, execute, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getEnabled, getExecuter, getExtensions, getFinalizedBy, getGroup, getImpliesSubProjects, getInputs, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTemporaryDir, getTemporaryDirFactory, getValidators, hasProperty, injectIntoNewInstance, isEnabled, isHasCustomActions, leftShift, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProject, setProperty, setShouldRunAfter, shouldRunAfter, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • PropertiesTask

        public PropertiesTask()
    • Method Detail

      • generate

        public void generate()
      • getThinProperties

        protected java.util.Properties getThinProperties​(org.gradle.api.artifacts.Configuration configuration)
      • setConfiguration

        public void setConfiguration​(org.gradle.api.artifacts.Configuration configuration)
        Sets the Configuration that will be used to resolve the dependencies that are listed in thin.properties.
        Parameters:
        configuration - the configuration
      • setOutput

        public void setOutput​(java.io.File output)
        Sets the location to which the properties file will be written. Defaults to META-INF in the compiled classes output (build/resources/main/META-INF).
        Parameters:
        output - the output location
      • setName

        public void setName​(java.lang.String name)
        The name of the thin properties file (defaults to "thin").
        Overrides:
        setName in class org.gradle.api.internal.AbstractTask
      • setProfile

        public void setProfile​(java.lang.String profile)
        The profile to use for the generated properties (default null)
        Parameters:
        profile - the value of the profile