api / org.gradle.api.tasks.options

Package org.gradle.api.tasks.options



class Option

Marks a property of a org.gradle.api.Task as being configurable from the command-line.

This annotation should be attached to a field or a setter method. When attached to a field, #option() will use the name of the field by default. When attached to a method, #option() must be specified.

An option may have one of the following types:

  • boolean
  • Boolean
  • Enum
  • List<Enum>
  • List<String>
  • String


class OptionValues

Marks a method on a org.gradle.api.Task as providing the possible values for a String or List<String> Option. At most one option values method may be provided for a particular option.

This annotation should be attached to a getter method that returns a java.util.Collection of possible values. The entries in the collection may be of any type. If necessary, they are transformed into String by calling toString().