Yes, it works for us. We are not running automated tests on the obfuscated
version so far, but it compiles at least.
And groovy allows such things with collections, if it is empty, it will
return true for !project.plugins.withType(AppPlugin) and false otherwise.

You can easily test it with the simple groovy script file:
Collection c = new ArrayList();
println !(c); // prints true
c.add("a");
println !(c); // prints false

Best regards, Ivan Biryukov
+44 7453 528610


On Mon, Feb 17, 2014 at 4:02 PM, Jurgen Cruz <notifications@github.com>wrote:

> In
> src/main/groovy/com/jcandksolutions/gradle/androidunittest/AndroidUnitTestPlugin.groovy:
>
> > @@ -32,7 +32,7 @@ class AndroidUnitTestPlugin implements Plugin<Project> {
> >     */
> >    private static void assertAndroidPluginExists(Project project) {
> >      // Assert that the Android App Plugin has been applied
> > -    if (!project.plugins.hasPlugin(AppPlugin)) {
> > +    if (!project.plugins.withType(AppPlugin)) {
>
> The withType here returns a subset list, not a boolean. Wouldn't it
> require to check if the list is empty?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/JCAndKSolutions/android-unit-test/pull/11/files#r9795959>
> .
>