diff options
author | Asim Shankar <ashankar@google.com> | 2017-01-23 17:54:29 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2017-01-23 18:07:05 -0800 |
commit | cd4a96499b5f83d82f2612f8e5aa99726cf15edb (patch) | |
tree | 8c0dab578cbb27bcff79bc4497e243df18415bee /tensorflow/java/BUILD | |
parent | 9b7c47c1d48dfbe69e2ab62aae6146823ba7e664 (diff) |
Java: Provide the Java API in the Android inference library.
A couple of things here:
(1) Avoid use of "try-with-resources" blocks in the Java API implementation,
as older versions of Android (minSdkVersion < 19) do not support this.
While we remove the use of such blocks in the implementation, the
documentation and examples still advocate the use of try-with-resources,
which should be used when possible (JDK 7, Android API >= 19)
(2) Include the Java sources in the Android Inference Library.
This allows a .aar file to be built that contains both the
TensorFlowInferenceInterface and the full Java API.
Making transition from one to the other easier.
Another step in the journey that is #5
Change: 145361038
Diffstat (limited to 'tensorflow/java/BUILD')
-rw-r--r-- | tensorflow/java/BUILD | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tensorflow/java/BUILD b/tensorflow/java/BUILD index aad853b88b..af3d2aec09 100644 --- a/tensorflow/java/BUILD +++ b/tensorflow/java/BUILD @@ -7,11 +7,22 @@ licenses(["notice"]) # Apache 2.0 java_library( name = "tensorflow", - srcs = glob(["src/main/java/org/tensorflow/*.java"]), + srcs = [":java_sources"], data = [":libtensorflow_jni"], visibility = ["//visibility:public"], ) +# NOTE(ashankar): Rule to include the Java API in the Android Inference Library +# .aar. At some point, might make sense for a .aar rule here instead. +filegroup( + name = "java_sources", + srcs = glob(["src/main/java/org/tensorflow/*.java"]), + visibility = [ + "//tensorflow/contrib/android:__pkg__", + "//tensorflow/java:__pkg__", + ], +) + java_library( name = "testutil", testonly = 1, |