I have a (poorly organized) project that I’m converting from Maven. In it there is a module that has tests that depend on test classes from a sibling project. I’ve tried to set up the dependencies so this works, but I’m still getting errors when one project’s test code attempts to import classes from another project’s test code.
E.g. assume two projects: Server and ServerWeb
In build.gradle for ServerWeb there are dependencies on Server
apply plugin: 'war’
apply plugin: ‘gwt’
testCompile project(path: ‘:Server’, configuration: ‘testCompile’)
When it compiles the test classes for ServerWeb, it fails to import test classes from Server. I can see that the classes are there in the Server project when I look in Server/build/classes/test/
I also tried depending on ‘testRuntime’ instead of ‘testCompile’, but it made no difference.
I’m running Gradle 2.11.
Is there a trick to getting this to work? I obviously expected what I had to do the trick, so maybe there is a bug somewhere… either in my script or in how Gradle handles the class path for tests.