netbeans-gradle-project icon indicating copy to clipboard operation
netbeans-gradle-project copied to clipboard

Load project when saving gradle file in the project

Open rajmahendra opened this issue 10 years ago • 3 comments

When you do any change in the gradle file and save it, the project is not reloaded to sync the changes of the build file to project

Scenario When your code is using junit and its not updated in gradle project Now you are resolving the dependency by adding junit in gradle file and save Open the java file depends on junit.

You still see junit is not resolved.

User manually need to right click the project and reload project. This may be automated when build.gradle (or any gradle file) in the project.

rajmahendra avatar Jan 26 '15 10:01 rajmahendra

Hi Rajmahendra, This is a known limitation explained (see _Current limitations_ section at the bottom of project main page) : It is not detected automatically when the project needs to be reloaded. The "Reload Project" action must be executed manually (from the project's popup menu). No automatic detection is done because reloading the project is slow (just like opening it).

imartinbe avatar Jan 26 '15 13:01 imartinbe

hmm if so... if we can detect the saving of gradle file, can we run resolve dependency, this may resolve java dependency at least ?

rajmahendra avatar Jan 26 '15 14:01 rajmahendra

@rajmahendra It is certainly technologically possible ... but IMHO perhaps processor-costly. In a multi-project setup (of say dozens of subprojects in my case), it would require watching each gradle file, to trigger the project action.

(For general reference, I am already patient enough to wait for this plugin to load the project(s), as-is; it's enough time to grab a cup of coffee or a sandwich. But, having the above as an optional setting would be nice.)

JustGregory-zz avatar Jan 26 '15 23:01 JustGregory-zz