Requiring explicit dependency on the DistributionLocator subsystem.

Review Request #2707 - Created Aug. 26, 2015 and submitted

Garrett Malmquist
benjyw, jsirois, stuhood, zundel

This includes adding DistributionLocator as subsystem dependency of
IvySubsystem, and requiring a distribution input to execute_java in

The latter change is obviously the more distruptive, and due to how
the default parameters work, it is difficult to see that
distribution is necessary when trying to use that function, unless
you read the pydocs carefully.

To alleviate this, I've added an execute_java method to
Distribution, which just calls util.execute_java, passing itself
as the distribution.

This way, instead of importing, you just import
DistributionLocator, and use something like:


Which is more verbose, but requires one less import and makes it
obvious that you need a subsystem dependency on

It makes sense to me that the Distribution should be able to invoke
its own java binary, and the actual meat-and-potatoes code is still
in, so I don't think this pollutes the primarily
information-holder functionality of Distribution too much. But I am
open to changing it if people find it offensive.

Regardless, this change also has the nice side-effect of making it
much more explicit that you're using an arbitrary cached version of
the jvm whenever you run java, which should make it easier and more
maintainable to use more constrained versions if necessary.

Added unit tests to pants_test/java/

CI went green here:


  • 0
  • 1
  • 0
  • 1
Description From Last Updated
Benjy Weinberger
Eric Ayers
John Sirois
Garrett Malmquist
John Sirois
John Sirois
Garrett Malmquist
Garrett Malmquist
Review request changed

Status: Closed (submitted)

Change Summary:

In commit d3987fc2b51646638f06722c6c138674e014aa76

Eric Ayers
Ship It!