5

I've been using gradle -t to continuously build & run my tests every time I save a source file. Very useful. However, I'm editing the file in Vim, which means .swp files are being created and changed on a regular basis. Every time a .swp file changes, Gradle kicks off a rebuild. Not the end of the world, but annoying.

Is there any way I can tell Gradle to ignore changes in *.swp files when in continuous mode?

abeger
  • 6,766
  • 7
  • 41
  • 58
  • How about trying to exclude these files from the task that is picking them up as input? For java source files, it looks like that'd be something like: `compileJava { exclude "**.swp" }` – nickb Apr 04 '16 at 14:54
  • Well, [this page](https://docs.gradle.org/current/userguide/continuous_build.html) says continuous builds uses a task's `taskInputs` to determine when to run a task again. I wonder if excluding files from a sourceSet/configuration excludes them from `taskInputs` as well.. – RaGe Apr 04 '16 at 14:56
  • Tell vim to store .swp files in /tmp/ directory. More [here](https://stackoverflow.com/questions/1636297/how-to-change-the-folder-path-for-swp-files-in-vim). – Tarek Dakhran Mar 22 '20 at 21:31

0 Answers0