Gradle in NetBeans IDE 7.1

I recently created a very simplistic Gradle plugin for NetBeans IDE 7.1:

http://plugins.netbeans.org/plugin/41776/gradle

This is how it works. Before getting started, make sure that you installation of NetBeans IDE supports Groovy.

Then, install the plugin, and you'll see this:

Then, after installing the plugin, before doing anything else, register your Gradle installation:

Next, go to the New File dialog and choose the "Gradle Desktop Build Script":

On the next page, make sure to name the script "build":

Click Finish in the dialog above and your new Gradle script will be created.

Switch to the Files window and you should now be able to expand the "build.gradle" file that you find there:

As you can see, you can right-click any of the Gradle tasks and run them. You can also double-click the file node to open the file in the Groovy editor:

The file above is exactly the content you'll get when choosing the "Gradle Desktop Build Script". When you make changes in the Gradle file, the node hierarchy will automatically be updated.

Make sure that you follow the steps above, in the order described above, before leaving comments about the plugin not working for you.

Comments:

Thanks a lot, Netbeans needs this to stay competitive. Though I wish this plugin was open source and not just you.

Posted by guest on March 10, 2012 at 12:04 AM PST #

It IS open source. Do you want to contribute?

Posted by Geertjan on March 10, 2012 at 12:19 AM PST #

Sorta. I'm typically a Netbeans users, but I've been having problems working with the Gradle codebase, so I switched to Intellij, which has better gradle support. I'd like to use Netbeans if possible and could spend a little time helping. First problem is having .gradle files being renamed to build.gradle. Is there a git/hg repo for this plugin? Is the CI for building/releasing the plugin?

How far away is the plugin from supporting the blind importing of a build.gradle as a Project? Like how a maven project can be opened.

Posted by Justin Ryan on March 12, 2012 at 12:19 PM PDT #

NB 7.1 trying to expand build.gradle and IDE sits at Loading task...

Starting Gradle daemon
Starting daemon process: workingDir = C:\Documents and Settings\SGoldsmith\.gradle\daemon\1.0-milestone-9, daemonArgs: [C:\Program Files\Java\jdk1.6.0_31\bin\java.exe, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252, -cp, C:\projects\gradle-1.0-milestone-9\lib\gradle-launcher-1.0-milestone-9.jar, org.gradle.launcher.daemon.bootstrap.GradleDaemon, 1.0-milestone-9, C:\Documents and Settings\SGoldsmith\.gradle\daemon, 10800000, 7655365d-7928-45b1-bda1-8e6d4b945555, -XX:MaxPermSize=256m, -XX:+HeapDumpOnOutOfMemoryError, -Xmx1024m, -Dfile.encoding=windows-1252]
SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor org.openide.nodes.AsynchChildren
java.lang.NullPointerException
at org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer.makeUninheritable(WindowsProcessInitializer.java:54)
at org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer.initialize(WindowsProcessInitializer.java:41)
Caused: org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer$ProcessInitializationException: Failed to configure the standard stream handles to be 'uninheritable'.
at org.gradle.internal.nativeplatform.jna.WindowsProcessInitializer.initialize(WindowsProcessInitializer.java:49)
at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(DefaultDaemonStarter.java:92)
Caused: org.gradle.api.GradleException: Could not start Gradle daemon.
at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startProcess(DefaultDaemonStarter.java:103)
at org.gradle.launcher.daemon.client.DefaultDaemonStarter.startDaemon(DefaultDaemonStarter.java:82)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.createConnection(DefaultDaemonConnector.java:100)
at org.gradle.launcher.daemon.client.DefaultDaemonConnector.connect(DefaultDaemonConnector.java:70)
at org.gradle.launcher.daemon.client.DaemonClient.execute(DaemonClient.java:104)
at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(DaemonGradleLauncherActionExecuter.java:44)
at org.gradle.tooling.internal.provider.DaemonGradleLauncherActionExecuter.execute(DaemonGradleLauncherActionExecuter.java:31)
at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(LoggingBridgingGradleLauncherActionExecuter.java:53)
at org.gradle.tooling.internal.provider.LoggingBridgingGradleLauncherActionExecuter.execute(LoggingBridgingGradleLauncherActionExecuter.java:30)
at org.gradle.tooling.internal.provider.DefaultConnection.run(DefaultConnection.java:105)
at org.gradle.tooling.internal.provider.DefaultConnection.getTheModel(DefaultConnection.java:98)
at org.gradle.tooling.internal.provider.DefaultConnection.getModel(DefaultConnection.java:80)
at org.gradle.tooling.internal.consumer.LazyConnection$3.run(LazyConnection.java:90)
at org.gradle.tooling.internal.consumer.LazyConnection$3.run(LazyConnection.java:88)
at org.gradle.tooling.internal.consumer.LazyConnection.withConnection(LazyConnection.java:98)
at org.gradle.tooling.internal.consumer.LazyConnection.getModel(LazyConnection.java:88)
at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$2.run(ProgressLoggingConnection.java:61)
at org.gradle.tooling.internal.consumer.ProgressLoggingConnection$2.run(ProgressLoggingConnection.java:59)
at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.run(ProgressLoggingConnection.java:74)
at org.gradle.tooling.internal.consumer.ProgressLoggingConnection.getModel(ProgressLoggingConnection.java:59)
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:53)
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$2.run(DefaultAsyncConnection.java:51)
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:71)
Caused: org.gradle.tooling.GradleConnectionException: Could not fetch model of type 'BuildableProject' using Gradle installation 'C:\projects\gradle-1.0-milestone-9'.
at org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:46)
at org.gradle.tooling.internal.consumer.DefaultAsyncConnection$3.run(DefaultAsyncConnection.java:73)
at org.gradle.messaging.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:63)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[catch] at java.lang.Thread.run(Thread.java:662)

Posted by guest on March 16, 2012 at 06:39 AM PDT #

Sources:

https://blogs.oracle.com/geertjan/entry/sources_of_netbeans_gradle_plugin

Posted by Geertjan on March 24, 2012 at 04:42 AM PDT #

>IDE sits at Loading task...

Same here.

Posted by Roel Van der Paal on April 09, 2012 at 07:36 AM PDT #

Do you think it would make sense to create a gradle project type for the netbeans platform . You could then provide templates for the creation of simple and multi project builds. Also I would like to override the error checking and code completion in the java editor to use the classpath provided by the gradle build file. Can you give me any pointers as to how that might be done and if it makes sense to do so?

Posted by guest on October 02, 2012 at 06:36 AM PDT #

Here's the Gradle plugin: http://plugins.netbeans.org/plugin/44510/gradle-support

Posted by Geertjan on October 02, 2012 at 07:03 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
« March 2015
SunMonTueWedThuFriSat
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
    
       
Today