Loading, updating and saving a build.gradle file using Java


I want to write Java code that will load a gradle.build file into memory / objects.

And then update its properties / methods.

And save the file again.

How can i do that?



There is currently no support for this in Gradle. The tooling Api allows you to run builds programmatically but doesn’t support editing the build.gradle file.