Skip to content

Commit

Permalink
Clean up BUILD file duplication in java/.../tasks/.../jni directory
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 598994968
  • Loading branch information
schmidt-sebastian authored and copybara-github committed Jan 17, 2024
1 parent 7210324 commit c803726
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 75 deletions.
31 changes: 28 additions & 3 deletions mediapipe/tasks/java/com/google/mediapipe/tasks/core/jni/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,24 @@ cc_library_with_tflite(
],
hdrs = [
"model_resources_cache_jni.h",
],
] + select({
"//conditions:default": [
":jni.h",
":jni_md.h",
],
# The Android toolchain makes "jni.h" available in the include path.
# For non-Android toolchains, generate jni.h and jni_md.h.
"//mediapipe:android": [],
}),
tflite_deps = [
"//mediapipe/tasks/cc/core:model_resources_cache",
"@org_tensorflow//tensorflow/lite/kernels:builtin_ops",
],
deps = [
"//mediapipe/java/com/google/mediapipe/framework/jni:mediapipe_framework_jni",
"//mediapipe/tasks/cc/core:mediapipe_builtin_op_resolver",
] + select({
"//conditions:default": ["//third_party/java/jdk:jni"],
"//conditions:default": [
],
"//mediapipe:android": [],
}),
alwayslink = 1,
Expand Down Expand Up @@ -67,3 +75,20 @@ cc_binary(
linkshared = 1,
deps = [":llm"],
)

genrule(
name = "copy_jni_h",
srcs = ["@bazel_tools//tools/jdk:jni_header"],
outs = ["jni.h"],
cmd = "cp -f $< $@",
)

genrule(
name = "copy_jni_md_h",
srcs = select({
"//mediapipe:macos": ["@bazel_tools//tools/jdk:jni_md_header-darwin"],
"//conditions:default": ["@bazel_tools//tools/jdk:jni_md_header-linux"],
}),
outs = ["jni_md.h"],
cmd = "cp -f $< $@",
)

This file was deleted.

0 comments on commit c803726

Please sign in to comment.