0

Question

How do I interact with Gradle Projects programmatically?

Context

I need to retrieve the Build Information provided in:

org.gradle.api.DefaultProject. 

But I see no way of getting the Project/SourceSets/Configuration container objects through java.

All the documentation I see describes how to achieve this using groovy DSL.

Thanks

tr_quest
  • 735
  • 2
  • 10
  • 24
  • what do you mean by 'programmatically'? do you write a custom plugin? – AdamSkywalker Dec 12 '15 at 17:52
  • Not exactly a custom plugin. If I were to use a plugin. I'd need to add apply plugin in the build.gradle to use them. I am writing a Java application that probes other Gradle Projects and uses their Build and Gradle Info. I don't want my application to be intrusive and make changes to the build scripts of the gradle projects. – tr_quest Dec 12 '15 at 18:05
  • 1
    I didn't get the idea: gradle objects (like DefaultProject object) exist in the jvm running gradle, how are you expecting to access them from your application? – AdamSkywalker Dec 12 '15 at 18:11
  • @AdamSkywalker Thanks for responding :). I see what you mean, So is there no means to collect project Information like SourceSet and ConfigurationContainer of a gradle project through an external application? – tr_quest Dec 12 '15 at 18:20
  • yes, it is impossible :) – AdamSkywalker Dec 12 '15 at 18:25

0 Answers0