Android Build.Gradle file edit
Good Morning every one,
I develop a plugin for android studio target code edition. in one part of the work I need to edit and add some features to the build.gradle file. is there any API that I can take a look at in order to understand how can I reach this goal?
thank you in advance
请先登录再写评论。
Hi,
Sorry for late reply.
Working with build.gradle files is same as any other groovy file. Please take a look at this document for basic information on working with text: https://www.jetbrains.org/intellij/sdk/docs/tutorials/editor_basics/working_with_text.html
Hi Nikita, I tried another way to edit the gradle file programmatically from my plugin, but it seems that it didn't write anything. my code looks like the following:
do you have any idea that what is the issue?
thanks in advance
I understand the problem is the fact that I got the wrong build.gradle file, I need the build.gradle (Module:app), do you have any idea about how can I get that object?
I change the first line of the code, and the problem has been solved.
Glad to see you have the problem solved!