I would like to create source directories for custom source sets and also use the eclipse plugin. I also would like to not have a ‘main’ source set in my project.
The example can be found here https://github.com/thokari/gradle-workshop/blob/master/examples/07-multiple-artifacts/build.gradle
Now it would be easy if I could just use
sourceSets { remove main }
, but then the eclipse plugin stops working: >* What went wrong: >Could not determine the dependencies of task ‘:eclipseClasspath’. >Could not find property ‘main’ on SourceSet container.
I guess it is because of lines 139, 142 in https://github.com/gradle/gradle/blob/351e5d7988d451bf551410b8e59797c98c3152ff/subprojects/ide/src/main/groovy/org/gradle/plugins/ide/eclipse/EclipsePlugin.groovy
I am wondering why this convention is hard coded in this way.
Is there a drawback in always adding all declared java source sets to the classpath? When working with multiple source sets, usually the first thing I do is
eclipse {
classpath.plusConfigurations += configurations.newConfiguration
}
I feel like this should be default… Could the problem be with this, that you could actually create a project which shows no errors in Eclipse but cannot compile with Gradle? I.e. if you added all configurations to the eclipse classpath, without declaring possible source set dependencies?