steffenschaefer/gwt-gradle-plugin — pull request #45 by Turbo87 (2014-08-13 11:56:26+00:00)
Title: Improved IntelliJ IDEA support

In the current situation IntelliJ does not know about the `gwt` configuration and any dependencies added to it are shows as import errors. This can be solved by adding the following code block to the build scripts:

~~~~groovy
idea {
module {
scopes.PROVIDED.plus += configurations.gwt
scopes.PROVIDED.plus += configurations.gwtSdk
}
}
~~~~

This is essentially what the first commit does automatically.

The next problem is that IntelliJ isn't handling sources artifacts properly, which can be solved by splitting the `gwt` configuration up into two:

~~~~groovy
configurations {
gwtCompile
gwtSources
gwt.extendsFrom(gwtSources, gwtCompile)
}
~~~~

and adjusting the first snippet to only add `configurations.gwtCompile` instead of `configurations.gwt`. That is what the second commit is doing.

The example dependency declaration now looks like this:

~~~~groovy
dependencies {
gwtCompile 'foo:bar:1.2.3'
gwtSource 'foo:bar:1.2.3:sources'
}
~~~~

The old dependency declaration with `gwt` should still work, but won't be used by the IntelliJ integration.