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

View: New views
3 Messages — Rating Filter:   Alert me  

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

by Leonard Axelsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


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

by hdockter :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


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

by Leonard Axelsson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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