bazel-eclipse icon indicating copy to clipboard operation
bazel-eclipse copied to clipboard

Support package level JDK configuration for Build Path

Open plaird opened this issue 5 years ago • 1 comments

In parent work item #88 we added support for setting the JDK set as default for every imported Bazel package using the workspace global .bazelrc setting:

build --javacopt=-source 11 -target 11

In this work item, we would like every BUILD file to be able to override that (using javacopts attribute on a java rule). Ideally, every Java rule in a BUILD file could have a different JDK, but Eclipse/JDT does not allow that.

plaird avatar Mar 31 '20 07:03 plaird

It would be nice to use annotations #177 for this. While we could do hard stuff and try an infer the best JDK to use for a package by considering all javacopt attributes, I think we should always give the user the ability to put this in an annotation. Of course, once the package is imported, the user will always be able to change the JDK in the Build Path UI that is standard for all JDT projects.

plaird avatar Oct 09 '20 05:10 plaird