# Idea vs Eclipse behavior for sourceSets

**URL:** <https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776>\
**Category:** Old Forum Archive\
**Created:** [May 29, 2012, 12:27am UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776 "2012-05-29T00:27:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sit](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@sit](https://discuss.gradle.org/u/sit)\
**Post date:** [May 29, 2012, 12:27am UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776/1 "2012-05-29T00:27:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [May 29, 2012, 9:32pm UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776/2 "2012-05-29T21:32:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sit](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@sit](https://discuss.gradle.org/u/sit)\
**Post date:** [May 30, 2012, 2:35am UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776/3 "2012-05-30T02:35:00Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![sit](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@sit](https://discuss.gradle.org/u/sit)\
**Post date:** [June 2, 2012, 3:17am UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776/4 "2012-06-02T03:17:00Z")

</div>

Posted a clarification as separate reply. Does that help?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [June 2, 2012, 9:03am UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776/5 "2012-06-02T09:03:00Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sit](https://avatars.discourse-cdn.com/v4/letter/s/3bc359/32.png) [@sit](https://discuss.gradle.org/u/sit)\
**Post date:** [June 5, 2012, 6:48pm UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776/6 "2012-06-05T18:48:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [June 5, 2012, 9:16pm UTC](https://discuss.gradle.org/t/idea-vs-eclipse-behavior-for-sourcesets/6776/7 "2012-06-05T21:16:00Z")

</div>

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