blob: c37f18e358aeb5eef2a3ee8bb6230ae4b5f6440c [file] [log] [blame]
Leopold Schabel399fe832019-11-15 21:15:30 +01001Copyright 2020 The Monogon Project Authors.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14
15
16# We need to patch the IntelliJ Bazel aspect that is injected via the @intellij_bazel repository
Hendrik Hofstadt30b00d62020-02-27 11:48:47 +010017# to properly resolve go_library rules that have both source files and embeds.
Leopold Schabel399fe832019-11-15 21:15:30 +010018--- a/intellij_info_impl.bzl.o
19+++ b/intellij_info_impl.bzl
Leopold Schabel399fe832019-11-15 21:15:30 +010020 def collect_go_info(target, ctx, semantics, ide_info, ide_info_file, output_groups):
21 """Updates Go-specific output groups, returns false if not a recognized Go target."""
Hendrik Hofstadt30b00d62020-02-27 11:48:47 +010022@@ -349,6 +349,8 @@ def collect_go_info(target, ctx, semantics, ide_info, ide_info_file, output_grou
Hendrik Hofstadt5e0bd2d2020-02-10 19:46:41 +010023 "go_appengine_test",
24 ]:
25 sources = [f for src in getattr(ctx.rule.attr, "srcs", []) for f in src.files.to_list()]
Hendrik Hofstadt30b00d62020-02-27 11:48:47 +010026+ sources += [f for embed in getattr(ctx.rule.attr, "embed", []) for f in _collect_generated_go_sources(embed) or []]
Hendrik Hofstadt5e0bd2d2020-02-10 19:46:41 +010027+
28 generated = [f for f in sources if not f.is_source]
29 elif ctx.rule.kind == "go_wrap_cc":
30 genfiles = target.files.to_list()