Is it possible to create private Gradle task which is not visible on task list (gradlew tasks)?
To skip any task from the Gradle build, we can use the -x or –exclude-task option. In this case, we'll use “-x test” to skip tests from the build. As a result, the test sources aren't compiled, and therefore, aren't executed.
You can execute multiple tasks from a single build file. Gradle can handle the build file using gradle command. This command will compile each task in such an order that they are listed and execute each task along with the dependencies using different options.
Gradle doesn't support marking a task as "private". However, gradle tasks
will only show a task if it either has task.group
set, or no other task depends on it. The idea behind this is that such a task is likely meant to be executed directly by the user. In contrast, gradle tasks --all
will show all tasks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With