Add JNI wrappers. (#556)
diff --git a/BUILD b/BUILD
index 1355c1b..d25a5db 100644
--- a/BUILD
+++ b/BUILD
@@ -43,7 +43,10 @@
cc_library(
name = "jni_inc",
- hdrs = [":jni/jni.h", ":jni/jni_md.h"],
+ hdrs = [
+ ":jni/jni.h",
+ ":jni/jni_md.h",
+ ],
includes = ["jni"],
)
@@ -141,6 +144,64 @@
],
)
+########################################################
+# WARNING: do not (transitively) depend on this target!
+########################################################
+cc_library(
+ name = "jni",
+ srcs = [
+ ":common_sources",
+ ":dec_sources",
+ ":enc_sources",
+ "//java/org/brotli/wrapper/common:jni_src",
+ "//java/org/brotli/wrapper/dec:jni_src",
+ "//java/org/brotli/wrapper/enc:jni_src",
+ ],
+ hdrs = [
+ ":common_headers",
+ ":dec_headers",
+ ":enc_headers",
+ ],
+ deps = [
+ ":brotli_inc",
+ ":jni_inc",
+ ],
+ alwayslink = 1,
+)
+
+########################################################
+# WARNING: do not (transitively) depend on this target!
+########################################################
+cc_library(
+ name = "jni_no_dictionary_data",
+ srcs = [
+ ":common_sources",
+ ":dec_sources",
+ ":enc_sources",
+ "//java/org/brotli/wrapper/common:jni_src",
+ "//java/org/brotli/wrapper/dec:jni_src",
+ "//java/org/brotli/wrapper/enc:jni_src",
+ ],
+ hdrs = [
+ ":common_headers",
+ ":dec_headers",
+ ":enc_headers",
+ ],
+ defines = [
+ "BROTLI_EXTERNAL_DICTIONARY_DATA=",
+ ],
+ deps = [
+ ":brotli_inc",
+ ":jni_inc",
+ ],
+ alwayslink = 1,
+)
+
+filegroup(
+ name = "dictionary",
+ srcs = ["c/common/dictionary.bin"],
+)
+
load("@io_bazel_rules_go//go:def.bzl", "go_prefix")
go_prefix("github.com/google/brotli")