Add common support for writing/running Java-based tools.
Review Request #11585 — Created April 8, 2021 and updated
Some tools require Java to be set up and for
.jarfiles to be made
available. These tend to be more complicated than typical tools. We only
have one in the codebase right now, Checkstyle, which was written to
have its own special configuration key for specifying the
use, but it was a bit hacky and painful to manage.
This change introduces new configuration and a mixin for Java-based
java_classpathsetting in the worker configuration can be set to
a list of
.jarfiles or directories containing
will all be added to the class path when running Java programs.
JavaToolMixinhandles all the Java runtime management for a
tool. Subclasses set the name of the class that will run the program.
The mixin takes care of building a base command line and a class path
(based on the configuration and on the
variable). It also handles dependency checks, making sure that
and the class defined on the tool can both be run.
This will soon be used by
All unit tests passed on Python 2.7 and 3.x.
Used this with the upcoming
Based on my limited knowledge of Java terminology, this should probably be "classpath" without the space.