Ant Builder 构建失败 eINSTANCE [英] Ant Builder Build Failed eINSTANCE

查看:33
本文介绍了Ant Builder 构建失败 eINSTANCE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将 AcceleoCompiler 与 Ant Builder 结合使用.当我使用 ant 构建时,出现以下错误:

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

这是我如何定义目标以及其他一些可能很重要的信息.我对 ant 和 Acceleo 很陌生.如果您需要任何其他信息,请告诉我.我不确定以下任何一项是否正确,如果我需要更改任何内容,请告诉我.它抱怨的行是 packagesToRegister="org.eclipse.acceleo.parser.compiler.AcceleoCompiler"> 我不知道那行是否正确,我只是在猜测.

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>

推荐答案

packagesToRegister 行是对元模型包的引用,例如,如果你的生成器使用的是 UML 元模型,你应该注册包 org.eclipse.uml.uml2.UMLPackage(或类似的东西),您可以在生成器的 Java 启动器类的方法 registerPackage 中看到需要注册的包.AcceleoCompiler 不是要注册的包(这就是在 AcceleoCompiler 上找不到变量 eINSTANCE 的原因).如果你已经生成了你自己的元模型的代码,你应该寻找一个由 EMF 生成的 **Package 类.

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.

这篇关于Ant Builder 构建失败 eINSTANCE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆