Ecore2Java ant task [message #430913] |
Wed, 17 June 2009 09:21  |
Eclipse User |
|
|
|
Hi there,
I am generating the model,edit, editor source code using the following EMF
ant task that I have defined:
<project name="Ecore2Java Generation" default="GenerateJava" basedir=".">
<property name="model" value="./model/product.ecore"/>
<property name="genmodel" value="./model/product.genmodel"/>
<taskdef name="emfGen"
classname="org.eclipse.emf.importer.ecore.taskdefs.EcoreGeneratorTask "/>
<target name="GenerateJava">
<echo message="Generate the model,edit and editor Java code from the
ecore model"/>
<emf.Ecore2Java model="${model}"
genModel="${genmodel}"
reconcileGenModel="reload"
generateJavaCode="true"
generateModelProject="true"
generateEditProject="true"
generateEditorProject="true"
modelProject="bt.com.ccm.product"
modelProjectFragmentPath="src">
<arg line="-editProject bt.com.ccm.product.edit src"/>
<arg line="-editorProject bt.com.ccm.product.editor src"/>
</emf.Ecore2Java>
</target>
</project>
The problem is that for the model project generated is not an EMF project
and subsequently does not include the necessary EMF plug-in dependencies.
These results in errors since EMF specific classes cannot be resolved.
Actually the output messages displayed onto the console when running the
task indicate that for the edit and editor projects the ant tasks creates
first an EMF project prior to generating the code; while for the model
project this does not occur.
Does anyone has any idea about this problem?
Thanks,
Achilleas
|
|
|
|
|
|
|
|
|
Re: Ecore2Java ant task [message #431206 is a reply to message #431205] |
Thu, 02 July 2009 10:05   |
Eclipse User |
|
|
|
Achilleas,
Comments below.
Achilleas wrote:
> Ed,
>
> This is the plugin.xml generated for the model project:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <?eclipse version="3.0"?>
>
> <!--
> <copyright>
> </copyright>
>
> $Id$
> -->
>
> <plugin>
>
> <extension point="org.eclipse.emf.ecore.generated_package">
> <package
> uri="http://www.com.bt/2009/product"
> class="product.ProductPackage"/>
> </extension>
>
> </plugin>
>
>
> This is the MANIFEST.MF for the model project:
>
> Manifest-Version: 1.0
> Bundle-ManifestVersion: 2
> Bundle-Name: %pluginName
> Bundle-SymbolicName: bt.com.ccm.product;singleton:=true
> Bundle-Version: 1.0.0
> Bundle-ClassPath: .
> Bundle-Vendor: %providerName
> Bundle-Localization: plugin
> Bundle-RequiredExecutionEnvironment: JavaSE-1.6
> Export-Package: product,
> product.impl,
> product.util
> Require-Bundle: org.eclipse.core.runtime,
> org.eclipse.emf.ecore;visibility:=reexport
So the dependency to get it to compile is there and should work.
> Bundle-ActivationPolicy: lazy
>
> As soon as the model, edit and editor projects are generated and the
> errors appear, I configure the build path of the model project adding
> merely the "org.eclipse.emf.ecore_2.4.0........." plug-in dependency
> and all the errors dissapear and the plug-ins work just fine!
But that dependency is already there. It sounds like perhaps the
..classpath file is not being updated, but that should happen
automatically... What if you just invoke PDE Tools->Update
classpath...? Does that do the trick too?
>
> It seems very strange and I have run the ant task so many times but
> still the same problem!
>
> Thanks,
>
> Achilleas
>
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06765 seconds