Annotation Interface PluginTaskParameter
An annotation that configures a parameter for plugin task.
Should be inside a type annotated with
PluginTask
.
The annotation is used during generation of particular plugin implementations, like Maven Mojos or Gradle Tasks.
Java primitives, strings, lists, maps, enums and simple records/POJOs are supported.
- Since:
- 1.0.x
- Author:
- Andriy Dmytruk
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Output type options.static enum
Path sensitivity options. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe default value.boolean
Whether the file is a directory.The global property name.boolean
Whether the parameter is plugin-internal.Whether the parameter is output of the task.boolean
Whether the parameter is required.
-
Element Details
-
required
boolean requiredWhether the parameter is required. By default, parameters are not required to ensure a simple plugin API. Parameters that have a default value should not be required.- Returns:
- Whether it is required
- Default:
- false
-
defaultValue
String defaultValueThe default value. Is allowed only for Java primitives or enums.- Returns:
- The default value
- Default:
- ""
-
internal
boolean internalWhether the parameter is plugin-internal. This means that the parameter won't get exposed as part of plugin API. Specific logic will be written by developer in plugin to set the value for this parameter. This is useful for parameters that depend on plugin-specific logic, like getting the build directory.- Returns:
- Whether it is internal
- Default:
- false
-
globalProperty
String globalPropertyThe global property name. For maven Mojo it will correspond to@Parameter(property='')
value. It has no current effect for Gradle.- Returns:
- The property name
- Default:
- ""
-
directory
boolean directoryWhether the file is a directory. Will only work for parameters of typeFile
.- Returns:
- Whether it is a directory.
- Default:
- false
-
output
Whether the parameter is output of the task. Most likely, the parameter is a file or directory.- Returns:
- Whether it is output and what type of output it is
- Default:
- NONE
-
pathSensitivity
PluginTaskParameter.PathSensitivity pathSensitivity- Returns:
- Path sensitivity to use for file parameters. This would reflect on how task executions are cached. If the path is considered equal, task won't be executed again. This has no effect for Maven.
- Default:
- ABSOLUTE
-