Fix `buildgen.go --materialize` to act globally.

Review Request #2977 - Created Oct. 16, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/2371/materialize_global_regen
2371, 2372, 2381
2974
0829bb8...
Reviewers
pants-reviews
kwlzn, mateor, stuhood
Previously, when materilizing Go BUILD files, buildgen could err in two
ways:
1. Obsolete BUILD files were left behind.
2. If not all Go targets in the repo were included in the command line
   remote libs with multiple packages might be trimmed to include too
   few packages to support all the Go targets in the repo.

This change adds culling of unused local Go target BUILD files to
partially solve 1 and it forces a global scan of Go source roots when in
`--materialize` mode to solve 2.

Tests are updated to exercise the new global scanning in `--materialize`
mode and local unused BUILD culling.

 contrib/go/src/python/pants/contrib/go/tasks/BUILD                      |   1 +
 contrib/go/src/python/pants/contrib/go/tasks/go_buildgen.py             | 126 +++++++++++++++++++++++++++++++++++++++++---------
 contrib/go/tests/python/pants_test/contrib/go/tasks/test_go_buildgen.py |  90 +++++++++++++++++++++++-------------
 3 files changed, 164 insertions(+), 53 deletions(-)
CI went green here:
  https://travis-ci.org/pantsbuild/pants/builds/85684129

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
John Sirois
Stu Hood
John Sirois
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...