Add Gradle Tasks programmatically to available tasks list using Gradle Tooling API

678 Views Asked by At

One can add new tasks to the Task list by declaring new tasks in the build.gradle file

Adding the following to build.gradle adds listJars task to the available tasks list.

task listJars << { configurations.compile.each { File file -> println file.path + File.separator+ file.name } }

Is there any way to achieve the same programmatically in a Java program ?

0

There are 0 best solutions below