Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "Refresh all Gradle projects" do?

I'm trying to create a gradle plugin that generates some sources when the "Refresh all Gradle projects" button on the Gradle panel. I assume IntelliJ is executing some Gradle target, but I can't find any documentation to figure out which target or targets are executed.

This is for an Android project, and I've heard it suggested to use project.preBuild.dependsOn task, but I have not been able to get that to work every time I refresh (it only works the first time).

Refresh all Gradle Projects

like image 874
Mike Holler Avatar asked May 04 '26 01:05

Mike Holler


1 Answers

If look at the documentation for Intellij IDEA at https://www.jetbrains.com/idea/help/synchronizing-changes-in-gradle-project-and-intellij-idea-project.html

Clicking the refresh button in the gradle tool window does the following:

On pressing this button, IntelliJ IDEA parses the project structure, and displays detected differences (if any) in the Gradle tool window.

It essentially refreshes the project structure from any changes in gradle. It might be difficult to find the specific task that it is calling because under the hood it's using the Gradle Tooling API (https://docs.gradle.org/current/userguide/third_party_integration.html#embedding) to execute all tasks and get info about each project.

like image 141
mcarlin Avatar answered May 05 '26 16:05

mcarlin