aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kiril Gorovoy <kgorovoy@google.com>2016-03-10 14:06:08 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-03-10 14:42:00 -0800
commit5b5976a3854776eb41494bd4b194a096ef3b28d0 (patch)
treed9ec85dfa05b7ded3cdb6ec0b6307ba8dbc99977
parent6d05cdb80b089ccbf05151101eb4943ffbbb529d (diff)
Move all gRPC deps from WORKSPACE to workspace.bzl.
Change: 116906391
-rw-r--r--WORKSPACE32
-rw-r--r--tensorflow/workspace.bzl38
2 files changed, 37 insertions, 33 deletions
diff --git a/WORKSPACE b/WORKSPACE
index 26bfa1f15f..003b6475f2 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -12,40 +12,10 @@
# path="<PATH_TO_NDK>",
# api_level=21)
+# Please add all new TensorFlow dependencies in workspace.bzl.
load("//tensorflow:workspace.bzl", "tf_workspace")
tf_workspace()
-# grpc expects //external:protobuf_clib and //external:protobuf_compiler
-# to point to the protobuf's compiler library.
-bind(
- name = "protobuf_clib",
- actual = "//google/protobuf:protoc_lib",
-)
-
-bind(
- name = "protobuf_compiler",
- actual = "//google/protobuf:protoc_lib",
-)
-
-git_repository(
- name = "grpc",
- commit = "73979f4",
- init_submodules = True,
- remote = "https://github.com/grpc/grpc.git",
-)
-
-# protobuf expects //external:grpc_cpp_plugin to point to grpc's
-# C++ plugin code generator.
-bind(
- name = "grpc_cpp_plugin",
- actual = "@grpc//:grpc_cpp_plugin",
-)
-
-bind(
- name = "grpc_lib",
- actual = "@grpc//:grpc++_unsecure",
-)
-
# TENSORBOARD_BOWER_AUTOGENERATED_BELOW_THIS_LINE_DO_NOT_EDIT
new_git_repository(
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
index 953cedf2c5..f0d0702a48 100644
--- a/tensorflow/workspace.bzl
+++ b/tensorflow/workspace.bzl
@@ -1,6 +1,9 @@
-# Tensorflow external dependencies that can be loaded in WORKSPACE files.
+# TensorFlow external dependencies that can be loaded in WORKSPACE files.
-def tf_workspace(path_prefix = ""):
+# If TensorFlow is linked as a submodule, path_prefix is TensorFlow's directory
+# within the workspace (e.g. "tensorflow/"), and tf_repo_name is the name of the
+# local_repository rule (e.g. "@tf").
+def tf_workspace(path_prefix = "", tf_repo_name = ""):
native.new_http_archive(
name = "gmock_archive",
url = "https://googlemock.googlecode.com/files/gmock-1.7.0.zip",
@@ -56,3 +59,34 @@ def tf_workspace(path_prefix = ""):
name = "six",
actual = "@six_archive//:six",
)
+
+ # grpc expects //external:protobuf_clib and //external:protobuf_compiler
+ # to point to the protobuf's compiler library.
+ native.bind(
+ name = "protobuf_clib",
+ actual = tf_repo_name + "//google/protobuf:protoc_lib",
+ )
+
+ native.bind(
+ name = "protobuf_compiler",
+ actual = tf_repo_name + "//google/protobuf:protoc_lib",
+ )
+
+ native.git_repository(
+ name = "grpc",
+ commit = "73979f4",
+ init_submodules = True,
+ remote = "https://github.com/grpc/grpc.git",
+ )
+
+ # protobuf expects //external:grpc_cpp_plugin to point to grpc's
+ # C++ plugin code generator.
+ native.bind(
+ name = "grpc_cpp_plugin",
+ actual = "@grpc//:grpc_cpp_plugin",
+ )
+
+ native.bind(
+ name = "grpc_lib",
+ actual = "@grpc//:grpc++_unsecure",
+ )