For last few days I am struggling with setting up a separate test module in gradle for Android project. I found how I can set up instrumentation tests inside my main project under instrumentationTest directory but I can't find a way how to do this in new module. My test module doesn't see sources from my main project.
This is a structure of the project:
MyProject/
| settings.gradle
+ MainApp/
| build.gradle
| src/main/java/...
| res
+ MainAppFunctionalTests/
| build.gradle
| src/instrumentTest/java/...
In my settings.gradle I have:
include ':MainApp', 'MainAppFunctionalTests'
In MainAppFunctionalTests's build.gradle I put:
compile project(':MainApp')
but my test project still doesn't see the sources from my main project. I don't want to have functional tests in main project because I would like to put there unit tests using Robolectric.
I will be glad for any help.