You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: refresh_compile_commands.bzl
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -67,6 +67,7 @@ def refresh_compile_commands(
67
67
exclude_external_sources=False,
68
68
bazel_command="bazel",
69
69
max_threads=None,
70
+
output_dir="",
70
71
**kwargs): # For the other common attributes. Tags, compatible_with, etc. https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes.
71
72
# Convert the various, acceptable target shorthands into the dictionary format
72
73
# In Python, `type(x) == y` is an antipattern, but [Starlark doesn't support inheritance](https://bazel.build/rules/language), so `isinstance` doesn't exist, and this is the correct way to switch on type.
@@ -92,7 +93,7 @@ def refresh_compile_commands(
92
93
93
94
# Generate the core, runnable python script from refresh.template.py
"exclude_headers": attr.string(values= ["all", "external", ""]), # "" needed only for compatibility with Bazel < 3.6.0
140
142
"labels_to_flags": attr.string_dict(mandatory=True), # string keys instead of label_keyed because Bazel doesn't support parsing wildcard target patterns (..., *, :all) in BUILD attributes.
141
143
"max_threads": attr.int(default=0), # 0 means "use the historical default" inside refresh.template.py
144
+
"output_dir": attr.string(default=""), # Empty means: write to the workspace root (cwd, the historical behaviour).
142
145
# For Windows INCLUDE. If this were eliminated, for example by the resolution of https://github.com/clangd/clangd/issues/123, we'd be able to just use a macro and skylib's expand_template rule: https://github.com/bazelbuild/bazel-skylib/pull/330
143
146
# Once https://github.com/bazelbuild/bazel/pull/17108 is widely released, we should be able to eliminate this and get INCLUDE directly. Perhaps for 7.0? Should be released in the sucessor to 6.0
0 commit comments