support library projects

support library projects by using the androidTest tasks to merge resources
Just a quick question. for Applications we obviously depend on the java compile task so that the tests can compile against the generated classes. In case of a library, we would be depending on the java compile task of the test variant instead of the java compile of the library itself. would this still work? would this still make the java compile of the library execute?