Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » emf.ecore2Java and templatepath(template not used?)
emf.ecore2Java and templatepath [message #508297] Mon, 18 January 2010 10:51 Go to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Hi,

I'm trying to use custom template for emf generation in an ant script.

In local, the generation take care of my templates.
But using emf.ecore2java, I can't make it working. I used the templatepath parameter :
		<emf.Ecore2Java
			modelproject="${buildDirectory}/plugins/${modelsFolder}/process.ecore"
			model="${buildDirectory}/plugins/${modelsFolder}/process.ecore"
			genmodel="${buildDirectory}/plugins/${modelsFolder}/process.genmodel"
			modelprojectfragmentpath="src"
			reconcilegenmodel="keep"
			generatejavacode="true"
			generatemodelproject="true"
			generateeditproject="true"
			generateeditorproject="false"
			templatepath="${buildDirectory}/plugins/${modelsFolder}/EMFTemplates"/>


I checked that the template path is the right one.

i didn't see in the trace of the build any issue. It didn't tell me that it didn't find the templates nor if it tried to use them.

What kind of issue can it be?
Is there an option in the genmodel to allow it?

thanks by advance,






Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team

[Updated on: Mon, 18 January 2010 11:02]

Report message to a moderator

Re: emf.ecore2Java and templatepath [message #508393 is a reply to message #508297] Mon, 18 January 2010 16:06 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Aurelien,

It will look for templates on the path, but it's valid for there to be
no overriding templates there. It's probably better to build up your
GenModel in the IDE, test that it works, and to reuse the settings
within the GenModel itself. I'm not sure the templatepath option will
override what's in the existing GenModel.


Aurelien Pupier wrote:
> Hi,
>
> I'm trying to use custom template for emf generation in an ant script.
>
> In local, the generation take care of my templates.
> But using emf.ecore2java, I can't make it working. I used the
> templatepath parameter :
> <emf.Ecore2Java
>
> modelproject="${buildDirectory}/plugins/${modelsFolder}/process.ecore "
>
> model="${buildDirectory}/plugins/${modelsFolder}/process.ecore "
>
> genmodel="${buildDirectory}/plugins/${modelsFolder}/process.genmodel "
> modelprojectfragmentpath="src"
> reconcilegenmodel="keep"
> generatejavacode="true"
> generatemodelproject="true"
> generateeditproject="true"
> generateeditorproject="false"
>
> templatepath="${buildDirectory}/plugins/${modelsFolder}/EMFTemplates "/>
>
> I checked that the template path is the right one.
>
> i didn't see in the trace of the build any issue. It didn't tell me
> that it didn't find the templates nor if it tried to use them.
>
> What kind of issue can it be?
> Is there an option in the genmodel to allow it?
>
> thanks by advance,
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: emf.ecore2Java and templatepath [message #508397 is a reply to message #508297] Mon, 18 January 2010 16:20 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

Thanks for your answer Ed.

but it's working locally.

In properties-> Templates & merge,
I set the template directory and dynamic templates to true.

If I don't precise the templatepath it doesn't work also.


Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: emf.ecore2Java and templatepath [message #508407 is a reply to message #508397] Mon, 18 January 2010 16:28 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Aurelien,

I'm not sure but it might need to be a URI when it's not a workspace
path. I.e., it might need to be file:/c:/....


Aurelien Pupier wrote:
> Thanks for your answer Ed.
>
> but it's working locally.
>
> In properties-> Templates & merge,
> I set the template directory and dynamic templates to true.
>
> If I don't precise the templatepath it doesn't work also.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: emf.ecore2Java and templatepath [message #508417 is a reply to message #508297] Mon, 18 January 2010 17:21 Go to previous messageGo to next message
Aurélien Pupier is currently offline Aurélien PupierFriend
Messages: 637
Registered: July 2009
Location: Grenoble, FRANCE
Senior Member

it doesn't seem to work more :

Quote:
The specifed 'templatePath' attribute is not a valid directory.


Do you know the name class responsible to use this attribute? (in order to take a look directly into it what it will)



Aurélien Pupier - Red Hat
Senior Software Engineer in Fuse Tooling team
Re: emf.ecore2Java and templatepath [message #508421 is a reply to message #508417] Mon, 18 January 2010 17:47 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33137
Registered: July 2009
Senior Member
Aurelien,

Ultimately it's passed to the JETCompiler. The GenBaseGeneratorAdapter
passes it there. The GeneratorTask does processing of arguments.


Aurelien Pupier wrote:
> it doesn't seem to work more :
>
> Quote:
>> The specifed 'templatePath' attribute is not a valid directory.
>
>
> Do you know the name class responsible to use this attribute? (in
> order to take a look directly into it what it will)
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Comparing EDataType
Next Topic:[CDO] Getting locally created, modified and/or deleted objects from a CDOResource or a CDOView?
Goto Forum:
  


Current Time: Fri Apr 19 09:48:57 GMT 2024

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

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

Back to the top