Where are task inputs and outputs defined in the Gradle reference docs?


(Dan Gravell) #1

Am I looking in totally the wrong place?

For example, the JavaCompile task defines a bunch of outputs that can be used as inputs to other tasks.

But at neither:

https://docs.gradle.org/current/dsl/org.gradle.api.tasks.compile.JavaCompile.html

Nor:

https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/compile/JavaCompile.html

Are these documented.

How do I find out how I can wire tasks together without this?


(Mark Vieira) #2

Not explicitly. In effect, the destinationDir property is the “output” of this task.

One thing you can do however is refer to a task itself as an input. In this way Gradle will interpret this as all the outputs of that task. For example:

def stuff = files(compileJava) // returns all the stuff produced by the `compileJava` task

inputs.files(compileJava) // declares the files produced by `compileJava` as an input to this task and creates a dependency on `compileJava`

(Dan Gravell) #3

[quote=“mark_vieira, post:2, topic:21409”]
One thing you can do however is refer to a task itself as an input. In this way Gradle will interpret this as all the outputs of that task.
[/quote]That’s what I tried to do in my other issue you replied to: Trying to wire custom task to artifact, but “Cannot convert the provided notation”

This failed saying it could not convert the outputs, so my next stop was to try to understand what the outputs were, which is difficult.

Thanks for outlining this other more explicit way of wiring.