Running standalone groovy script from netbeans

I have a set of groovy scripts in different directories (not necessarily netbeans / maven project dirs). I used Notepad++ and Netbeans to create / edit these scripts. I have favorite directories containing scripts in NB so that I can open it in NB (from the favorites tree) without having to have a java project . I usually run cygwin thorugh putty-cyg to execute / test these scripts. Netbeans offers a decent terminal , as well as in the IDE, where I can issue commands without ALT-TAB 'in the IDE and Putty-Cyg. Everything works beautifully.

I just thought how good it would be if I could have Run Script in the context menu where I can run the script (and maybe it can also ask for script arguments). This will save a lot of ALT-TAB ing and cd in the script directory and type groovy scriptname.groovy .

  • Can anyone suggest any plugin that allows me to do this?
  • If I need to write my own plugin for the same task, how do I get started? (I checked nb plugins / platform docs, its overwhelming).
  • If someone is in the same situation as me, feel free to share the experience.

pros / cons of nuclear power plants: fast / no autocomplete, its not an IDE, lang support for groovy

pros / cons of NB: all in one place, lang support, somewhat autocomplete for groovy / bit sluggish, it takes time to start, you must be in the java projects directory (ant / maven) to reap most of the benefits of the IDE

Eclipse support is fine, but it does not do what I ask above. I download the IDEA community to test its support. (UPDATE: No, that's not it. I tried)

+6
source share
1 answer

I feel your pain. I don't know if this is the best solution, but this is what my team did.

GroovyConsole Groovy comes with the convenient Groovy Console tool, where you can quickly play around with scripts. This is our main tool if we want to quickly create or edit scripts. We configure our workstations to open all .groovy files in the Groovy console, which makes it painless and easy to test. It does not have code completion, which is great for us, because it is a dynamic language, and it really doesn't help; in most cases, it just slows you down, waiting for pop-ups to appear anyway (NetBeans).

Existing NetBeans Plugin Here is the NetBeans plugin that brings the Groovy console inside the IDE. I haven't used it, so it really can't talk, but it looks like it might be useful.

Creating Your Own Plugin I have already created a couple of NetBeans plugins, and the first one is always the most difficult, because you cannot just dive into it and create it. You really need to read the documentation to understand how everything works. Don't just try to "figure it out" (talk about form!).

Hope this helps!

+3
source

Source: https://habr.com/ru/post/891589/


All Articles