Skip to content

Commit

Permalink
Keep "srcs", "hdrs" and "textual_hdrs" separate.
Browse files Browse the repository at this point in the history
Each can has slightly different semantics for the IDE, and it is better to use
the information on which files belong to which group from BUILD file rather than use heuristics like file extension to determine it.

The contents of "textual_hdrs" are added by the prefetcher.

RELNOTES: None.
PiperOrigin-RevId: 157256048
  • Loading branch information
Googler authored and laszlocsomor committed May 29, 2017
1 parent 77f12de commit dfef436
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/protobuf/intellij_ide_info.proto
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ message CIdeInfo {
repeated string target_copt = 7;
repeated string target_define = 8;
repeated string target_include = 9;
repeated ArtifactLocation header = 10;
repeated ArtifactLocation textual_header = 11;
}

message AndroidIdeInfo {
Expand Down
5 changes: 4 additions & 1 deletion tools/ide/intellij_info_impl.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@ def build_c_ide_info(target, ctx):
return (None, set())

sources = artifacts_from_target_list_attr(ctx, "srcs")
sources.extend(artifacts_from_target_list_attr(ctx, "hdrs"))
headers = artifacts_from_target_list_attr(ctx, "hdrs")
textual_headers = artifacts_from_target_list_attr(ctx, "textual_hdrs")

target_includes = []
if hasattr(ctx.rule.attr, "includes"):
Expand All @@ -284,6 +285,8 @@ def build_c_ide_info(target, ctx):

c_ide_info = struct_omit_none(
source = sources,
header = headers,
textual_header = textual_headers,
target_include = target_includes,
target_define = target_defines,
target_copt = target_copts,
Expand Down

0 comments on commit dfef436

Please sign in to comment.