A new implementation of SourceRoots.

Review Request #2970 - Created Oct. 14, 2015 and submitted

Information
Benjy Weinberger
pants
2c89008...
Reviewers
pants-reviews
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 roots returns the right thing in the pantsbuild repo.

CI still passes after addressing code review comments: https://travis-ci.org/pantsbuild/pants/builds/85625440

Issues

  • 0
  • 4
  • 0
  • 4
Description From Last Updated
Benjy Weinberger
Benjy Weinberger
Stu Hood
Benjy Weinberger
Patrick Lawson
Eric Ayers
Benjy Weinberger
Benjy Weinberger
Stu Hood
Eric Ayers
Benjy Weinberger
Benjy Weinberger
Benjy Weinberger
Review request changed

Status: Closed (submitted)

Change Summary:

c7cb8d547af707a6f35fc0c4cc6a5f70986f57ac

Loading...