grails/grails-gradle-plugin — pull request #46 by johnrengelman (2013-09-18 19:02:19+00:00)
Title: IntelliJ improvements, source set configuration, refactoring, Grails 2.3.0 support

This PR adds a bunch of functionality to allow this plugin to behave better inside a multi-project build.

1) Better IntelliJ support...exposes source/test directories to IntelliJ including plugin sources so they can be resolved
2) Declares a SourceSet container and configures a sane default for Grails applications
3) Refactors some code for better extensibility in the future
4) Minor adjustments to dependency configuration for Grails 2.3.0 support - this includes declaring your Groovy version using `grails.groovyVersion` which configures the dependency on bootstrap and compile and sets a resolutionStrategy to prevent any other Groovy versions from getting pulled into the project.
5) Creates some additional tasks that can be used to more easily configure custom builds (i.e. GrailsTestTask which allows configuration of the test-results directory, phases, etc.)
6) Duplicates some of the behavior of the JavaPlugin in creating Java style tasks (i.e. build, check, test) so a Grails module will more closely participate in a multi-project build.

*Note: I didn't add any tests to this...I should and I will, but I'm on vacation for the next 3 weeks and I wanted to get this out there for people to consume.

*IntelliJ Note: I've been trying to get IntelliJ to recognize these Gradle modules as Grails projects and thus provide the Grails view, but I haven't yet accomplished that yet. I think it would be possible to do by directly editing the IML file in the plugin but that's only half the battle. IntelliJ seems to be heading more towards directly importing Gradle projects using the Tooling API and I haven't found a way to get it to create the Grails Project library (which I think is what triggers it to enable the Grails views and such)