I have a gradle plugin installed into Eclipse. We have a task that creates a war for us, is there a way to do an Eclipse Save All in the menu item to save all java files opened before the task starts to create the war?
2 Answers
It's possible for plugins to "Save All"; see How can I call save method in Eclipse plugin....
But if your plugin isn't already programmed to do that, and exposing the behavior in a Preference somewhere that you can set, you'll need to edit its source and recompile to add that functionality yourself.

- 1
- 1

- 1,392
- 7
- 11
-
-
Once the Gradle task is running, control will be in a subprocess rather than inside of Eclipse. I can't find a way for a subprocess (or any external process) to request Eclipse do a save. Eclipse has limited command-line support and the command in this case would need to talk back to the already running Eclipse process... [This discussion](http://stackoverflow.com/questions/206473/build-eclipse-java-project-from-command-line?rq=1) shows what such a command might look like, but it's beyond my knowledge to build. – Will Angley Apr 29 '15 at 15:26
Is it possible to create a Run configuration to execute the plugins "action" (running the gradle task)?
If this is the case, I'm pretty sure you can configure the run configuration to save files, or even ask to save modified files, depending on the settings of the user. before the actual thing gets launched.
And as there also is an option to store the run configuration inside a file you could also share it via version control system, if you want to make it work seamless for more people then you. ;)
I hope that helps or inpires.

- 638
- 4
- 17