Gradle Incremental Builds - Declaring Inputs and Outputs with Runtime API: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
Line 4: Line 4:
* [[Gradle_Incremental_Builds#Declaring_Inputs_and_Outputs_with_Runtime_API|Gradle Incremental Builds]]
* [[Gradle_Incremental_Builds#Declaring_Inputs_and_Outputs_with_Runtime_API|Gradle Incremental Builds]]
=Overview=
=Overview=
Annotations in custom task types are the cleanest way to declare inputs and outputs. However, simple tasks can be configured to participate in incremental builds by using the Runtime API. There is also the case of the enhanced tasks we don't have source code for. In all these situations, we can configure the task's inputs and outputs with an alternative runtime API:
[https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#org.gradle.api.Task:inputs Task.getInputs()[
[https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#org.gradle.api.Task:outputs Task.getOutputs()]
[https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#org.gradle.api.Task:destroyables Task.getDestroyables()]

Revision as of 03:47, 22 October 2020

External

Internal

Overview

Annotations in custom task types are the cleanest way to declare inputs and outputs. However, simple tasks can be configured to participate in incremental builds by using the Runtime API. There is also the case of the enhanced tasks we don't have source code for. In all these situations, we can configure the task's inputs and outputs with an alternative runtime API:

[https://docs.gradle.org/current/dsl/org.gradle.api.Task.html#org.gradle.api.Task:inputs Task.getInputs()[
Task.getOutputs()
Task.getDestroyables()