Transition `IvyImports` to 'compile_classpath'.

Review Request #2840 - Created Sept. 16, 2015 and submitted

Information
John Sirois
pants
jsirois/issues/1841
1841, 2212
2832
1702356...
Reviewers
pants-reviews
gmalmquist, mateor, nhoward_tw, patricklaw, stuhood, zundel
This kills the last user of the 'jar_dependencies' product and, as a
result, the last extra product of `IvyResolve` - all resolve consumers
now use the 'compile_classpath' `ClasspathProducts`.

To support this, the majority of `IvyResolve.execute` is pulled up into
`IvyTaskMixin.resolve` which now handles population of
`ClasspathProducts` from the lower-level `ivy_resolve`.  Much cleanup
in IvyTaskMixin is now tractable, but left for follow up changes.

The `IvyImports` product is hardened into a custom type and consumers
are updated to use this type and remove some prior hacks no longer
needed.

The 'jar_dependencies' product was the only one to use the `Products`
required predicate mechanism, so that mechanism is removed to bring
`ProductMapping` products in-line with data products.  A subsequent
change can now merge these two types of product into one with identical
handling.

 contrib/scrooge/src/python/pants/contrib/scrooge/tasks/thrift_linter.py                      |   6 --
 src/python/pants/backend/android/tasks/BUILD                                                 |   6 +-
 src/python/pants/backend/android/tasks/unpack_libraries.py                                   | 178 +++++++++++++++++++++++--------------------
 src/python/pants/backend/codegen/tasks/BUILD                                                 |   5 +-
 src/python/pants/backend/codegen/tasks/protobuf_gen.py                                       |  28 +++----
 src/python/pants/backend/jvm/ivy_utils.py                                                    |  25 ++-----
 src/python/pants/backend/jvm/targets/BUILD                                                   |   7 +-
 src/python/pants/backend/jvm/targets/import_jars_mixin.py                                    |  17 +++--
 src/python/pants/backend/jvm/tasks/BUILD                                                     |  22 +++++-
 src/python/pants/backend/jvm/tasks/ivy_imports.py                                            |  99 +++++++-----------------
 src/python/pants/backend/jvm/tasks/ivy_resolve.py                                            |  65 ++--------------
 src/python/pants/backend/jvm/tasks/ivy_task_mixin.py                                         | 203 ++++++++++++++++++++++++++------------------------
 src/python/pants/backend/jvm/tasks/jar_import_products.py                                    |  52 +++++++++++++
 src/python/pants/backend/jvm/tasks/jvm_platform_analysis.py                                  |   7 +-
 src/python/pants/backend/jvm/tasks/templates/ivy_resolve/ivy.mustache                        |   2 +-
 src/python/pants/backend/jvm/tasks/unpack_jars.py                                            |  37 +++++----
 src/python/pants/docs/dev_tasks.md                                                           |   7 +-
 src/python/pants/engine/round_manager.py                                                     |   4 +-
 src/python/pants/goal/products.py                                                            |  35 +++------
 tests/python/pants_test/android/BUILD                                                        |   2 +-
 tests/python/pants_test/android/tasks/BUILD                                                  |   5 +-
 tests/python/pants_test/android/tasks/test_unpack_libraries.py                               | 179 +++++++++++++++-----------------------------
 tests/python/pants_test/backend/codegen/targets/test_java_protobuf_library.py                |   3 +-
 tests/python/pants_test/backend/jvm/targets/test_unpacked_jars.py                            |   4 +-
 tests/python/pants_test/backend/jvm/tasks/BUILD                                              |  10 ++-
 tests/python/pants_test/backend/jvm/tasks/jvm_compile/java/test_cache_compile_integration.py |   2 +-
 tests/python/pants_test/backend/jvm/tasks/test_ivy_imports.py                                | 113 ++++++++--------------------
 tests/python/pants_test/backend/jvm/tasks/test_ivy_resolve.py                                |  18 -----
 tests/python/pants_test/backend/jvm/tasks/test_ivy_utils.py                                  |   2 +-
 tests/python/pants_test/backend/jvm/tasks/test_unpack_jars.py                                | 129 +++++++++++++-------------------
 tests/python/pants_test/goal/test_products.py                                                |  38 ++--------
 tests/python/pants_test/tasks/test_protobuf_integration.py                                   |   7 +-
 32 files changed, 550 insertions(+), 767 deletions(-)

My machine is setup for the android tests and this ran green:

$ ./pants test tests/python/pants_test/android/tasks:{unpack_libraries,unpack_libraries_integration}
...
                     tests/python/pants_test/android/tasks/test_unpack_libraries.py ..............
                     tests/python/pants_test/android/tasks/test_unpack_libraries_integration.py .

                     =========== 15 passed in 3.72 seconds ============

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

Stu Hood
Eric Ayers
Mateo Rodriguez
John Sirois
John Sirois
John Sirois
John Sirois
John Sirois
John Sirois
Review request changed

Status: Closed (submitted)

Nick Howard (Twitter)

Thanks folks, submitted at https://github.com/pantsbuild/pants/commit/60bb82dc0ab7675728cb8ab182a0a70c354bdd04

  1. D'oh! Off by one

Loading...