# Idea module generatedSourceDirs broken for multiple projects

**URL:** <https://discuss.gradle.org/t/idea-module-generatedsourcedirs-broken-for-multiple-projects/20291>\
**Category:** Help/Discuss\
**Created:** [November 2, 2016, 10:34am UTC](https://discuss.gradle.org/t/idea-module-generatedsourcedirs-broken-for-multiple-projects/20291 "2016-11-02T10:34:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tux-mind](https://avatars.discourse-cdn.com/v4/letter/t/838e76/32.png) [@tux-mind](https://discuss.gradle.org/u/tux-mind)\
**Post date:** [November 2, 2016, 10:34am UTC](https://discuss.gradle.org/t/idea-module-generatedsourcedirs-broken-for-multiple-projects/20291/1 "2016-11-02T10:34:40Z")

</div>

Hello there, I’m trying to using protobuf with gradle and Intellij IDEA.

Java compilation works fine, but I cannot use autocompletion features from IDEA as the generated sources are not picked up by the IDE.

The following snippet works fine:

```gradle
idea {
    module {
        sourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
    }
}

```

while the following do not:

```gradle
idea {
    module {
        generatedSourceDirs += file("${protobuf.generatedFilesBaseDir}/main/java")
    }
}

```

To make the first works I had to change the generated folder outside of the `project.buildDir` as it and all of it’s subfolders are excluded from IDEA.

I’ll create a sample project if you need, but you may already know the cause of the problem.

Thank you in advance for your help 😊

| sw | version |
| --- | --- |
| Intellij IDEA | Ultimate 2016.2.5 |
| Gradle | 2.13 |

> TODO: support markdown tables \<3
