How can I make a proper dependency on compile time annotation processor library?

How can I make a proper dependency on compile time annotation processor library? For example http://projectlombok.org/. They only provide a way to do this for Android development.

This is how I’m currently doing it: https://gist.github.com/dant3/91e205e12d51d490c6c8

While this solution works in general, the problem is this surrogate provided scope does not plays well with any IDE I tried - I see annotations as undefined references. I can only change it changing the scope to compile, which results in adding this libraries to dependencies list for other projects, which I obviously don’t want to happen - that I’m using for my code generation and compilation is my business - consider annotation-processor library as a source code generator tool, only that it is plugged into compiler.

Currently I feel this is broken in the core of Gradle :frowning: And the way it solved on Android (provided scope in android plugin + apt plugin usage) proves it in my face.

P.S. I previously tried the same thing with other build tools: maven and sbt, and they both have provided scope which plays nicely with IDE as well as does exactly what I want, although, some may argue the name “provided” is misleading, and could be replaced to something different.

If you want a ‘provided’ scope, http://plugins.gradle.org/plugin/nebula.provided-base is an easy solution.

I’m not sure it is much different from my solution I posted above. Will it help to resolve IDE integration issues I mentioned?

Just tried it and looks like it works with IntelliJ Idea which is sufficient minimum for me. Thanks!

Yes it will.