bazelbuild / rules_kotlin

Bazel rules for Kotlin
Apache License 2.0
334 stars 210 forks source link

kapt doesn't work with pinned maven_install? #312

Open fisheye-123 opened 4 years ago

fisheye-123 commented 4 years ago

Here're my configuration: bazel 2.2.0 on macos rules_jvm 3.2 rules_kotlin legacy-1.3.0 I have build file like this for annotation processor(exactly copied from dagger example): java_plugin( name = "dagger_component_plugin", generates_api = 1, processor_class = "dagger.internal.codegen.ComponentProcessor", visibility = ["//visibility:private"], deps = [ artifact("com.google.dagger:dagger-compiler", "pie_main"), ], ) java_library( name = "dagger", exported_plugins = [":dagger_component_plugin"], exports = [ artifact("com.google.dagger:dagger""), artifact("javax.inject:javax.inject"), ], ) I have another kt_android_library rule which uses the annotation processor, I find if i use maven_install with version pin, i got error like this:

warning: [kapt] Can't find annotation processor class dagger.internal.codegen.ComponentProcessor: dagger.internal.codegen.ComponentProcessor

related stuff in my WORKSPACE: maven_install(... maven_install_json = "@pie//:maven.json", ) load("@pie_main//:defs.bzl", "pinned_maven_install") pinned_maven_install()

everything seems work if I remove pin related configuration from workspace file.

also any flag to make the warning as an error?

cgruber commented 4 years ago

Can you possibly re-format this with "```" quotes just to make it all line up? I'm finding it quite hard to read this and make sense of it.