A new implementation of SourceRoots.
Review Request #2970 — Created Oct. 14, 2015 and submitted — Latest diff uploaded
|jsirois, nhoward_tw, stuhood, zundel|
Takes source root information from options, instead of from
bootstrap BUILD files. Does pattern-matching, with sensible
defaults, so that in the typical case the right thing
"just happens" with no config necessary. For example, this
can support maven layouts out of the box.
Distinguishes between source and test roots, because that will
probably matter in the future, and we don't want to make people
change their source root decls when that happens.
Gets rid of validation that source roots contain only the "right"
types of targets. This was rather ad-hoc, and properly belongs
with any other per-repo validation rules.
Instead, introduces the concept of a 'language' (currently just
a string like 'java' or 'resources'), that source roots may be
associated with. What we do with that in the future is open.
Makes a single task (ListRoots) use the new mechanism, just to
make sure the plumbing works. This meant adding the SourceRoots
access to the Context, which required jiggering a couple of other
tests that created their context in non-standard ways.
A future change will switch all internal uses over to the new system,
and deprecate the old one.
CI passes: https://travis-ci.org/pantsbuild/pants/builds/85413405
Manually verified that
./pants rootsreturns the right thing in the pantsbuild repo.
CI still passes after addressing code review comments: https://travis-ci.org/pantsbuild/pants/builds/85625440