groovy / groovy-android-gradle-plugin

A Gradle plugin to support the Groovy language for building Android apps
Apache License 2.0
850 stars 116 forks source link

incompatibility with com.neenbedankt.android-apt 1.8 #96

Closed laenger closed 8 years ago

laenger commented 8 years ago

There seems to be an issue when using the com.neenbedankt.android-apt plugin version 1.8 together with this groovy plugin (0.3.8) and spock unit tests. the build fails when one of the apt src dirs does not exist (because there are no generated test sources). it seems the build should probably skip these folders. apt-plugin version 1.4 works fine since it does not support generated classes for tests.

error:

* What went wrong:
Execution failed for task ':app:compileDevDebugUnitTestGroovyWithGroovyc'.
> directory not found: .../app/build/generated/source/apt/test/dev/debug

buildscript:

dependencies {
    classpath 'com.android.tools.build:gradle:1.5.0'
    classpath 'org.codehaus.groovy:gradle-groovy-android-plugin:0.3.8'
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
}

app:

dependencies {
    ....
    testCompile 'org.codehaus.groovy:groovy:2.4.5:grooid'
    testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
    ....
}
pjakubczyk commented 8 years ago

I'm facing similar problem when update to 1.8. It's not possible to compile class with custom Spock Runner.

btw @laenger did you try https://github.com/robospock/RoboSpock :) ?

AndrewReitz commented 8 years ago

Could you try out the 0.3.9-SNAPSHOT? I've pretty much rewritten how the source directories are added to the groovy compile task.

laenger commented 8 years ago

@pieces029 that snapshot works indeed! thank you for the hint :) @pjakubczyk i haven't in a while since i currently only need plain unit tests

AndrewReitz commented 8 years ago

@laenger great! I plan to have a release cut soon.

AndrewReitz commented 8 years ago

0.3.9 released!