further simplify Java build

PiperOrigin-RevId: 598790414
This commit is contained in:
Evgenii Kliuchnikov 2024-01-16 03:36:27 -08:00 committed by Copybara-Service
parent 3396c67fea
commit 02458f3443
2 changed files with 11 additions and 35 deletions

View File

@ -2,36 +2,6 @@ package(
default_visibility = ["//visibility:public"], default_visibility = ["//visibility:public"],
) )
config_setting(
name = "darwin",
values = {"cpu": "darwin"},
visibility = ["//visibility:public"],
)
config_setting(
name = "darwin_x86_64",
values = {"cpu": "darwin_x86_64"},
visibility = ["//visibility:public"],
)
config_setting(
name = "windows",
values = {"cpu": "x64_windows"},
visibility = ["//visibility:public"],
)
config_setting(
name = "windows_msvc",
values = {"cpu": "x64_windows_msvc"},
visibility = ["//visibility:public"],
)
config_setting(
name = "windows_msys",
values = {"cpu": "x64_windows_msys"},
visibility = ["//visibility:public"],
)
# >>> JNI headers # >>> JNI headers
genrule( genrule(
@ -44,11 +14,8 @@ genrule(
genrule( genrule(
name = "copy_link_jni_md_header", name = "copy_link_jni_md_header",
srcs = select({ srcs = select({
":darwin": ["@openjdk_macosx_jni_md_h//file"], "@platforms//os:macos": ["@openjdk_macosx_jni_md_h//file"],
":darwin_x86_64": ["@openjdk_macosx_jni_md_h//file"], "@platforms//os:windows": ["@openjdk_windows_jni_md_h//file"],
":windows_msys": ["@openjdk_windows_jni_md_h//file"],
":windows_msvc": ["@openjdk_windows_jni_md_h//file"],
":windows": ["@openjdk_windows_jni_md_h//file"],
"//conditions:default": ["@openjdk_solaris_jni_md_h//file"], "//conditions:default": ["@openjdk_solaris_jni_md_h//file"],
}), }),
outs = ["jni/jni_md.h"], outs = ["jni/jni_md.h"],

View File

@ -27,6 +27,15 @@ maven_install(
], ],
) )
http_archive(
name = "platforms",
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
"https://github.com/bazelbuild/platforms/releases/download/0.0.8/platforms-0.0.8.tar.gz",
],
sha256 = "8150406605389ececb6da07cbcb509d5637a3ab9a24bc69b1101531367d89d74",
)
http_file( http_file(
name = "openjdk_jni_h", name = "openjdk_jni_h",
downloaded_file_path = "jni.h", downloaded_file_path = "jni.h",