So it looks like I got working solution thanks to respond from Gradle Devs. Using this plugin completely solves all the issue I covered here: http://plugins.gradle.org/plugin/nebula.provided-base
понедельник, 8 декабря 2014 г., 18:17:55 UTC+3 пользователь Vyacheslav Blinov написал: > > Sorry, it looks like it was a false alarm. The problem is within the > gradle, pure java modules and compile-time annotation processors. > > In my build I'm using compile-time annotation processor to generate some > pieces of code. To don't add this annotation processor as a dependency > between modules/artifacts I created surrogate compile-like scope > 'provided', hoping that it will work similar to android plugin provided > scope. While this was working perfectly durring build with gradle it wasn't > playing nice with IDE at all. I believe this is a Gradle-Idea general > problem. Both Android Studio and Idea highlights notifications from this > annotation-processor lib as unresolved symbols resulting in not seeing > generated code as well, which caused the issue in this topic. > > Currently I made an ugly workaround by making this library a compile > dependency, and excluding it in all other modules which depend on this one. > > I wrote the question about this one on a Gradle forum, but feel like I > won't get a good answer as there already was similar talks before and > Gradle developers who responded there felt like ignorant to existance of > compile-time only (not +distribution-time) dependencies. I wonder how come > so that provided scope exists in terms of android gradle projects. > > > пятница, 5 декабря 2014 г., 21:00:10 UTC+3 пользователь Alex Ruiz написал: >> >> Can you please attach a screenshot of the error? I cannot reproduce the >> issue with the example you provided. >> >> Thanks, >> -Alex >> >> On Fri, Dec 5, 2014 at 7:41 AM, Vyacheslav Blinov <blinov.v...@gmail.com> >> wrote: >> >>> I'm writing it here because I don't see the same issue with latest IDEA. >>> I have a class that roughly looks like this: >>> >>> class MyClass { >>> public static final Supplier<String> stuff = new Supplier <String> { >>> public String get() { >>> return "stuff"; >>> } >>> } >>> >>> public String stuff() { >>> return "other stuff"; >>> } >>> } >>> >>> /// ... later somewhere: >>> >>> MyClass myClass = new MyClass(); >>> myClass.stuff(); >>> >>> Javac correctly distinguishes between method call and member as well as >>> IDEA and Eclipse, but Android Studio marks this as error "method call >>> expected". >>> >>> P.S. I know it is not the best coding style, but there are many much >>> more weird examples, so face it, people write strange code sometimes. >>> >>> -- >>> You received this message because you are subscribed to the Google >>> Groups "adt-dev" group. >>> To unsubscribe from this group and stop receiving emails from it, send >>> an email to adt-dev+u...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. >>> >> >> -- You received this message because you are subscribed to the Google Groups "adt-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.