I have a gradle build script with several sets of sources that have different dependencies (some common, some not) and I'm trying to use the Eclipse plugin to gradle generate .project and .classpath for Eclipse, but I canβt figure out how to get everything dependency records in .classpath ; for some reason, quite a few external dependencies are actually added to .classpath , and as a result, the Eclipse build failed with 1400 errors (creating with gradle works fine).
I defined my source sets as follows:
sourceSets { setOne setTwo { compileClasspath += setOne.runtimeClasspath } test { compileClasspath += setOne.runtimeClasspath compileClasspath += setTwo.runtimeClasspath } } dependencies { setOne 'external:dependency:1.0' setTwo 'other:dependency:2.0' }
Since I am not using the original set of main , I thought this might have something to do with it, so I added
sourceSets.each { ss -> sourceSets.main { compileClasspath += ss.runtimeClasspath } }
but it did not help.
I was not able to figure out any general properties of the libraries that are included, or those that are not, but I can not find anything that I am sure of (although, of course, there should be something). I feel that all of the included libraries are dependencies of the original test suite, directly or indirectly, but I could not verify that more than that all the test dependencies exist.
How can I guarantee that dependencies of all source sets are placed in .classpath ?
Tomas lycken
source share