Running the proguard build on background
Would it be possible to run the proguard build on background rather than in the foreground as a modal window preventing editing for several seconds on save ?
Yes - it's on my list for features to implement soon. ("Soon", unfortunately, has turned out to not be as soon as I would like.)
Thanks for the answer, hopefully you'll get some time for it soon as I find your plugin really helpful (btw I mentioned it in my presentation Scala on Android which I put on SlideShare so you might get more attention ;-) Is it necessary to run the proguard builder on save at all ? Wouldn't be enough to run it only on run/debug action before it gets to phone or emulator ?
Have you tried to disable "Build automatically" in Eclipse?
I actually want the project to be built automatically I just don't want the proguard builder to run every time I save it.
You might be able to do this outside the plugin, FYI. The plugin runs because you've got a builder enabled for it (which the plugin installed). There may be a way to script Eclipse so you only turn on the plugin's builder when you hit run/debug, then disable it again. You could do it manually, but it'd be really annoying.
The tricky part:
- Proguard itself isn't advertised as threadsafe, so I can't run multiple copies of proguard.
- There's no way to cancel a proguard run.
Those two items make it annoying to do anything useful in the background. I pretty much have to wait for a proguard run to complete before starting another one. That would mean, worst case, that you start a proguard run, hit cancel and then build again. The second build can't start before the first one finishes, and the first one produces output that has to be thrown away (if it's running during a build, it's looking at unstable class files, so it can't contribute to the cache). So hitting cancel means that you might wait for two proguard runs, one of which is 100% useless.
Definitely open to ideas here.
There's a way, but it's not going to be in v42: use a different jvm for the build.
I asked http://stackoverflow.com/questions/14185860/standard-way-for-eclipse-plugins-to-run-code-in-a-new-jvm and got a pointer to https://github.com/SpringSource/grails-ide/blob/master/org.grails.ide.eclipse.core/src/org/grails/ide/eclipse/commands/GrailsExecutor.java
Any news about the background build ?
No, sorry. And the more I think about it the more I think it's not going to happen until I implement the replacement to proguard that I keep thinking about.
The problem is that once I allow background builds, I have to get much fancier about a bunch of things. I need to cancel proguard builds (not something that proguard normally provides), and I need to throw away builds that get interrupted. That second one means that I need to track down why I'm getting interrupted a lot more often than I think should happen; right now, just turning this on would mean builds never complete.
I think it's a reasonable request, it's just that the amount of work required has meant that it doesn't make it onto my list for a release.