Intellij 13 opening existing gradle projects

Intellij 13 does not appear to recognize existing (created in Intellij IDEA 12) gradle based projects.  My question is: Is this working as designed or should this behavior be logged as a bug?

I really hope I don't have to rework each of my idea/gradle projects to upgrade to Inteillij 13.

7 comments
Comment actions Permalink

Hi Bill,

there is no backward compatibility with IntelliJ 12 gradle projects at the moment. There was big rework of gradle integration in IJ 13.
Try to use import project wizard to open your gradle projects created in IJ 12 for the first time.

Note: do not forget to backup your IJ project files, before the import if you have something special in your current projects configurations

0
Comment actions Permalink

I usually love JetBrains and IDEA, but the situation with IDEA 13 and Gradle projects seems like a complete disaster. I had a Gradle project that worked just fine in IDEA 12. IDEA 13 won't even property run it. Worse, I can't even open the project in 12 any longer once opening it in 13. There was no warning about the project files being changed.

Next, I tried creating a totally new Gradle project in 13 and moving my code over from the old project to the new one. In 13, no matter what I do, nothing in my buildSrc folder is added to the classpath, so everything in the root project that depends on the subproject is marked as an error. If I manually force the buildSrc/src/main/groovy as a source folder, the errors stop. But after closing and reopening the project, the subproject source folder is removed and the same problems appear again.

I'm so used to IDEA being a joy to work with that it's hard to understand how something this broken could have made it into the 13 release. Not only does it seem like the Gradle support in 13 simply doesn't work, but having it just destroy perfectly good IDEA 12 Gradle projects with no warning makes it all even worse.

0
Comment actions Permalink

Hi Brian,

IntelliJ v13 uses gradle build scripts as a "single source of truth", that's why your manual changes will be overridden.
This is a conceptual difference between IntelliJ gradle integration v12 and v13 on architectural level.
With 13 all you need in gradle project, you should be able to configure in build scripts.
For gradle projects in v13, you do not need to backup IDE files anymore, because you can always get it from scratch using project import wizard.

btw: if you want to have an IDE support of "buildSrc" include "buildSrc" in your settings.gradle file:

build.gradle

project("build-src") {      description = "Exposes gradle buildSrc for IDE support"      apply plugin: "groovy"      dependencies {           compile gradleApi()           compile localGroovy()      } }

settings.gradle

include "your-module"
// other modules definition
// Exposes gradle buildSrc for IDE support include "buildSrc" rootProject.children.find{ it.name == "buildSrc" }.name = "build-src"

0
Comment actions Permalink

if you still have any issues with gradle projects, could you attach the project to illustrate the problems or submit a bug at http://youtrack.jetbrains.com for Subsystem: Gradle?

0
Comment actions Permalink

Thanks, I'll try that.

By the way, I'm really not trying to be harsh. Like I said, I'm so used to IDEA "just working right" that when I run into something like this, it's jarring and unexpected. Given the metrics JetBrains collects, you would know better than I do how many people are actually using Gradle with IDEA. But it seems like a couple of detailed blog entries or help file entries that really explain what has changed in terms of Gradle integration between 12 and 13 would be very helpful?

Thanks,

Brian

0
Comment actions Permalink

It's also worth noting that I can run these Gradle builds from the command line without any problem. Since Gradle automatically handles buildSrc, it just seems like IDEA should as well. Just pointing out that I don't need a gradle.settings like you're describing to run this directly through Gradle at the command line...

0
Comment actions Permalink

yep, I agree, it's a good idea to handle buildSrc without explicit configuration. This feature might be added in v13.1.

0

Please sign in to leave a comment.