How to add dependencies to gradle file from IntelliJ DEA plugin? Permanently deleted user Created February 24, 2017 10:11 I'm building an android studio plugin and want to programmatically modify current projects's gradle configuration to add extra dependencies.
You can try to use com.android.tools.idea.gradle.dsl.model.GradleBuildModel api.
find the sample test at https://github.com/JetBrains/android/blob/171/android/testSrc/com/android/tools/idea/gradle/dsl/model/dependencies/ArtifactDependencyTest.java#L197-L222