Gradle in NetBeans (Part 1)

Martin Skurla and I have a basic Gradle plugin working in NetBeans IDE:

As you can see, ".gradle" files are recognized, are shown in the Projects window within a dedicated folder node, and are parsed to show Gradle tasks as children of the file node.

Then, when "Run Gradle" action is invoked on a Gradle task node, which also happens when the Gradle task node is double-clicked, the related Gradle task is run, with output in the Output window.

There's integration with the Groovy Editor, so that's how the syntax coloring and other editor features, such as mark occurrences, shown above, is provided.

We spent most of the time figuring out the regex expression for the node display name and on weird java.lang.ProcessBuilder syntax; the rest of the plugin is pretty standard NetBeans API code.

Not only supported in NetBeans modules, as you can see:


Now, does anyone know what a Gradle task for building a NetBeans module looks like? And for a standard Java SE application and for a web application? I.e., we need to map all the Ant tasks (build, run, debug) to Gradle tasks, if we're not mistaken in our understanding of Gradle.

Can anyone help answer this question or advise in any other way? What should the next features be that should be worked on in this context? And who would be interested in contributing code?

Comments:

Hi Geertjan,

it seems you twitter account was hacked, I got a strange direct message from you within a even stranger link to a fake twitter page, I think you should change your pass.

Kind regards,

Fabian

Posted by funfried on September 05, 2011 at 08:04 PM PDT #

Whilst I can't help with code, I'll be happy to test out Gradle support as you build it - I'm familiar with Ant and Maven, but am new to Gradle. Looking forward to its support in Netbeans!

Posted by Martijn Verburg on September 05, 2011 at 08:05 PM PDT #

I am a big fan of Gradle so I can help in testing and comments. Once I get some knowledge in NB I can help in coding!

Suggestion:
You may display all the available tasks (output of 'gradle tasks' command) This may be too long display but you can group them like they display.

I feel that we can have a separate syntax highlighter for Gradle. After all its a DSL :)

A very nice attempt :) Keep it up and keep going.

Posted by Rajmahendra on September 06, 2011 at 12:39 AM PDT #

I am interested in being able to do multi-project builds, and it seems like this might be one of the things that gradle is targetting.

I presume the approach would be to create a project whose sole purpose in life is to orchestrate the overall build process.

It seems that there is some overlap there between this type of project, and the project group. Would it make sense for a project group to be something that can be shared with others and have a build script associated with it? Perhaps it would be a project entity within which the project group definition and build script would be held to make it able to be versioned etc?

ie: it would be nice to be able to share a project group with other developers and have a build script that would manage the correct build procedure for all projects in the group.

Posted by Peter Belbin on September 07, 2011 at 02:18 AM PDT #

This is excellent news.
We've just con through some hell introducing Maven - which I now thoroughly hate - it is so inflexible and can only handle the most trivial of projects.
We also had some very complex Ant scripts because at least you could do things with Ant even though it was awkward to work with it's XML.
Then finally we tried Gradle and simplified so much, but there was no IDE support (the one good thing about Maven).
I was hoping a NB plugin would appear soon... yahoo!

Posted by swpalmer on September 08, 2011 at 03:41 AM PDT #

Keep up the good work !!! I think gradle is the way forward but there wasn't a plugin for Netbeans until now. Any chance for a release date? :)

Posted by Nik on September 15, 2011 at 08:19 AM PDT #

Geertjan - do you know if this plugin was ever published somewhere (e.g. java.net , github ) ?

Posted by Alex K on January 05, 2012 at 04:54 PM PST #

http://java.net/projects/nbgradlesupport

Posted by Geertjan on January 05, 2012 at 05:14 PM PST #

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