blob: 18e69439eff7a1cb6b8f0117c7ac29a54eb8efd1 [file] [log] [blame]
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +00001# Scripts for IDE / Environment support for Bazel
2package(default_visibility = ["//visibility:private"])
3
nharmata1694de62018-11-12 09:22:23 -08004# The master copy of the completion logic lives in bazel-complete-header.bash
5# and bazel-complete-template.bash. You should make edits in those files.
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +00006genrule(
7 name = "bash_completion",
nharmata1694de62018-11-12 09:22:23 -08008 srcs = [
9 "bazel-complete-header.bash",
10 "bazel-complete-template.bash",
11 ],
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +000012 outs = ["bazel-complete.bash"],
Julio Merino75d3d502017-02-02 15:42:28 +000013 cmd = " ".join([
14 "$(location :generate_bash_completion.sh)",
Liam Miller-Cushon7c49bd92018-06-18 09:29:52 -070015 "--bazel=$(location //src:bazel)",
Julio Merino75d3d502017-02-02 15:42:28 +000016 "--output=$@",
nharmata1694de62018-11-12 09:22:23 -080017 "--prepend=$(location bazel-complete-header.bash)",
Julio Merino75d3d502017-02-02 15:42:28 +000018 "--prepend=$(location bazel-complete-template.bash)",
19 ]),
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +000020 output_to_bindir = 1,
Damien Martin-Guillerezcbebfc72015-04-13 20:53:29 +000021 tools = [
Julio Merino75d3d502017-02-02 15:42:28 +000022 ":generate_bash_completion.sh",
Liam Miller-Cushon7c49bd92018-06-18 09:29:52 -070023 "//src:bazel",
Damien Martin-Guillerezcbebfc72015-04-13 20:53:29 +000024 ],
John Cater352c72d2017-01-03 17:04:12 +000025 visibility = ["//scripts/packages:__subpackages__"],
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +000026)
27
28sh_test(
29 name = "bash_completion_test",
30 size = "small",
31 srcs = ["bash_completion_test.sh"],
32 data = [
33 "bazel-complete.bash",
34 "testenv.sh",
35 "//src/test/shell:bashunit",
36 ],
37)
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000038
39filegroup(
40 name = "srcs",
Damien Martin-Guillerez7d265e02016-07-01 13:33:48 +000041 srcs = glob(["**"]) + [
Kristina Chodorowa028ae22016-12-13 18:59:51 +000042 "//scripts/docs:srcs",
Damien Martin-Guillerez7d265e02016-07-01 13:33:48 +000043 "//scripts/packages:srcs",
Kristina Chodorowa028ae22016-12-13 18:59:51 +000044 "//scripts/release:srcs",
Keith Smiley74c274a2019-01-11 09:04:36 -080045 "//scripts/zsh_completion:srcs",
Damien Martin-Guillerez7d265e02016-07-01 13:33:48 +000046 ],
Damien Martin-Guillerezde54bca2016-02-29 10:49:43 +000047 visibility = ["//:__pkg__"],
48)