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):
.java files in srcjar, but srcjar is passed to java_lib
.kt files in srcjar, srcjar is passed to kt_jvm_library as source, then library is passed to java_binary as runtime dep
.kt files in srcjar, srcjar is passed to kt_jvm_binary as source
Example where it works:
Example where it doesn't:
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.
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 tojava_binary
rule as source Cases where srcjars are not picked up (but should):.java
files in srcjar, but srcjar is passed tojava_lib
.kt
files in srcjar, srcjar is passed tokt_jvm_library
as source, then library is passed tojava_binary
as runtime dep.kt
files in srcjar, srcjar is passed tokt_jvm_binary
as sourceExample where it works:![image](https://github.com/bazelbuild/intellij/assets/4222739/002b0837-cb39-4be7-a81b-cf2794c4cf80)
Example where it doesn't:![image](https://github.com/bazelbuild/intellij/assets/4222739/0d12b32a-4104-4c13-9786-d75a94fbe727)
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