blob: 2136e4e2d1572141a68c521bdb5116e4cd28ba3d [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
4# The master copy of the completion logic are bazel-complete-template.bash
5# and bazel-complete-header.bash.
6# This is where you should make edits.
7genrule(
8 name = "bash_completion",
9 srcs = ["bazel-complete-template.bash"],
10 outs = ["bazel-complete.bash"],
Damien Martin-Guillerezcbebfc72015-04-13 20:53:29 +000011 cmd = "cat $(SRCS) > $@\n" +
12 "touch err.log\n" +
13 "trap \"rm err.log\" EXIT\n" +
14 "$(location //src:bazel) --host_javabase=$(JAVABASE) " +
15 " help completion 2>err.log >>$@ || { cat err.log; exit 1; }",
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +000016 output_to_bindir = 1,
Damien Martin-Guillerezcbebfc72015-04-13 20:53:29 +000017 tools = [
18 "//src:bazel",
19 "//tools/defaults:jdk",
20 ],
Damien Martin-Guillerez5f9c6ba2015-04-09 21:10:33 +000021)
22
23sh_test(
24 name = "bash_completion_test",
25 size = "small",
26 srcs = ["bash_completion_test.sh"],
27 data = [
28 "bazel-complete.bash",
29 "testenv.sh",
30 "//src/test/shell:bashunit",
31 ],
32)