I'm not sure what's going on here. Right now all plugins are in the same classloader so this should work.
However, this *will* break later when Gradle makes all plugins use their own classloader. Don't do this. Rely on the public API of the plugin exposed through the DSL. Also, aren't there already a bunch of robolectric plugins for Gradle? It seems everyone is doing the same things. On Tue, Jan 21, 2014 at 3:06 AM, Przemek Jakubczyk <[email protected]>wrote: > Hi devs, > > I'm currently struggling with finishing plugin for gradle to run unit test > using robolectric and groovy. You can check the webstie www.robospock.org. > > I'm having very weird problem with casting to AppPlugin. (source > https://github.com/pjakubczyk/robospock-plugin/blob/master/robospock-plugin/src/main/groovy/org/robospock/RobospockPlugin.groovy > ) > > I have following line of code: > def appPlugin = androidProject.plugins["android"] > > but when I want to have non-dynamic version: > AppPlugin appPlugin = androidProject.plugins["android"] > > I see such exception: > Cannot cast object 'com.android.build.gradle.AppPlugin@7b3d09b1' with > class 'com.android.build.gradle.AppPlugin' to class > 'com.android.build.gradle.AppPlugin' > > Maybe you have any clue what is going on here? To be honest I don't need > to remove 'def' word but it also return false on such statement > androidProject.plugins["android"] instanceof AppPlugin ... > > Hope you have some ideas. > > Przemek > > -- > 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > -- Xavier Ducrohet Android SDK Tech Lead Google Inc. http://developer.android.com | http://tools.android.com Please do not send me questions directly. Thanks! -- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
