Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » how to use ant to generate genmodel
how to use ant to generate genmodel [message #400771] Fri, 05 May 2006 12:49 Go to next message
larry is currently offline larryFriend
Messages: 4
Registered: July 2009
Junior Member
hello, i want to generate a *.genmodel from a given ecore file using the
ant, how could i just run the ant file and can generate the genmodel and
finally get the gnerated code, is that possible to do it in this way? i
can't find some useful information, does anyone have some simple exanples
of this ant file, i will be grateful for some useful examples, thanks
larry
Re: how to use ant to generate genmodel [message #400872 is a reply to message #400771] Fri, 05 May 2006 15:07 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------090608090208040801060106
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Larry,

We have an Ant task for XSD -> GenModel but not one for Ecore ->
GenModel so the best I can do is point you to that as an example.

http://download.eclipse.org/tools/emf/xsd/2.2.0/javadoc/org/ eclipse/xsd/ecore/importer/taskdefs/XSDGeneratorTask.html

If someone works on Ecore -> GenModel, that would be a nice contribution
to the project...


larry wrote:
> hello, i want to generate a *.genmodel from a given ecore file using
> the ant, how could i just run the ant file and can generate the
> genmodel and finally get the gnerated code, is that possible to do it
> in this way? i can't find some useful information, does anyone have
> some simple exanples of this ant file, i will be grateful for some
> useful examples, thanks larry
>


--------------090608090208040801060106
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Larry,<br>
<br>
We have an Ant task for XSD -&gt; GenModel but not one for Ecore -&gt;
GenModel so the best I can do is point you to that as an example.<br>
<blockquote><a
href=" http://download.eclipse.org/tools/emf/xsd/2.2.0/javadoc/org/ eclipse/xsd/ecore/importer/taskdefs/XSDGeneratorTask.html"> http://download.eclipse.org/tools/emf/xsd/2.2.0/javadoc/org/ eclipse/xsd/ecore/importer/taskdefs/XSDGeneratorTask.html</a><br>
</blockquote>
If someone works on Ecore -&gt; GenModel, that would be a nice
contribution to the project...<br>
<br>
<br>
larry wrote:
<blockquote cite="mid4cce63b3f17ffc604ca888c99b63dc46$1@www.eclipse.org"
type="cite">


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: how to use ant to generate genmodel [message #400950 is a reply to message #400872] Tue, 09 May 2006 22:53 Go to previous messageGo to next message
larry is currently offline larryFriend
Messages: 4
Registered: July 2009
Junior Member
hi:
i have checked this xsd2genmodel package, it seems useful, but i can't
use it, i didn't find any related information of this ecore2genmodel in
ant build. i think the better way to do that is to use ant taskdef to
define the task in the java code, but also i can't find enough information
in this, if you have some information about how to use build a genmodel in
the workspace and load ecore file in this genmodel, please show me an
example, thank you inadvance
regards
larry
Re: how to use ant to generate genmodel [message #400954 is a reply to message #400950] Wed, 10 May 2006 11:20 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Larry,

Marcelo is looking into providing an Ant task for this. Maybe it will
be ready for tomorrow's build. In the mean time, all I can do is point
you at source code. Such as the support for -ecore2GenModel in the
org.eclipse.emf.codegen.ecore.Generator.


larry wrote:

> hi:
> i have checked this xsd2genmodel package, it seems useful, but i
> can't use it, i didn't find any related information of this
> ecore2genmodel in ant build. i think the better way to do that is to
> use ant taskdef to define the task in the java code, but also i can't
> find enough information in this, if you have some information about
> how to use build a genmodel in the workspace and load ecore file in
> this genmodel, please show me an example, thank you inadvance
> regards
> larry
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: how to use ant to generate genmodel [message #520097 is a reply to message #400954] Thu, 11 March 2010 07:13 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

This should work! Please be sure to include modelproject="" and modelprojectfragmentpath="", as well as the other "I do not want..." options. If you do not include them, the ant task just throws nasty unexplained exceptions at you.
(IndexOutOfBounds, etc...)

	<target name="makeGenModel">
	<emf.Ecore2Java
	generateeditorproject="false"
	generateeditproject="false"
	generatemodelproject="false"
	generatejavacode="false" 
	genmodel="model/imported.genmodel"
	model="model/sourceMetamodel.ecore"
	reconcilegenmodel="overwrite"
	validatemodel="true"
	modelproject=""	modelprojectfragmentpath=""/>
	</target>
Re: how to use ant to generate genmodel [message #529102 is a reply to message #520097] Fri, 23 April 2010 00:17 Go to previous messageGo to next message
saadbin abid is currently offline saadbin abidFriend
Messages: 61
Registered: October 2009
Location: Ireland
Member
Hello Joerr Guy Suess,
I am newbie to writing Ant scripts. I am interested in ant task for generating genmodel from given ecore model. I just saw that you have solved the similar problem. Could you please help me write an ant task which can take ecore model as an input and generate genmodel as a result? or do you have existing code which can solve the mentioned purpose?

thank you very much.
regards
saad
Re: how to use ant to generate genmodel [message #529104 is a reply to message #529102] Fri, 23 April 2010 00:20 Go to previous messageGo to next message
Jörn Guy Süß is currently offline Jörn Guy SüßFriend
Messages: 320
Registered: July 2009
Location: Anstead, Brisbane, Queens...
Senior Member

It is the task shown above. Make sure you run it from within eclipse, it has many dependencies. Documentation is available in the eclipse online help and the back of the EMF book. Alternatively, look at oaw (open architecture ware) they should have tools for that purpose.
Re: how to use ant to generate genmodel [message #529355 is a reply to message #529104] Fri, 23 April 2010 22:26 Go to previous message
saadbin abid is currently offline saadbin abidFriend
Messages: 61
Registered: October 2009
Location: Ireland
Member
Hello again,
Thank you very much. I have solved the problem using the above mentioned task.
thanks a million
regards
saad
Previous Topic:Handling of encoded characters
Next Topic:Open an dynamic instance model
Goto Forum:
  


Current Time: Fri Apr 19 20:32:09 GMT 2024

Powered by FUDForum. Page generated in 0.03563 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top