pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.29k stars 631 forks source link

scala/java: consolidate compilation of wrapper binaries #13879

Open tdyas opened 2 years ago

tdyas commented 2 years ago

The Scala backend currently has multiple examples of rules that use wrapper programs written in Scala or Java to accomplish build-related tasks. For example, (1) the Scala protobuf codegen rules use a Scala shim binary to invoke the ScalaPB compiler; and (2) dependency inference for both Java and Scala use programs written in those languages, respectively, to parse source code to extract symbols.

We should refactor the rules that build those programs to use a set of common rules as makes sense.

tdyas commented 2 years ago

Idea: Have the engine provide targets (via scala_sources, java_sources, and whatever jar-producing target type is needed) that can be built using the regular compilation rules in the Scala and Java backends.