X

Geertjan's Blog

  • July 16, 2012

More Serious Attempt at a NetBeans Gradle Plugin

Geertjan Wielenga
Product Manager

After a few small skirmishes in this area, here's a more serious attack:

What you see above is that a Gradle build file can be expanded, exposing its tasks, which can be double-clicked to be invoked. Also, the JAR dependencies of the project are visualized and can be browsed just like any other JAR file in NetBeans. When a change is made in the file, the task hierarchy and the dependency hierarchy are automatically rebuilt.

Any folder that has a file named 'build.gradle', on the highest level within the folder, is recognized as a Gradle project and can be opened:

All of the features above are then automatically available. There's also a file template for creating a new Gradle build file from scratch, for an existing project that doesn't yet have Gradle support. 

The final step, at least for this version of the plugin that provides basic Gradle support, is to work with the class path. I'll need to look at how this is done for the Grails project type, as well as, maybe the Maven project type. Not only the Java classes in 'src' should be on the classpath, but also the Java classes in the JARs retrieved via the declared dependencies.

The sources are here, anyone is free to do whatever they want with them:

http://java.net/projects/nb-api-samples/sources/api-samples/show/versions/7.2/misc/GradleProjectType

Join the discussion

Comments ( 2 )
  • Tim Boudreau Thursday, July 19, 2012

    Built it and tried opening a gradle project with it; event queue was blocked for several minutes, followed by an exception saying it couldn't install gradle or something like that. It looked like populating the classpath was the culprit for the hanging part - probably just needs to start with a dummy classpath until gradle is ready.

    Maybe I'll poke at it further, but I've got a deadline coming up so it won't be soon.

    A good project to test with might be Netflix Curator on GitHub - it's a large-ish, real-world gradle project.


  • Graham Smith Friday, September 28, 2012

    As long as it's fully able to build a JavaFX project without nasty hacks like maven than it'll be a winner in my book.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha