Leopold Schabel | 399fe83 | 2019-11-15 21:15:30 +0100 | [diff] [blame] | 1 | Copyright 2020 The Monogon Project Authors. |
| 2 | |
| 3 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | you may not use this file except in compliance with the License. |
| 5 | You may obtain a copy of the License at |
| 6 | |
| 7 | http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | |
| 9 | Unless required by applicable law or agreed to in writing, software |
| 10 | distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | See the License for the specific language governing permissions and |
| 13 | limitations under the License. |
| 14 | |
| 15 | |
| 16 | # We need to patch the IntelliJ Bazel aspect that is injected via the @intellij_bazel repository |
Hendrik Hofstadt | 30b00d6 | 2020-02-27 11:48:47 +0100 | [diff] [blame] | 17 | # to properly resolve go_library rules that have both source files and embeds. |
Leopold Schabel | 399fe83 | 2019-11-15 21:15:30 +0100 | [diff] [blame] | 18 | --- a/intellij_info_impl.bzl.o |
| 19 | +++ b/intellij_info_impl.bzl |
Leopold Schabel | 399fe83 | 2019-11-15 21:15:30 +0100 | [diff] [blame] | 20 | 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 Hofstadt | 30b00d6 | 2020-02-27 11:48:47 +0100 | [diff] [blame] | 22 | @@ -349,6 +349,8 @@ def collect_go_info(target, ctx, semantics, ide_info, ide_info_file, output_grou |
Hendrik Hofstadt | 5e0bd2d | 2020-02-10 19:46:41 +0100 | [diff] [blame] | 23 | "go_appengine_test", |
| 24 | ]: |
| 25 | sources = [f for src in getattr(ctx.rule.attr, "srcs", []) for f in src.files.to_list()] |
Hendrik Hofstadt | 30b00d6 | 2020-02-27 11:48:47 +0100 | [diff] [blame] | 26 | + sources += [f for embed in getattr(ctx.rule.attr, "embed", []) for f in _collect_generated_go_sources(embed) or []] |
Hendrik Hofstadt | 5e0bd2d | 2020-02-10 19:46:41 +0100 | [diff] [blame] | 27 | + |
| 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() |