aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kiril Gorovoy <kgorovoy@google.com>2016-02-24 18:02:16 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-02-25 09:02:17 -0800
commit77da168dbc0d2324a8cf75a0933924eac2eab39f (patch)
treee10e588b1c590d2dd136f992a1595741e11b3c5f
parent9ba55d8a7558f6670fbf47eeebb90901b362d873 (diff)
Move all Tensorflow WORKSPACE rules to a skylark macro
Change: 115515678
-rw-r--r--WORKSPACE57
-rw-r--r--tensorflow/core/platform/default/build_config.bzl2
-rw-r--r--tensorflow/core/platform/posix/test.cc2
-rw-r--r--tensorflow/workspace.bzl58
4 files changed, 63 insertions, 56 deletions
diff --git a/WORKSPACE b/WORKSPACE
index 22133c5dfc..7c9a9a6001 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -12,61 +12,8 @@
# path="<PATH_TO_NDK>",
# api_level=21)
-new_http_archive(
- name = "gmock_archive",
- url = "https://googlemock.googlecode.com/files/gmock-1.7.0.zip",
- sha256 = "26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b",
- build_file = "google/protobuf/gmock.BUILD",
-)
-
-new_http_archive(
- name = "eigen_archive",
- url = "https://bitbucket.org/eigen/eigen/get/ed4c9730b545.tar.gz",
- sha256 = "3d9eceb8a2add299e37b1f32759157cc2574f7684936c151552a5ae3f33aebd5",
- build_file = "eigen.BUILD",
-)
-
-bind(
- name = "gtest",
- actual = "@gmock_archive//:gtest",
-)
-
-bind(
- name = "gtest_main",
- actual = "@gmock_archive//:gtest_main",
-)
-
-git_repository(
- name = "re2",
- remote = "https://github.com/google/re2.git",
- commit = "791beff",
-)
-
-new_http_archive(
- name = "jpeg_archive",
- url = "http://www.ijg.org/files/jpegsrc.v9a.tar.gz",
- sha256 = "3a753ea48d917945dd54a2d97de388aa06ca2eb1066cbfdc6652036349fe05a7",
- build_file = "jpeg.BUILD",
-)
-
-new_http_archive(
- name = "png_archive",
- url = "https://storage.googleapis.com/libpng-public-archive/libpng-1.2.53.tar.gz",
- sha256 = "e05c9056d7f323088fd7824d8c6acc03a4a758c4b4916715924edc5dd3223a72",
- build_file = "png.BUILD",
-)
-
-new_http_archive(
- name = "six_archive",
- url = "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55",
- sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
- build_file = "six.BUILD",
-)
-
-bind(
- name = "six",
- actual = "@six_archive//:six",
-)
+load("//tensorflow:workspace.bzl", "tf_workspace")
+tf_workspace()
# TENSORBOARD_BOWER_AUTOGENERATED_BELOW_THIS_LINE_DO_NOT_EDIT
diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl
index 9082104fe9..efee64a7a8 100644
--- a/tensorflow/core/platform/default/build_config.bzl
+++ b/tensorflow/core/platform/default/build_config.bzl
@@ -71,7 +71,7 @@ def tf_additional_test_deps():
return []
def tf_additional_test_srcs():
- return ["platform/default/test_benchmark.cc"]
+ return ["platform/default/test_benchmark.cc", "platform/posix/test.cc"]
def tf_kernel_tests_linkstatic():
return 0
diff --git a/tensorflow/core/platform/posix/test.cc b/tensorflow/core/platform/posix/test.cc
index 366aa0fd53..26218a4953 100644
--- a/tensorflow/core/platform/posix/test.cc
+++ b/tensorflow/core/platform/posix/test.cc
@@ -23,6 +23,8 @@ limitations under the License.
#include <sys/types.h>
#include <unistd.h>
+#include "tensorflow/core/platform/logging.h"
+
namespace tensorflow {
namespace testing {
diff --git a/tensorflow/workspace.bzl b/tensorflow/workspace.bzl
new file mode 100644
index 0000000000..5c8e4f34ba
--- /dev/null
+++ b/tensorflow/workspace.bzl
@@ -0,0 +1,58 @@
+# Tensorflow external dependencies that can be loaded in WORKSPACE files.
+
+def tf_workspace(path_prefix = ""):
+ native.new_http_archive(
+ name = "gmock_archive",
+ url = "https://googlemock.googlecode.com/files/gmock-1.7.0.zip",
+ sha256 = "26fcbb5925b74ad5fc8c26b0495dfc96353f4d553492eb97e85a8a6d2f43095b",
+ build_file = path_prefix + "google/protobuf/gmock.BUILD",
+ )
+
+ native.new_http_archive(
+ name = "eigen_archive",
+ url = "https://bitbucket.org/eigen/eigen/get/ed4c9730b545.tar.gz",
+ sha256 = "3d9eceb8a2add299e37b1f32759157cc2574f7684936c151552a5ae3f33aebd5",
+ build_file = path_prefix + "eigen.BUILD",
+ )
+
+ native.bind(
+ name = "gtest",
+ actual = "@gmock_archive//:gtest",
+ )
+
+ native.bind(
+ name = "gtest_main",
+ actual = "@gmock_archive//:gtest_main",
+ )
+
+ native.git_repository(
+ name = "re2",
+ remote = "https://github.com/google/re2.git",
+ commit = "791beff",
+ )
+
+ native.new_http_archive(
+ name = "jpeg_archive",
+ url = "http://www.ijg.org/files/jpegsrc.v9a.tar.gz",
+ sha256 = "3a753ea48d917945dd54a2d97de388aa06ca2eb1066cbfdc6652036349fe05a7",
+ build_file = path_prefix + "jpeg.BUILD",
+ )
+
+ native.new_http_archive(
+ name = "png_archive",
+ url = "https://storage.googleapis.com/libpng-public-archive/libpng-1.2.53.tar.gz",
+ sha256 = "e05c9056d7f323088fd7824d8c6acc03a4a758c4b4916715924edc5dd3223a72",
+ build_file = path_prefix + "png.BUILD",
+ )
+
+ native.new_http_archive(
+ name = "six_archive",
+ url = "https://pypi.python.org/packages/source/s/six/six-1.10.0.tar.gz#md5=34eed507548117b2ab523ab14b2f8b55",
+ sha256 = "105f8d68616f8248e24bf0e9372ef04d3cc10104f1980f54d57b2ce73a5ad56a",
+ build_file = path_prefix + "six.BUILD",
+ )
+
+ native.bind(
+ name = "six",
+ actual = "@six_archive//:six",
+ )