Automatically configuration of inputs and outputs in custom task

I would like to write a custom task which changes tasks inputs and outputs based on the tasks configuration. Where can I put that code? Is there a annotation corresponding to @TaskAction which can be used to run code in the configuration phase?

I just realized that could be done in a property setter method for a configuration property. Is that a good approach?

You can annotate methods as well. Sometimes this is the best way when the inputs are derived from other configuration.

@Input
def getSomeInput() {
    // logic to determine input value
}

Interesting, thanks! I found a list of annotations here.

1 Like