Calling gradle sync from Idea plugin programmatically Follow
Our plugin overwrites some gradle files, e.g. sets non-default build variants.
How to programmatically call gradle sync from plugin so that the user does not need to manually click on this yellow banner
Unfortunately http://stackoverflow.com/q/28185682 does not help in my case.
Please sign in to leave a comment.
You can try the following api: com.intellij.openapi.externalSystem.util.ExternalSystemUtil#refreshProject
worked perfectly fine for Android Studio and it perfectly suits my purpose.
also worked somehow even with the Idea, but it updated the build variants only when I clicked on these to change.
Vladislav Soroka: In latest APIs GradleConstants is not present. Can you share updated snippet please?
org.jetbrains.plugins.gradle.util.GradleConstants is part of Gradle plugin