rules_java icon indicating copy to clipboard operation
rules_java copied to clipboard

Allow custom stub template for java_binary

Open hhclam opened this issue 9 years ago • 9 comments

Description of the feature request:

We would like to use our own java stub template to replace java_stub_template.txt. Our use case uses a lot of custom system properties that can be generated from rule dependencies. However Bazel's java stub template is fixed. It would be nice to allow custom java rule template through something like java_toolchain

hhclam avatar Jul 26 '17 04:07 hhclam

@cushon, any thoughts on this feature request seeing as how the python rules are exploring this via https://github.com/bazelbuild/rules_python/pull/130

petroseskinder avatar Nov 14 '18 14:11 petroseskinder

+1 On Wed, 14 Nov 2018 at 16:24 Petros Eskinder [email protected] wrote:

@cushon https://github.com/cushon, any thoughts on this feature request seeing as how the python rules are exploring this via bazelbuild/rules_python#130 https://github.com/bazelbuild/rules_python/pull/130

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/bazelbuild/rules_java/issues/329, or mute the thread https://github.com/notifications/unsubscribe-auth/ABUIF5p6eUtj07giJy1LpKIcZlyu4C9Vks5uvCeDgaJpZM4Oja1c .

ittaiz avatar Nov 14 '18 16:11 ittaiz

This would also make it easier to iterate on the stub script, since currently you have to re-build Bazel to pick up changes.

@lberki we talked about something like this once, and you noted it "would require making the set of %{} template variables and the template language itself part of the interface of Bazel."

cushon avatar Nov 14 '18 19:11 cushon

Hi there! We're doing a clean up of old issues and will be closing this one. Please reopen (or ping me to reopen) if you’d like to discuss anything further. We’ll respond as soon as we have the bandwidth/resources to do so.

sgowroji avatar Feb 17 '23 06:02 sgowroji

Note- lack of this feature means forking bazel or "only" the Java rules

ittaiz avatar Feb 17 '23 10:02 ittaiz

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

github-actions[bot] avatar Apr 23 '24 01:04 github-actions[bot]

Still very relevant. Please don't close.

ittaiz avatar Apr 23 '24 19:04 ittaiz

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

github-actions[bot] avatar Jun 28 '25 01:06 github-actions[bot]

The template now lives in rules_java, where it is substantially simpler to patch or replace.

fmeum avatar Jun 28 '25 07:06 fmeum