Idea vs Eclipse behavior for sourceSets


(Emil Sit) #1

Why does the IntelliJ plugin only use conventions to the set of source directories where as the Eclipse plugin uses sourcesets explicitly to generate the list of source directories?

It seems to me that the Eclipse approach is better.

I’m using Gradle 1.0-rc-3.


(Peter Niederwieser) #2

Can you explain in more detail what you mean by that? I can’t follow.


(Emil Sit) #3

Sorry, the original message is definitely mostly incomprehensible. Let me try again.

I have a Gradle project that is wrapping a legacy ant build. The project does not apply the java plugin, but it does apply java-base. I have manually created a sourceSet called main and added a bunch of srcDirs to it.

When I run ‘gradle eclipse’, Gradle generates a ‘.classpath’ file that contains all the srcDirs. When I run ‘gradle idea’, Gradle generates a module file that has no source dirs.

I think this is because the Idea plugin only applies ‘withType(JavaPlugin)’ whereas the Eclipse plugin uses ‘withType(JavaBasePlugin)’.

Is that intentional or could it be switched to match the Eclipse plugin?


(Emil Sit) #4

Posted a clarification as separate reply. Does that help?


(Peter Niederwieser) #5

I think it is an inaccuracy, and should be changed to match the Eclipse plugin.


(Emil Sit) #6

I filed GRADLE-2337.

I tried to make a simple patch but it failed the integration test and I don’t have time currently to look into it further. If Gradleware doesn’t have time to make a fix for 1.0, defer the issue and I’ll try to see if I can get the test passing and submit a patch or pull request.

Thanks.


(Peter Niederwieser) #7

It won’t make 1.0, but is a candidate for inclusion in 1.1.