More Serious Attempt at a NetBeans Gradle Plugin

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

Comments:

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.

Posted by Tim Boudreau on July 18, 2012 at 07:11 PM PDT #

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.

Posted by Graham Smith on September 28, 2012 at 11:47 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
12
13
14
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today