examples icon indicating copy to clipboard operation
examples copied to clipboard

Add examples for using zipper/singlejar on rules that output unpredictable files

Open davidsantiago opened this issue 6 years ago • 2 comments

Sometimes builds need to incorporate programs that output unpredictable files in order to create artifacts. For example, a multi-language code generator. If those artifacts need to be collected into a single archive, like a zip or jar, then it's not at all clear how to proceed. Bazel has two tools, zipper and singlejar, that can be used to create zip and jar archives. But the zipper tool requires every file explicitly enumerated, so it can't be used on a group of rule outputs that are unknown in number and name. And singlejar could presumably be used, but it's not clear how to operate it, because java_toolchains don't participate in toolchain resolution and there are multiple platform-specific versions of singlejar, so it's not clear how to get it working.

Examples of using both of these would be welcome.

davidsantiago avatar Aug 02 '19 05:08 davidsantiago

Please add this documentation. I have spent half a day struggling to use Bazel to run JOOQ to generate Java sources and then use them as a java_library.

mleonhard avatar Jan 31 '20 09:01 mleonhard

It is probably better for the example to be of a tree artifact.

aiuto avatar Apr 20 '22 02:04 aiuto