Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Eclipse compiler, DSL, ant
Eclipse compiler, DSL, ant [message #1061802] Tue, 04 June 2013 07:30 Go to next message
michael m is currently offline michael mFriend
Messages: 17
Registered: March 2013
Junior Member
Hi,

i'm trying to create an ant build script to package my dsl project into a jar file.

1. Start Eclipse which contains my grammar project.
2. Run Eclipse Application from here.
3. Create example project.

From here i can debug my dsl files localy.
From eclipse i can export the project (export->jar file) or also generate an ant build file (export->ant buildfile) for it.
But both options generate a different size for the class files compared to the "/bin" folder in eclipse.

If i deploy now the jar file i cannot debug my dsl files anymore. But if i
move the class files which eclipse generated in /bin into the jar file and override
them and deploy again, then it works.

Can someone give me a hint on what the export option of Eclipse is doing different?
Or how to compile my files in ant the same way as eclipse is doing it?

Thanks,
Michael

[Updated on: Tue, 04 June 2013 07:31]

Report message to a moderator

Re: Eclipse compiler, DSL, ant [message #1061817 is a reply to message #1061802] Tue, 04 June 2013 08:39 Go to previous messageGo to next message
Jan Koehnlein is currently offline Jan KoehnleinFriend
Messages: 760
Registered: July 2009
Location: Hamburg
Senior Member
Did you make sure your src-gen folders are listed as source folders in
the build.porperties of the project?

Am 04.06.13 09:30, schrieb michael b:
> Hi,
>
> i'm trying to create an ant build script to package my dsl project into
> a jar file.
>
> 1. Start Eclipse which contains my grammar project.
> 2. Run Eclipse Application from here.
> 3. Create example project.
>
> From here i can debug my dsl files localy.
> From eclipse i can export the project (export->jar file) or also
> generate an ant build file (export->ant buildfile) for it.
> But both options generate a different size for the class files compared
> to the "/bin"
> folder in eclipse.
>
> If i deploy now the jar file i cannot debug my dsl files anymore. But if
> i move the class files which eclipse generated in /bin into the jar file
> and override them and deploy again, then it works.
>
> Can someone give me a hint on what the export option of Eclipse is doing
> different?
> Or how to compile my files in ant the same way as eclipse is doing it?
>
> Thanks,
> Michael


--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com


---
Get professional support from the Xtext committers at www.typefox.io
Re: Eclipse compiler, DSL, ant [message #1061847 is a reply to message #1061817] Tue, 04 June 2013 10:57 Go to previous message
michael m is currently offline michael mFriend
Messages: 17
Registered: March 2013
Junior Member
Hi Jan,

unfortunately that didn't solve it Sad
In my case it was the /output/src folder instead of the src-gen folder so i adjusted it but its still the same result.

Attach is my build file which is generated from eclipse. (I removed some includes to make it shorter here which are marked by "..."):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <project basedir="." default="build" name="TestExtension">
    <property environment="env"/>
    <property name="ECLIPSE_HOME" value="/absolute/path/here/eclipse-juno"/>
    <property name="debuglevel" value="source,lines,vars"/>
    <property name="target" value="1.7"/>
    <property name="source" value="1.7"/>
    <path id="Plug-in Dependencies.libraryclasspath">
        <pathelement location="${ECLIPSE_HOME}/plugins/com.ibm.icu_4.4.2.v20110823.jar"/>
        ...
        <pathelement location="../../Dsl/com.my.dsl/bin"/>
    </path>
    <path id="TestExtension.classpath">
        <pathelement location="bin"/>
        <path refid="Plug-in Dependencies.libraryclasspath"/>
        ...
        <pathelement location="../commons-codec-1.3.jar"/>
    </path>
    <target name="init">
        <mkdir dir="bin"/>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="src">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
        <copy includeemptydirs="false" todir="bin">
            <fileset dir="output/src">
                <exclude name="**/*.java"/>
            </fileset>
        </copy>
    </target>
    <target name="clean">
        <delete dir="bin"/>
    </target>
    <target depends="clean" name="cleanall"/>
    <target depends="build-subprojects,build-project" name="build"/>
    <target name="build-subprojects"/>
    <target depends="init" name="build-project">
        <echo message="${ant.project.name}: ${ant.file}"/>
        <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
            <src path="src"/>
            <src path="output/src"/>
            <classpath refid="TestExtension.classpath"/>
        </javac>
    </target>
    <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/>
</project>


"ant build" basically generates the class files also into the bin folder they just have a different size as if i generate the class files from within eclipse.
Any ideas?

Exporting from eclipse works though. I just can't make it with ant.

Cheers,
Michael

[Updated on: Wed, 05 June 2013 06:38]

Report message to a moderator

Previous Topic:Using XCore Model for XText DSL
Next Topic:[XBase] Find JvmType for specific class name?
Goto Forum:
  


Current Time: Tue Apr 23 07:18:14 GMT 2024

Powered by FUDForum. Page generated in 0.02813 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top