You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@netbeans.apache.org by rohan julka <ro...@gmail.com> on 2019/08/20 23:53:48 UTC
Add compilation classpath support to groovy classes created from a
Netbeans plugin
Hi,
we have a Netbeans plugin for our application that mainly allows you to create a ".groovy" script on the fly that will be placed under the system temp folder.The problem we have is that, when the groovy class is created, Netbeans does not recognize imports and code autocompletion is not available.
Netbeans correctly resolves imports like:
import java.util.List
although the groovy file is in the system temp folder, but fails in resolving all others e.g.
import groovy.transform.CompileStatic
import org.apache.syncope.core.persistence.api.dao.Reportlet
import org.xml.sax.SAXException
import java.util.concurrent.atomic.AtomicReference
Any idea on how to set a specific classpath to the plugin source code (we know what dependencies to add but don't know where to put them in order to let groovy scripts see them) so that Netbeans will recognize related imports and so code autocompletion will be available?
Best regards,
Rohan
Re: Add compilation classpath support to groovy classes created from
a Netbeans plugin
Posted by Neil C Smith <ne...@apache.org>.
On Wed, 21 Aug 2019, 00:54 rohan julka, <ro...@gmail.com> wrote:
> Any idea on how to set a specific classpath to the plugin source code (we
> know what dependencies to add but don't know where to put them in order to
> let groovy scripts see them) so that Netbeans will recognize related
> imports and so code autocompletion will be available?
>
I've done this for in-memory Java files. I assume the Groovy support will
require something similar. Register a ClassPathProvider in global services,
and also make sure the paths are in the global path registry.
My code doing this is at
https://github.com/praxis-live/praxis-live/tree/master/praxis.live.pxj/src/org/praxislive/ide/pxj
Best wishes,
Neil