Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Commit

Permalink
[fix] aspects dont fail if target contains another target as srcs a…
Browse files Browse the repository at this point in the history
…ttribute

Merge-request: BAZEL-MR-471
Merged-by: Marcin Abramowicz <marcin.abramowicz@jetbrains.com>
  • Loading branch information
abrams27 authored and qodana-bot committed Aug 25, 2023
1 parent a29c1da commit 637f0d9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
## [Unreleased]

### Features 🎉

- The server generates `extensions.bzl` based on languages (external rules) relevant to the project.

### Fixes 🛠️

- aspects dont fail if target contains another target as `srcs` attribute

## [3.0.0] - 09.08.2023

### BREAKING CHANGES 🚨
Expand Down
16 changes: 10 additions & 6 deletions aspects/core.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,16 @@ def _bsp_target_info_aspect_impl(target, ctx):
for k, v in output_groups.items():
output_groups[k] = depset(transitive = v)

sources = [
file_location(f)
for t in getattr(ctx.rule.attr, "srcs", [])
for f in t.files.to_list()
if f.is_source
]
srcs_attr = getattr(ctx.rule.attr, "srcs", [])
sources = []

if type(srcs_attr) == "list":
sources = [
file_location(f)
for t in srcs_attr
for f in t.files.to_list()
if f.is_source
]

resources = [
file_location(f)
Expand Down

0 comments on commit 637f0d9

Please sign in to comment.