bazelbuild / rules_kotlin

Bazel rules for Kotlin
Apache License 2.0
332 stars 208 forks source link

IntelliJ IDEA bazel plugin cannot sync kotlin projects #274

Open unoexperto opened 4 years ago

unoexperto commented 4 years ago

For some reason IDEA's bazel plugin cannot sync project defined with kt_jvm_library rule. As result IDE miscategorizes what packages classes belong to and etc. Sadly it's unusable.

Build complies without problem via command line.

Is there anything I could do to fix it ?

I'm on following configuration (bazel plugin 2019.10.21.0.0-6823f76)


IntelliJ IDEA 2019.3.2 (Ultimate Edition) Build #IU-193.6015.39, built on January 20, 2020 Subscription is active until July 5, 2020 Runtime version: 11.0.5+10-b520.30 amd64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o Linux 5.3.0-29-generic GC: ParNew, ConcurrentMarkSweep Memory: 3993M Cores: 12 Registry: Non-Bundled Plugins: Pythonid, Statistic, YourKit Java Profiler 2019.8-b126 Integration, org.jetbrains.kotlin, org.intellij.scala, com.google.idea.bazel.ijwb, net.seesharpsoft.intellij.plugins.csv, org.jetbrains.plugins.hocon, wu.seal.tool.jsontokotlin


My BUILD is quite small. For the sake of experiment I compile java files using java_library and they sync in IDE.

load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_jvm_library")

package(default_visibility = ["//visibility:public"])

kt_jvm_library(
    name = "main_kotlin",
    srcs = glob([
        "src/main/kotlin/**/*.kt",
        #        "src/main/java/**/*.java",
    ]),
    deps = [
        "@maven//:com_walkmind_extensions_collections",
        "@maven//:io_netty_netty_buffer",
        "@maven//:org_jetbrains_annotations",
        "@maven//:org_jetbrains_kotlin_kotlin_stdlib",
    ],
)

java_library(
    name = "main_java",
    srcs = glob([
        "src/main/java/**/*.java",
    ]),
    visibility = ["//visibility:public"],
    deps = [
        ":main_kotlin",
    ],
)

Example from https://github.com/bazelbuild/rules_kotlin/tree/master/examples/trivial is not working either. No bazel errors on import but IDEA can't sync:

image

restingbull commented 4 years ago

@unoexperto could you attach the server log?

You can get the server log location from bazel info: bazel info | grep server_log

unoexperto commented 4 years ago

@restingbull Sure, attached.

java.log.apophis.expert.log.java.20200218-162654.20436.zip

unoexperto commented 4 years ago

@restingbull Hi Corbin! Any updates on this issues? Can I provide more info to help?