Fix mixed classpaths where internal-only is needed.

Review Request #2964 - Created Oct. 12, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/2358&2359
2358, 2359, 2363
2963
639cc88...
Reviewers
pants-reviews
ity, mateor, nhoward_tw, stuhood, zundel

DetectDuplicates, DxCompile and JarTask all make distinctions in their
processing between internal classpath elements and external ones.
Although DxCompile was handled in 2d515b55, DetectDuplicates and
JarTask were not. This change fixes the latter two and makes the
handling of the former uniform via a new ClasspathUtil helper method
that can return the internal_classpath.

The DuplicateDetectorTest is re-vamped to cover duplicates between
jars, between internal targets and across both types of targets to
exercise the case that triggered
https://github.com/pantsbuild/pants/issues/2358.

The BinaryCreateIntegrationTest.test_deploy_excludes is unmarked fail
as a result of the JarTask fix and now successfully tests the case
that triggered https://github.com/pantsbuild/pants/issues/2359.

In the course of adding ClasspathUtil.internal_classpath,
ClasspathUtil.compute_classpath is removed since it was only called
by ClasspathUtilTest. That test is fixed to exercise the production
codepath used by JvmCompile,
ClasspathUtil.compute_classpath_for_target. The unused
target_closure is also removed from that method as well as from its
call chain through JvmCompile.

src/python/pants/backend/android/tasks/BUILD | 2 -
src/python/pants/backend/android/tasks/dx_compile.py | 11 ++-
src/python/pants/backend/jvm/tasks/BUILD | 7 +-
src/python/pants/backend/jvm/tasks/classpath_products.py | 21 ++++++
src/python/pants/backend/jvm/tasks/classpath_util.py | 72 +++++++++----------
src/python/pants/backend/jvm/tasks/detect_duplicates.py | 53 ++++++++------
src/python/pants/backend/jvm/tasks/jar_create.py | 2 +-
src/python/pants/backend/jvm/tasks/jar_task.py | 58 +++++++--------
src/python/pants/backend/jvm/tasks/jvm_compile/BUILD | 5 +-
src/python/pants/backend/jvm/tasks/jvm_compile/jvm_compile.py | 24 +++----
src/python/pants/backend/jvm/tasks/jvm_dependency_analyzer.py | 4 +-
src/python/pants/backend/jvm/tasks/jvm_task.py | 3 +-
tests/python/pants_test/backend/jvm/tasks/BUILD | 8 +--
tests/python/pants_test/backend/jvm/tasks/test_binary_create_integration.py | 5 --
tests/python/pants_test/backend/jvm/tasks/test_classpath_products.py | 20 ++++++
tests/python/pants_test/backend/jvm/tasks/test_classpath_util.py | 24 +++++--
tests/python/pants_test/backend/jvm/tasks/test_jvm_run.py | 5 +-
tests/python/pants_test/jvm/BUILD | 10 +--
tests/python/pants_test/jvm/{jvm_task_test_mixin.py => jvm_task_test_base.py} | 14 ++--
tests/python/pants_test/jvm/jvm_tool_task_test_base.py | 5 +-
tests/python/pants_test/tasks/BUILD | 10 +--
tests/python/pants_test/tasks/test_detect_duplicates.py | 194 ++++++++++++++++++++++++++++++++++++--------------
tests/python/pants_test/tasks/test_jvm_task.py | 5 +-
tests/python/pants_test/tasks/test_jvmdoc_gen.py | 5 +-
24 files changed, 342 insertions(+), 225 deletions(-)

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

Issues

  • 0
  • 0
  • 2
  • 2
Description From Last Updated
John Sirois
John Sirois
John Sirois
John Sirois
Eric Ayers
Stu Hood
Mateo Rodriguez
John Sirois
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Loading...