Using IntelliJ with gradle - any tips on how to get my tests working?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Using IntelliJ with gradle - any tips on how to get my tests working?

Leonard Axelsson
Hi,

I'm having problems running my JUnit (GroovyTestCase) tests in IntelliJ as IntelliJ don't know anything about my dependencies (which are specified in the gradle build-file).

My thinking right now is that the easiest solution would probably be to let gradle put all the dependencies in ./lib and point IntelliJ to that folder. Is there any easier or better way to solve this problem? (until the IntelliJ plugin for gradle actually reads the dependencies).

Also if the "download and put in ./lib"-solution is the way to go I'd appreciate any pointers about how to do it. Maybe there's an example showing something like that done?


Best regards,
/Leo

Reply | Threaded
Open this post in threaded view
|

Re: Using IntelliJ with gradle - any tips on how to get my tests working?

hans_d
Administrator
Hi Leonard,

On Oct 25, 2009, at 12:36 PM, Leonard Axelsson wrote:

Hi,

I'm having problems running my JUnit (GroovyTestCase) tests in IntelliJ as IntelliJ don't know anything about my dependencies (which are specified in the gradle build-file).

My thinking right now is that the easiest solution would probably be to let gradle put all the dependencies in ./lib and point IntelliJ to that folder. Is there any easier or better way to solve this problem? (until the IntelliJ plugin for gradle actually reads the dependencies).

Right now there is no better way. We should be soon able to provide Intellij tasks for generating the iml/ipr files from Gradle. The next step, as you pointed out, would be that the IntelliJ Gradle plugin automatically creates it from the build.gradle.


Also if the "download and put in ./lib"-solution is the way to go I'd appreciate any pointers about how to do it. Maybe there's an example showing something like that done?

task ide << { 
        def libDir = file('lib') // A file object with a path <projectDir>/lib
        ant.delete(dir: libDir)
        copy {
            from configurations.testRuntime
            into libDir
        }
}

- Hans

--
Hans Dockter
Gradle Project Manager

Reply | Threaded
Open this post in threaded view
|

Re: Using IntelliJ with gradle - any tips on how to get my tests working?

Leonard Axelsson
On Oct 25, 2009, at 5:21 PM, Hans Dockter wrote:

Hi Leonard,

On Oct 25, 2009, at 12:36 PM, Leonard Axelsson wrote:

Right now there is no better way. We should be soon able to provide Intellij tasks for generating the iml/ipr files from Gradle. The next step, as you pointed out, would be that the IntelliJ Gradle plugin automatically creates it from the build.gradle.

I look forward to better support and I guess the need for it has become more apparent now with the open sourcing of IntelliJ IDEA.



Also if the "download and put in ./lib"-solution is the way to go I'd appreciate any pointers about how to do it. Maybe there's an example showing something like that done?

task ide << { 
        def libDir = file('lib') // A file object with a path <projectDir>/lib
        ant.delete(dir: libDir)
        copy {
            from configurations.testRuntime
            into libDir
        }
}

- Hans

Thanks Hans, that worked perfectly!


--
Hans Dockter
Gradle Project Manager



/Leo