Let's say I have a library such as:

scala_library(
    name = "my_favorite_scala_library",
    srcs = glob(["*.scala"]),
    exports = [
        "A",
        "B",
    ],
    deps = [
        "A",
        "B",
        "C",
        "D",
    ],
)

bazel build //path/to/my/library:my_favorite_scala_library builds a "skinny" JAR as expected and doesn't package in any dependencies or exports.

Building a _deploy.jar will package in all transitive dependencies.

Is there a simple way to have some middle ground where I can build a JAR that will package in only the main source AND any exports, either using the exports functionality or some other Bazel functionality that I may be overlooking? I'm open to both some custom invocation of a bazel build command or some field/functionality on the rule definitions that I may not be aware of.

0

There are 0 best solutions below