RES: Re: Groovy Netbeans Platform RCP Application

Artur Carlos Hertel Sonnenhohl <[email protected]>
Newsgroups gmane.comp.java.netbeans.modules.openide.devel
Message-ID <[email protected]>
Hello Sven,

At the moment we intend to continue with Ant since we have some custom scripts and also because is the standard of the Netbeans RCP.

Why you think that Gradle will fix my problem?

Thanks


Artur Carlos Hertel Sonnenhohl
Desenvolvimento de Software
Fone: +55 (47) 3276-7549
WEG Drives & Controls Automação Ltda
http://www.weg.net<http://www.weg.net/>

De: Sven Reimers [mailto:[email protected]]
Enviada em: domingo, 2 de outubro de 2016 16:27
Para: [email protected]; Martin Klähn
Assunto: [platform-dev] Re: Groovy Netbeans Platform RCP Application


Would you be willing to use Gradle as a build environment?

Just asking because we (Martin and me) are trying to get NetBeans RCP apps builing and running with Gradle. This should fix a lot of your problems..

-Sven

Am 01.10.2016 17:26 schrieb "geertjan wielenga" <[email protected]<mailto:[email protected]>>:

On 30-9-2016 22:17, Artur S wrote:
Hello,

Im trying to integrate Groovy into my netbeans platform application, i tried to follow the tutorial from Gj from the link https://blogs.oracle.com/geertjan/entry/running_groovy_on_the_netbeans but this tutorial is very outdated and doesn´t work anymore.

FYI: It is not a tutorial, it is a blog. It was written, as you can see, in 2009 -- if it were to still work, it would be a big surprise.

For all these things, it is always best to check a project reproducing your problem into GitHub, together with a README that describes the problem so that someone can reproduce it. Then send a link to the GitHub repo here.

Gj



Then i modified the build.xml from my specific module to this:

<import file="nbproject/build-impl.xml"/>

    <taskdef name="groovyc"
             classpath="ext/groovy-all-2.4.7.jar"
             classname="org.codehaus.groovy.ant.Groovyc"/>

    <target name="-javac-init" depends="build-init,-javac-init-nbjdk,-javac-init-bootclasspath-prepend,-javac-init-no-bootclasspath-prepend">
        <path id="cp">
            <pathelement path="${module.classpath}"/>
            <pathelement path="${cp.extra}"/>
        </path>
        <path id="processor.cp">
            <pathelement path="${module.processor.classpath}"/>
            <pathelement path="${cp.extra}"/>
        </path>
        <!--         Unlike ${module.classpath}, this does not use publicPackageJarDir, since processors need not be in public packages.
        Also needs to include transitive dependencies. -->
        <mkdir dir="build/classes"/>
        <groovyc srcdir="src" destdir="build/classes/" >
            <classpath refid="cp"/>
        </groovyc>
    </target>


Basically what i have done is overwrited the target “-javac-init” wich is default from the platform, extending it with the groovy compilation.

My groovy classes now are compiling and running, but i think i have some problems in my classpath, first i need to add every module that i need into the dependencies even if the module is already imported by reference (this doesn´t happen just with java), but the main problem is that im trying to use JavaFX into this groovy classes and im having the following error during compilation:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
General error during class generation: java.lang.NoClassDefFoundError: Unable to load class javafx.scene.control.TextField due to missing dependency javafx.scene.control.Control
java.lang.RuntimeException: java.lang.NoClassDefFoundError: Unable to load class javafx.scene.control.TextField due to missing dependency javafx.scene.control.Control
                at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1089)
                at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1067)
                at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:591)
                at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:569)

Other classes from JavaFX compile fine but this one isn´t compiling, im really dont know what to do. I already tried to create a library wrapper from javafxrt.jar but it doesn´t help at all.

When i create a new netbeans project (not using platform) and use Groovy with JavaFX it works fine but the compilation process is different and the build logic is very complex to understand quickly.

Is someone already using netbeans platform with Groovy and can help me to configure my build.xml in the right way, i think the problem really is with my classpath.

Thanks.

Artur Carlos Hertel Sonnenhohl
Desenvolvimento de Software
Fone: +55 (47) 3276-7549<tel:%2B55%20%2847%29%203276-7549>
WEG Drives & Controls Automação Ltda
http://www.weg.net<http://www.weg.net/>




Clique <a href="http://disclaimer.weg.net/" target=_blank>aqui </a> caso voc&#xea; n&#xe3;o seja o destinat&#xe1;rio deste email, ou desejar conhecer nossa pol&#xed;tica de privacidade.
Click <a href="http://disclaimer.weg.net/" target=_blank>here </a> if you are not the intended recipient, or in case you want to know our privacy policy.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.