Ecore2Java Generation task [message #427112] |
Mon, 02 February 2009 10:46  |
Eclipse User |
|
|
|
Hi there,
I am using an ant script to generate the java code from an ecore model but
the model, edit and editor projects have dependencies issues.
Does anybody have an idea how to resolve this since I want to fully
automate the process?
Regards,
Achilleas
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Ecore2Java Generation task [message #427193 is a reply to message #427186] |
Thu, 05 February 2009 08:03   |
Eclipse User |
|
|
|
Achilleas,
Comments below.
Achilleas wrote:
> Hi Marcelo,
>
> I have tried your example outside eclipse running the batch file with
> my working paths and it has generated the code.
>
> It does the same thing if I run it within eclipse, within borland, and
> via the headless batch file. To be more precise the .genmodel that it
> is generated contains invalid properties. These properties are the
> Model directory, the Edit directory and the Editor directory.
>
> It is always appended at the start something like:
>
> If I run it within Eclipse:
>
> Model Directory:D:/PhD/Development
> Tools/iMDE/eclipse/workspace/bt.com.cpetypes.metamodel/bt.co m.cpetypes.metamodel/./src/.
>
> Edit Directory: D:/PhD/Development
> Tools/iMDE/eclipse/bt.com.cpetypes.metamodel.edit/./src/.
> Editor Directory:D:/PhD/Development
> Tools/iMDE/eclipse/bt.com.cpetypes.metamodel.editor/./src/.
>
> instead of being the correct ones:
>
> Model Directory: /bt.com.cpetypes.metamodel/src/
> Edit Directory: /bt.com.cpetypes.metamodel.edit/src/
> Editor Directory: /bt.com.cpetypes.metamodel.editor/src/
This is simply the different behavior that you get between stand-alone
and Eclipse.
>
> If I run it within Borland:
>
> Model
> Directory:D:/Borland/Together/bt.com.cpetypes.metamodel/bt.c om.cpetypes.metamodel/./src/.
>
> Edit Directory:
> D:/Borland/Together/bt.com.cpetypes.metamodel.edit/./src/.
> Editor
> Directory:D:/Borland/Together/bt.com.cpetypes.metamodel.edit or/./src/.
>
> instead of being again the correct ones:
>
> Model Directory: /bt.com.cpetypes.metamodel/src/
> Edit Directory: /bt.com.cpetypes.metamodel.edit/src/
> Editor Directory: /bt.com.cpetypes.metamodel.editor/src/
>
> While running the script the code is generated, the edit and editor
> projects generated are not even set to be Java projects. Moreover the
> genmodel includes this incorrect properties I mentioned above.
Again, if you aren't running in Eclipse you don't get all the nice
Eclipse effects.
> When correcting the properties manually from the properties view and
> generating the code by right-click command on the .genmodel the code
> is perfectly ok and I can run the editor as an eclipse instance.
Generally what most people do is preserve their GenModel and reuse it.
The scripts allow you to reload the existing GenModel such that it's
up-to-date with respect to any model changes, but also preserves all the
settings within the *.genmodel.
>
> I don't know why the path is appended and alters the properties. I
> tried everything and searched everywhere to find a solution before
> bothering you again! If you could provide me with a solution I will be
> grateful!
The path of least resistance is to preserve your *.genmodel file, rather
than creating a new one from scratch...
>
> How can I attach a zip file while posting:)??
I use Thunderbird for accessing the newsgroup. It's very nice.
>
> Thanks,
>
> Achilleas
>
>
|
|
|
Re: Ecore2Java Generation task [message #427203 is a reply to message #427193] |
Thu, 05 February 2009 10:17  |
Eclipse User |
|
|
|
Hi Ed and Marcelo,
Thanks to both of you guys for directing me to the solution to my problem.
I think the problem is not resolved completely, meaning that I have
manually created a .genmodel for which I only set manually these three
properties.
This is performed Ed since in any case either using a batch file, Eclipse
or Borland Together the path to the eclipse, borland or batch file is
appended to these three properties. I don't know if that is how the
impementation of the EcoreGeneratorTask works? I presume it is from the
result.
So, your suggestion Ed to preserve a .genmodel let me to the idea to
create a skeleton .genmodel and via the reconcileGenModel="reload"
property to reload the model changes from the .ecore metamodel by
executing the ant script.
Thanks for both your help,
Achilleas
|
|
|
Powered by
FUDForum. Page generated in 0.06802 seconds