kobalt-intellij-plugin
kobalt-intellij-plugin copied to clipboard
Generated classes are not in the classpath in IntelliJ
Generated classes don't show up in the classpath in IntelliJ, causing "Cannot resolve symbol" errors. See this sample project: https://github.com/sargunster/annotations where the project builds in Kobalt but shows compile errors in IntelliJ.
One possible solution is to mark the kobaltBuild/classes as a "generated sources root".
You need to take a few extra steps to declare your annotation processor to IDEA, I don't think this has anything to do with Kobalt.
And I don't think the Kobalt IDEA plug-in can do much since, as you saw, there is no mention of apt in your Build.kt, so the plug-in has no way of knowing you're using an annotation processor (short of doing a lot of costly introspection).
Here is the relevant doc.
Thanks, I'll have a look at the doc. The Gradle plugin doesn't require any additional configuration for annotation processing.
Ok let's dig a bit further, then. The Kobalt plug-in could see if the project contains any annotation processor file under META-INF and configure the IDE automatically.
@dmitry-zhuravlev Thoughts?
I think the simplest solution is to mark the outputDir in apt as a generated sources root.
I think the simplest solution is to mark the outputDir in apt as a generated sources root.
Agree, but in this case information about defined outputDir should comes from server because plugin should know the actual outputDir defined in Build.kt
@cbeust Also I noticed that if no outputDir defined in Build.kt Kobalt produce generated sources in classes folder:

I think that this should be placed in "kobaltBuild/generated/source/apt" just to not mix "java" and "class" files in same place. @cbeust What do you think?