diff options
Diffstat (limited to 'third_party/git')
-rw-r--r-- | third_party/git/BUILD | 0 | ||||
-rw-r--r-- | third_party/git/BUILD.tpl | 10 | ||||
-rw-r--r-- | third_party/git/git_configure.bzl | 20 |
3 files changed, 30 insertions, 0 deletions
diff --git a/third_party/git/BUILD b/third_party/git/BUILD new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/third_party/git/BUILD diff --git a/third_party/git/BUILD.tpl b/third_party/git/BUILD.tpl new file mode 100644 index 0000000000..7b031e74d5 --- /dev/null +++ b/third_party/git/BUILD.tpl @@ -0,0 +1,10 @@ +# Description: +# Exports generated files used to generate tensorflow/core/util/version_info.cc + +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +exports_files( + glob(["gen/*"]), +) diff --git a/third_party/git/git_configure.bzl b/third_party/git/git_configure.bzl new file mode 100644 index 0000000000..bd197bfd24 --- /dev/null +++ b/third_party/git/git_configure.bzl @@ -0,0 +1,20 @@ +"""Repository rule for Git autoconfiguration.""" + +def _git_conf_impl(repository_ctx): + repository_ctx.template( + "BUILD", + Label("//third_party/git:BUILD.tpl")) + + tensorflow_root_path = str(repository_ctx.path( + Label("@org_tensorflow//:BUILD")))[:-len("BUILD")] + python_script_path = repository_ctx.path( + Label("@org_tensorflow//tensorflow/tools/git:gen_git_source.py")) + generated_files_path = repository_ctx.path("gen") + + repository_ctx.execute([ + python_script_path, "--configure", tensorflow_root_path, + "--gen_root_path", generated_files_path], quiet=False) + +git_configure = repository_rule( + implementation = _git_conf_impl, +) |