bazelbuild / intellij

IntelliJ plugin for Bazel projects
https://ij.bazel.build/
Apache License 2.0
757 stars 298 forks source link

Autoattaching generated srcjars doesn't work for kt_jvm_library , kt_jvm_binary, java_lib #6547

Open prodoelmit opened 2 weeks ago

prodoelmit commented 2 weeks ago

Description of the bug:

There is functionality that finds srcjars generated as part of bazel build and attaches them to project as dependency.

For me this feature does only work when srcjar contains .java files and is passed to java_binary rule as source Cases where srcjars are not picked up (but should):

Example where it works: image

Example where it doesn't: image

Which category does this issue belong to?

Intellij

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Repo with reproduction: https://github.com/prodoelmit/bazel_example_generated_srcjar

Which Intellij IDE are you using? Please provide the specific version.

2023.3.5 Ultimate (#IU-233.14808.21)

What programming languages and tools are you using? Please provide specific versions.

Kotlin

What Bazel plugin version are you using?

7.0.0

Have you found anything relevant by searching the web?

There are numerous issues about adding support for srcjars: #6261, #5250, #6286, #5776

I've tried getting help in slack: https://bazelbuild.slack.com/archives/CHSV3RSR0/p1719696952077309 , also there are several threads about it: https://bazelbuild.slack.com/archives/CHSV3RSR0/p1592928891054900 , https://bazelbuild.slack.com/archives/CHSV3RSR0/p1571351050011200

Any other information, logs, or outputs that you want to share?

Everything's in reproduction repo