Skip to content

Commit

Permalink
Wiring existing targets under tensorflow/core/lib/io into tensorflow/…
Browse files Browse the repository at this point in the history
…core/BUILD.

This change also swaps existing tensorflow/core/lib/io targets to use tf/core/platform's string libraries instead.

PiperOrigin-RevId: 275555667
Change-Id: I66ea922401b487623888a8a3e80011f5dcd06234
  • Loading branch information
bmzhao authored and tensorflower-gardener committed Oct 18, 2019
1 parent f9ccd02 commit 4737472
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 17 deletions.
8 changes: 7 additions & 1 deletion tensorflow/core/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2238,7 +2238,7 @@ cc_library(
"//tensorflow/core/platform:legacy_monitoring_srcs",
"//tensorflow/core/platform:legacy_platform_lib_srcs",
"//tensorflow/core/platform:legacy_lib_internal_srcs",
"//tensorflow/core/lib/io:legacy_lib_io_all_srcs",
"//tensorflow/core/lib/io:legacy_lib_internal_impl_srcs",
"//tensorflow/core/lib/random:legacy_lib_random_all_srcs",
"//tensorflow/core/lib/strings:legacy_lib_strings_all_srcs",
],
Expand Down Expand Up @@ -2282,6 +2282,12 @@ cc_library(
"//tensorflow/core/lib/gtl:top_n",
"//tensorflow/core/lib/hash:crc32c",
"//tensorflow/core/lib/hash:hash",
"//tensorflow/core/lib/io:compression",
"//tensorflow/core/lib/io:inputstream_interface",
"//tensorflow/core/lib/io:iterator",
"//tensorflow/core/lib/io:path",
"//tensorflow/core/lib/io:proto_encode_helper",
"//tensorflow/core/lib/io:table_options",
"//tensorflow/core/lib/math:math_util",
"//tensorflow/core/platform:abi",
"//tensorflow/core/platform:annotation",
Expand Down
45 changes: 34 additions & 11 deletions tensorflow/core/lib/io/BUILD
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
package(
default_visibility = [
"//tensorflow/core/lib/core:__pkg__",
"//tensorflow/core/lib/gtl:__pkg__",
"//tensorflow/core/lib/hash:__pkg__",
"//tensorflow/core/lib/io:__pkg__",
"//tensorflow/core/lib/random:__pkg__",
"//tensorflow/core/lib/strings:__pkg__",
# tensorflow/core:lib effectively exposes all targets under tensorflow/core/lib/**
"//tensorflow/core:__pkg__",
# tensorflow/core/platform:env uses :path
"//tensorflow/core/platform:__pkg__",
],
licenses = ["notice"], # Apache 2.0
Expand All @@ -17,6 +14,9 @@ package(
# snappy/snappy_outputbuffer, table, table_builder, two_level_iterator,
# zlib_inputstream, zlib_outputbuffer, zlib_compression_options, and all tests.

# Note(bmzhao): After tensorflow/core/platform:env is fully integrated into
# tensorflow/core/BUILD, we can finish adding the rest of the targets in this package.

cc_library(
name = "compression",
srcs = ["compression.cc"],
Expand All @@ -41,7 +41,7 @@ cc_library(
hdrs = ["iterator.h"],
deps = [
"//tensorflow/core/lib/core:status",
"//tensorflow/core/lib/core:stringpiece",
"//tensorflow/core/platform:stringpiece",
],
)

Expand All @@ -50,11 +50,11 @@ cc_library(
srcs = ["path.cc"],
hdrs = ["path.h"],
deps = [
"//tensorflow/core/lib/core:stringpiece",
"//tensorflow/core/lib/strings:scanner",
"//tensorflow/core/lib/strings:string_utils",
"//tensorflow/core/platform:logging",
"//tensorflow/core/platform:mutex",
"//tensorflow/core/platform:scanner",
"//tensorflow/core/platform:strcat",
"//tensorflow/core/platform:stringpiece",
"//tensorflow/core/platform:types",
],
)
Expand All @@ -64,8 +64,8 @@ cc_library(
hdrs = ["proto_encode_helper.h"],
deps = [
"//tensorflow/core/lib/core:coding",
"//tensorflow/core/lib/core:stringpiece",
"//tensorflow/core/platform:protobuf",
"//tensorflow/core/platform:stringpiece",
],
)

Expand Down Expand Up @@ -130,6 +130,29 @@ filegroup(
visibility = ["//tensorflow/core:__pkg__"],
)

filegroup(
name = "legacy_lib_internal_impl_srcs",
srcs = [
"block.cc",
"block_builder.cc",
"buffered_inputstream.cc",
"format.cc",
"inputbuffer.cc",
"random_inputstream.cc",
"record_reader.cc",
"record_writer.cc",
"snappy/snappy_inputbuffer.cc",
"snappy/snappy_outputbuffer.cc",
"table.cc",
"table_builder.cc",
"two_level_iterator.cc",
"zlib_compression_options.cc",
"zlib_inputstream.cc",
"zlib_outputbuffer.cc",
],
visibility = ["//tensorflow/core:__pkg__"],
)

filegroup(
name = "legacy_lib_io_all_tests",
srcs = [
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/lib/io/iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ limitations under the License.
#define TENSORFLOW_LIB_IO_ITERATOR_H_

#include "tensorflow/core/lib/core/status.h"
#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/platform/stringpiece.h"

namespace tensorflow {
namespace table {
Expand Down
4 changes: 2 additions & 2 deletions tensorflow/core/lib/io/path.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ limitations under the License.

#include <vector>

#include "tensorflow/core/lib/strings/scanner.h"
#include "tensorflow/core/lib/strings/strcat.h"
#include "tensorflow/core/platform/logging.h"
#include "tensorflow/core/platform/mutex.h"
#include "tensorflow/core/platform/scanner.h"
#include "tensorflow/core/platform/strcat.h"

namespace tensorflow {
namespace io {
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/lib/io/path.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ limitations under the License.
#ifndef TENSORFLOW_CORE_LIB_IO_PATH_H_
#define TENSORFLOW_CORE_LIB_IO_PATH_H_

#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/platform/stringpiece.h"
#include "tensorflow/core/platform/types.h"

namespace tensorflow {
Expand Down
2 changes: 1 addition & 1 deletion tensorflow/core/lib/io/proto_encode_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ limitations under the License.
#define TENSORFLOW_CORE_LIB_IO_PROTO_ENCODE_HELPER_H_

#include "tensorflow/core/lib/core/coding.h"
#include "tensorflow/core/lib/core/stringpiece.h"
#include "tensorflow/core/platform/protobuf.h"
#include "tensorflow/core/platform/stringpiece.h"

// A helper class for appending various kinds of values in protocol
// buffer encoding format to a buffer. The client gives a pointer to
Expand Down

0 comments on commit 4737472

Please sign in to comment.