Resurrect thin intellij project changes

Review Request #818 — Created Aug. 1, 2014 and discarded

johanoskarsson, jsirois, patricklaw, stuhood, travis, zundel
Travis made this change a while ago -

It got lost in the big refactor. Resurrecting it again.

From a previous email (from Travis), for context:

Hey all -

Today I experimented with creating a "thin" IntelliJ project file. Indexing goes from 4min --> 2m40s, or ~33% faster.

The general strategy is rather than having one content root set to buildroot, we have a content root per target. This restricts the files IntelliJ looks at to just the stuff actually used by the target you generated a project for. My "sketch" is and if we like this approach I can clean things up.

To summarize, with minimal effort we can:

* Reduce project indexing time by ~33% (4m --> 2m40s) by limiting the stuff intellij looks at.

Local CI passes. 
Travis ->
Generated idea project:
$PANTS_DEV=1 ./pants goal idea src/scala::

testing this on internal Twitter projects to ascertain indexing time improvements.
  1. Should this be triggered by a flag? As much as people complain about indexing, I'm guessing at least a few of them depend on being able to find everything importable.
    1. I would also like to see it triggered by a flag, at least until we conclude this is superior or we can switch between different project generation strategies.
      Soon I would like to be able to configure different language settings for the different targets, which will require making separate IntelliJ modules for each target.  This may have much the same effect as this change on the indexing time improvements, I'm not sure.  If we landed this under a flag, then we would be able to easily compare the different approaches and inform how the IntelliJ plugin should end up working.
  1. Seems like there might be some source missing?  Will the existing pants goal idea invoke this template multiple times?
  2. just so I understand, we don't need these any more because the package prefix is no longer starting from the root of the repo so it won't accidentally suck in .pants.d.  However One beneficial thing about including .pants.d is that you get the generated source indexed.  Do you still get that with this refactor?
    1. I patched this in and:
      1) the mustache library must be doing the looping I was looking for, so that is not an issue  
      2) I saw gen-java mapped in and was able to navigate to source, so that is not an issue either
  1. I ran this change against our repo and the way the projects are displayed in the project pane is a bit confusing, the same name is repeated over and over, once for each java/src, test/src, resources/src, protobuf/src.  (we have a maven layout) That seems extremely weird.
  1. Can this be discarded?

Review request changed

Status: Discarded