Can I initiate Intellij IDEA indexing as the last step of a nightly build?
During our nightly builds, we pull down the latest committed checkins from a multi-site source control repository and merge our local source changes on top and compile/build. This leaves us with modified dates and content on many f开发者_JAVA百科iles. When I arrive the next morning and click in my Intellij IDEA window, IDEA rebuilds the index over the source files. With Intellij IDEA 10, this happens in the background and the speed is supposed to be much better. While waiting, I can do many (but not all) operations on the source.
Doing the indexing in the background is great, but can I run a command to make Intellij IDEA reindex the file, as the last step of my nightly build? That way, the reindexing is complete and ready before I get to the office.
I suppose killing and restarting IDEA would work, but seems a bit harsh, and I'd want to be certain no edits were unsaved at the time. FYI, running on Debian Linux.
Thanks, Alan
Actually IDEA should detect external changes automatically via fsnotifier and perform indexing of the modified files. If it doesn't happen you can use File | Synchronize. There is also Settings | General | Synchronize files on frame activation, minimizing and restoring IDEA window should force files synchronization when this option is enabled.
External tool which will find IDEA window, minimize it and restore it will force synchronization, run it as your last build step.
You can also write a simple IDEA plug-in which will listen on some TCP port and invoke Synchronize action. Then make a tool which connects to this port and sends some command to force synchronization outside of IDEA. Run this tool as the last build step.
With such plug-in you will have more control over IDEA and it would be possible to invoke other actions if necessary, like restart IDEA, open project, etc.
精彩评论