blob: bd197bfd24f515bd248f25927d93354ac1a5912a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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,
)
|