0

I am using gradle tooling api and I encountered the following scenario. There is a project that applies a certain plugin P which creates a task T only if the property shouldApplyP is passed.

Hence, if you will run ./gradlew tasks --all you won't see task T, but if you will run ./gradlew -PshouldApplyP tasks --all you will see task T.

In gradle tooling api, once a ProjectConnection has created I can do connection.getModel(GradleProject.class).getTasks()

But I can't see this specific task. Is there a way to pass the project connection this property -PshouldApplyP so it will be presented in the getTasks() method?

slashms
  • 928
  • 9
  • 26

1 Answers1

1
connection.newBuild()
    .withArguments("-PshouldApplyP", "tasks --all")
    .run()
Abhijit Sarkar
  • 21,927
  • 20
  • 110
  • 219