Add jni_md_header for NetBSD (#381)

The :jni target pulls the machine-dependent jni_md.h out of the JDK per
host, with a java_runtime_files target and a select arm for each
platform.  FreeBSD and OpenBSD are there; add NetBSD, whose JDK ships
include/netbsd/jni_md.h just as the others do, so that Bazel's native
code builds against the right header when it is bootstrapped there.

The config_setting is defined here rather than taken from
@bazel_tools//src/conditions, so that it resolves with every Bazel
version rather than only those carrying bazelbuild/bazel#31069.
@platforms//os:netbsd has been in the platforms module since 0.0.11,
which this module already depends on.

DragonFly BSD needs @platforms//os:dragonfly, which is not in a
platforms release yet (bazelbuild/platforms#143), so it will follow in a
separate change.

Closes #381

COPYBARA_INTEGRATE_REVIEW=https://github.com/bazelbuild/rules_java/pull/381 from zakinko:bsd-jni-headers 0231dcb4b7b00f868f71199d074dd4e3ad198e5f
PiperOrigin-RevId: 983122880
Change-Id: I53649e71b4b50134c91d363cedb2eb2436e8d4e0
1 file changed
tree: f2ba462c46178fd5873a331abf812d28a3e38448
  1. .bazel_checkout/
  2. .bazelci/
  3. .bcr/
  4. .github/
  5. distro/
  6. examples/
  7. java/
  8. test/
  9. third_party/
  10. toolchains/
  11. .bazelignore
  12. .bazelrc
  13. .gitignore
  14. AUTHORS
  15. BUILD
  16. CODEOWNERS
  17. CONTRIBUTING.md
  18. LICENSE
  19. MODULE.bazel
  20. README.md
  21. renovate.json
  22. WORKSPACE
  23. WORKSPACE.bzlmod
README.md

rules_java

Build status

Java Rules for Bazel https://bazel.build.

Documentation

For a quickstart tutorial, see https://bazel.build/start/java

The fastest way to try this in an empty project is to click the green “Use this template” button on https://github.com/bazel-starters/java.

For slightly more advanced usage, like setting up toolchains or writing your own java-like rules, see https://bazel.build/docs/bazel-and-java

Core Java rules

Add a load like:

load("@rules_java//java:java_library.bzl", "java_library")

to your BUILD / BUILD.bazel / *.bzl files

For detailed docs on the core rules, see https://bazel.build/reference/be/java