GeneratorTask (Gradle API 5.0)
Date: 2018-11-26

Package org.gradle.plugins.ide.api

## Class GeneratorTask<T>

- java.lang.Object
- - org.gradle.api.internal.AbstractTask
  - - org.gradle.api.DefaultTask
    - - org.gradle.api.internal.ConventionTask
      - - org.gradle.plugins.ide.api.GeneratorTask<T>

- Type Parameters:
    `T` - The domain object for the configuration file.
  Direct Known Subclasses:
    `GenerateSolutionFileTask`, `PropertiesGeneratorTask`, `PropertyListGeneratorTask`, `XmlGeneratorTask`

      public class GeneratorTask<T>
      extends org.gradle.api.internal.ConventionTask

  A `GeneratorTask` generates a configuration file based on a domain object of type T. When executed the task:

  - loads the object from the input file, if it exists.
  - Calls the beforeConfigured actions, passing the object to each action.
  - Configures the object in some task-specific way.
  - Calls the afterConfigured actions, passing the object to each action.
  - writes the object to the output file.

- - ### Nested Class Summary

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

      `Task.Namer`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected org.gradle.internal.MutableActionSet<T>` | `afterConfigured` |
    `protected org.gradle.internal.MutableActionSet<T>` | `beforeConfigured` |
    `protected T` | `domainObject` |
    `protected org.gradle.plugins.ide.internal.generator.generator.Generator<T>` | `generator` |

    - ### Fields inherited from interface org.gradle.api.Task

      `TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `GeneratorTask​()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected boolean` | `getIncremental​()` | Whether this generator task can be treated as an incremental task or not
    `java.io.File` | `getInputFile​()` | The input file to load the initial configuration from.
    `protected java.io.File` | `getInputFileIfExists​()` |
    `protected org.gradle.internal.reflect.Instantiator` | `getInstantiator​()` |
    `java.io.File` | `getOutputFile​()` | The output file to write the final configuration to.
    `void` | `setInputFile​(java.io.File inputFile)` | Sets the input file to load the initial configuration from.
    `void` | `setOutputFile​(java.io.File outputFile)` | Sets the output file to write the final configuration to.

    - ### Methods inherited from class org.gradle.api.internal.AbstractTask

      `appendParallelSafeAction, compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString`

    - ### Methods inherited from class org.gradle.api.internal.ConventionTask

      `conventionMapping, conventionMapping, getConventionMapping`

    - ### Methods inherited from class org.gradle.api.DefaultTask

      `newInputDirectory, newInputFile, newOutputDirectory, newOutputFile`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### beforeConfigured

          protected final org.gradle.internal.MutableActionSet<T> beforeConfigured

    - #### afterConfigured

          protected final org.gradle.internal.MutableActionSet<T> afterConfigured

    - #### generator

          protected org.gradle.plugins.ide.internal.generator.generator.Generator<T> generator

    - #### domainObject

          protected T domainObject

  - ### Constructor Detail

    - #### GeneratorTask

          public GeneratorTask​()

  - ### Method Detail

    - #### getIncremental

          @Internal
          @Incubating
          protected boolean getIncremental​()

      Whether this generator task can be treated as an incremental task or not
      Since:
        4.7

    - #### getInstantiator

          @Inject
          protected org.gradle.internal.reflect.Instantiator getInstantiator​()

    - #### getInputFile

          @Internal("Covered by inputFileIfExists")
          public java.io.File getInputFile​()

      The input file to load the initial configuration from. Defaults to the output file. If the specified input file does not exist, this task uses some default initial configuration.
      Returns:
        The input file.

    - #### getInputFileIfExists

          @Nullable
          @Optional
          @PathSensitive(NONE)
          @InputFile
          protected java.io.File getInputFileIfExists​()

    - #### setInputFile

          public void setInputFile​(@Nullable
                                   java.io.File inputFile)

      Sets the input file to load the initial configuration from.
      Parameters:
        `inputFile` - The input file. Use null to use the output file.

    - #### getOutputFile

          @OutputFile
          public java.io.File getOutputFile​()

      The output file to write the final configuration to.
      Returns:
        The output file.

    - #### setOutputFile

          public void setOutputFile​(java.io.File outputFile)

      Sets the output file to write the final configuration to.
      Parameters:
        `outputFile` - The output file.