-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java_library
should allow java_toolchain
to be specified per-target
#8735
Comments
java_library
should allow java_toolchain
to be specifiedjava_library
should allow java_toolchain
to be specified per-target
@shs96c Thanks for the report! We are currently migrating the Java rules to platforms & toolchains (#6521). There are plans to enable out of the box support for building different targets with different toolchains in the same build (see #6519 and Configurability 2019 Roadmap - flagless multiplatform builds). There is another way to accomplish this by implementing a configuration transition manually. See more at User-defined Transitions. I'll close this as duplicate of #6519. Let me know if there is anything I can help with at the moment. |
@iirina, with respect to
|
Were those plans canceled? That item is listed in the 2019 roadmap as not started and not listed in the 2020 roadmap. |
6519 |
Description of the problem / feature request:
When compiling a complex codebase, it is sometimes useful to have multiple java toolchains in play at the same time. Take, for example, the case where you're building a multi-release jar, and so want most classes to target Java 8. However, you also want to offer features to Java 11 developers. The simplest way to do this would be something like:
Feature requests: what underlying problem are you trying to solve with this feature?
The ability to cleanly mix different versions of Java without accidentally depending on classes from later releases in code targeting earlier releases.
What's the output of
bazel info release
?release 0.26.1
Have you found anything relevant by searching the web?
It may be possible to emulate much of the desired behaviour using the
javacopts
parameter ofjava_library
, but that's a gross and ugly hack, and we should not stand for it.Buck had a (poorly documented, hard to find) feature where it could set the bootclasspath depending on the selected target version of the java library being compiled. You can see a reference to it here
The text was updated successfully, but these errors were encountered: