0PricingLogin
Groovy & Gradle: JVM Automation and Build Engineering · Lesson

Task Properties & Configuration

Learn to add properties to custom tasks, configure them, and ensure incremental builds.

What are Task Properties?

Custom Gradle tasks can be made highly flexible by adding properties. These properties act like variables that allow you to configure a task's behavior from your build.gradle script.

Using properties makes your custom tasks reusable and adaptable to different project needs without having to change their core logic.

Defining Simple Properties

To add a property to a custom task, you simply declare a public field within your task class. For basic types like String, int, or boolean, this is straightforward.

For more advanced scenarios, Gradle also offers dedicated Property types, but we'll start with simple declarations.

All lessons in this course

  1. Defining Custom Tasks
  2. Task Types & Actions
  3. Task Properties & Configuration
  4. Incremental Tasks & Up-to-Date Checks
← Back to Groovy & Gradle: JVM Automation and Build Engineering