问题
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>
回答1:
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.
来源:https://stackoverflow.com/questions/8246245/ant-builder-build-failed-einstance