How can a Bazel aspect get source file list from java_library target?

542 Views Asked by At

Is there a way for an aspect to get a JavaSourceInfoProvider from a java_library target? A source jar works for our compiler, but to generate source debugging information we need the actual source file's location, not a transient copy.

1

There are 1 best solutions below

0
On BEST ANSWER

I don't believe that that provider has been made available to Starlark, so you'll have to file a feature request to make it available.

However, it might be enough to just look at the srcs attribute of the rule directly with ctx.rule.attr.srcs.