Add a dependecy in Android Studio project from plugin for the entire project
Hi,
I am creating a plugin which needs to add a dependency library to the project and modify the build.gradle files both at the module level as well as at the project level. For this I need to access the gradle files through code. I have already gone through this post
However this method can be used to get the build.gradle file of a particular module. I need to get the build.gradle file of the project. What should i do?
Thanks for help!!
Please sign in to leave a comment.
I found a solution to this.
You can get your project's gradle file as a Virtual File. And initialize an object of GradleBuildFile using your virtual file as the parameter to the constructor.