Skip to main content



      Home
Home » Modeling » EMF » emf.ecore2Java and templatepath(template not used?)
emf.ecore2Java and templatepath [message #508297] Mon, 18 January 2010 05:51 Go to next message
Eclipse UserFriend
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,




[Updated on: Mon, 18 January 2010 06:02] by Moderator

Re: emf.ecore2Java and templatepath [message #508393 is a reply to message #508297] Mon, 18 January 2010 11:06 Go to previous messageGo to next message
Eclipse UserFriend
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,
>
>
>
>
>
Re: emf.ecore2Java and templatepath [message #508397 is a reply to message #508297] Mon, 18 January 2010 11:20 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: emf.ecore2Java and templatepath [message #508407 is a reply to message #508397] Mon, 18 January 2010 11:28 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: emf.ecore2Java and templatepath [message #508417 is a reply to message #508297] Mon, 18 January 2010 12:21 Go to previous messageGo to next message
Eclipse UserFriend
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)

Re: emf.ecore2Java and templatepath [message #508421 is a reply to message #508417] Mon, 18 January 2010 12:47 Go to previous message
Eclipse UserFriend
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)
>
>
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: Wed Jul 23 13:47:02 EDT 2025

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

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

Back to the top