Fixup BuildGraph to handle mixes of synthetic and BUILD targets.

Review Request #1420 - Created Dec. 3, 2014 and submitted

Information
John Sirois
pants
jsirois/antlr/yak/support_mixed_addresses_better
837
afe207b...
Reviewers
pants-reviews
patricklaw, zundel

An upcoming change will inject synthetic JarLibraries that jvm
tools will depend on. This tickles a corner where the BuildGraph
can be asked to resolve a SyntheticAddress that has been injected.

Tighten up interfaces removing unused methods and prefixing private
helpers with _ to clarify APIs and tighten them.

Modify tests to validate the new translation of SyntheticAddress to
BuildFileAddress when lookups are made and resurrect tests in
BuildGraphTest.

This also fixes some minor fallout in production code and tests.

src/python/pants/backend/jvm/tasks/ide_gen.py | 2 +-
src/python/pants/backend/python/commands/setup_py.py | 6 +-
src/python/pants/base/build_file_address_mapper.py | 25 ++++----
src/python/pants/base/build_file_parser.py | 16 ++---
src/python/pants/base/build_graph.py | 61 +++++++++----------
src/python/pants/goal/context.py | 6 +-
tests/python/pants_test/backend/codegen/targets/BUILD | 6 +-
tests/python/pants_test/backend/codegen/targets/test_java_protobuf_library.py | 29 ++++-----
tests/python/pants_test/backend/codegen/targets/test_java_wire_library.py | 23 ++++----
tests/python/pants_test/backend/jvm/targets/BUILD | 12 +---
tests/python/pants_test/backend/jvm/targets/test_jvm_target.py | 15 +++--
tests/python/pants_test/base/test_build_file_address_mapper.py | 15 ++---
tests/python/pants_test/base_test.py | 6 +-
tests/python/pants_test/graph/BUILD | 5 +-
tests/python/pants_test/graph/test_build_graph.py | 158 ++++++++++++--------------------------------------
15 files changed, 144 insertions(+), 241 deletions(-)

CI went green here: https://travis-ci.org/pantsbuild/pants/builds/42935970

Issues

  • 0
  • 1
  • 0
  • 1
Description From Last Updated
John Sirois
Patrick Lawson
John Sirois
John Sirois
Patrick Lawson
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Eric Ayers

   

Did you mean to remove this test? I think Patrick just added it.

  1. Yes - this was deliberate and part of the offline discussion. My assertion was that per the general move to make the BuildGraph immutable and the fact that allowing a shallow inject to be augmented by a full transitive inject was just plain confusing, it should be disallowed. Patrick concurred and so the capability and it's test were both removed.

Loading...