Let java plugin understands dependency on Android project

It would be great if I can use java (better groovy) plugin to get Android project sources and resources and run unit test on the JVM like Robolectric does. I already use Spock(Robospock) to run the test in command line but each week I create a new hack to glue two modules together.