Gradle refreshing every time I make project Follow
Every time I make or rebuild my project IDEA starts "Refreshing Gradle Project", which takes some considerable time and slows down workflow.
I am not changing the gradle build script so I see no reason why the project needs to be refreshed on every build.
Is this expected behaviour and can I turn it off somehow?
PS. I also frequently get multiple gradle refresh processes running concurrently when making project.
Gradle version 1.2, Mac OSX 10.8.2, happens in both IDEA 11 and Leda
Similar to http://youtrack.jetbrains.com/issue/IDEA-92954
Please sign in to leave a comment.
Linked gradle project is expected to be refreshed only when build.gradle or IDE project structure is changed. Just tried to reproduce the problem with gradle refresh on project make but had no luck. Please create dedicated ticket and ideally attach a sample project to it (I tried 'samples/java/multiproject' from gradle distribution).
Regarding the IDEA-92954 - it's expected to be fixed prior to v.12 release.
My build.gradle is not changing and I've checked the timestamp just to be sure. Which other files would need to change in order for IDEA to think that the project structure had changed?
I shall create a ticket but I've not been able to replicate this on a small scale project. I have 2 reasonably large projects that exhibit this behaviour.
Auto refresh is triggered by build.gradle or IJ config files (*.ipr, *.iml or files from .idea folder) change.
Is your project public? Can I download it and check the processing at local environment?
It's an in-house project so I wouldn't be able to supply the source code but I could supply the build script and IDEA files if that's any help?
Further info - it only seems to happen after running my gradle build outside IDEA then returning to the ide and making the project, or even sometimes spontaneously when returning to the ide without running the make. Consecutive project makes within IDEA do not trigger the gradle refresh.
The only files that change are .idea/workspace.xml, my 'build' dir and SCM files in .hg.
Is it the case that that external gradle build touches IDE project files (modifies timestamp but doesn't change content)? Do you have 'idea' plugin defined at your build.gradle?
The timestamps do not change for any of the project files except the workspace.xml.
Unfortunately I can't use the idea plugin as it's not compatible with the .idea project structure; I wish it was as it would eliminate all the problems associated with keeping the depenedencies for Gradle and IDEA separate an in-sync and simply manage everything from gradle.
I'm just guessing here but could it be anything to do with the gradle daemon picking up on changes in the artifact cache?
I see that the timestamps on some files in the .gradle/caches/ do change after runnung the external gradle build.
Just checked the code and yes, the only reasons for auto-refresh are:
I.e. there is no auto-refresh even on build.gradle modification.
I can add logging to the JetGradle plugin but ideally we'd like to get a sample gradle project which illustrates the problem (I understand that you were not able to repoduce it at the sample project so far).
Ok thanks Denis, I've double-checked and there are definitely no modifications/timestamp updates to the project files.
I will keep trying to replicate this on a simpler project and log an issue.
I am also getting this strange behavior even when I have turned off Auto-Import in Gradle Settings.
If there is any change in a Gradle related file.
After finishing a Gradle task the IDE automatically starts a Gradle Sync which makes IDE sluggish and non responsive.
Changes like commenting in a Gradle related file or just changing gradle.properties parameters that are only used from command line Gradle build, causes IntelliJ IDEA to resync the project which I wanted to delay as I know there is no logical change.
Here are some logs:
Do you face this issue with Android projects only?
@Yaroslav Bedrov: No, unfortunately it happens fafter completion of any Gardle task, on non-Android projects as well.
I rechecked this by putting empty line in gradle.properties and running assemble task for a Java Sub-Module.
The build for this module just took few secs and then it triggered the Gradle Sync.
Event Log in IDE:
Could you please try to check the issue with IDEA 2018.1 EAP: https://www.jetbrains.com/idea/nextversion/ ?
It seems to work fine on my machine.
Hi @Yaroslav Bedrov,
The problem persists even with IDEA 2018.1 EAP.
I get pretty much same logs
Here is what i get in Event Log
Could you please share full idea.log after restarting IDE and reproducing the issue? "I rechecked this by putting empty line in gradle.properties and running assemble task for a Java Sub-Module." - was it a pure java project or there were android sub-modules? Will the issue occure if you create new sample Gradle project from the scratch?