Question

Trying to use AcceleoCompiler with an Ant Builder. When i build with ant i get the following error:

compile:
[acceleoCompiler] eINSTANCE

BUILD FAILED
C:\Users\random\workspace\foo\bar\Framework\buildstandalone.xml:52: eINSTANCE

Here is how i have my target defined and some other information that could be important. I am very new to ant and acceleo. Let me know if there is any other information you need. I am not sure that any of the below is correct, let me know if there is anything i need to change. The line that it is complaining about is packagesToRegister="org.eclipse.acceleo.parser.compiler.AcceleoCompiler"> I do not know if that line is correct at all, i was just guessing.

<path id="Framework.classpath">
    <path refid="Framework.libraryclasspath"/>
</path>

<taskdef id="acceleoCompiler" name="acceleoCompiler" classname="org.eclipse.acceleo.parser.compiler.AcceleoCompiler"
         classpathref="Framework.libraryclasspath">
</taskdef>

<target name="compile">
<acceleoCompiler sourceFolder="${SOURCE_FOLDER}"
                 outputFolder="${OUTPUT_FOLDER}"
                 dependencies=""
                 binaryResource="true"
                 packagesToRegister="org.eclipse.acceleo.parser.compiler.AcceleoCompiler"></acceleoCompiler>
</target>
Was it helpful?

Solution

The line packagesToRegister is a reference to the package of your metamodel for example, if your generator is using the UML metamodel, you should register the package org.eclipse.uml.uml2.UMLPackage (or something like that), you can see the package needed to register in the method registerPackage of the Java launcher class of your generator. The AcceleoCompiler is not a package to register (that's why the variable eINSTANCE is not found on AcceleoCompiler). If you have generated the code of your own metamodel, you should look for a **Package class generated by EMF.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top