Edit and inspect build.grade

Hi, I'm trying to edit and inspect build.gradle. It looks like this package "org.jetbrains.plugins.groovy.lang.psi" have the code to parse/edit the file (after looking at this test file) but I can't find the jars for the groovy plugin to include in my IntelliJ plugin would you be able to point me where to find them?. 

Here's snippets from the test file hopefully I'm headed in the right direction:

Read build.gradle: 

final GradleBuildFile file = getTestFile(getSimpleTestFile());
GrStatementOwner closure = file.getClosure("android/defaultConfig");
assertEquals("1", file.getValue(closure, BuildFileKey.TARGET_SDK_VERSION));

 

Write/Edit: 

final GradleBuildFile file = getTestFile(getSimpleTestFile());
WriteCommandAction.runWriteCommandAction(getProject(), new Runnable() {
      @Override public void run() {
             GrStatementOwner closure = file.getClosure("android/defaultConfig");
             file.setValue(closure, BuildFileKey.TARGET_SDK_VERSION, 2);
      } });
 

Please sign in to leave a comment.