Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] Adding files to ouput
[Xpand] Adding files to ouput [message #534265] Tue, 18 May 2010 14:26 Go to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
Hello,

is there a way to add files (or even better a directory) to the generated files ?

I have some files that are already written, and that I have to add to every generated code, and I want to add them to output.

How can I do that ?


One day I shall master M2T, but that day has yet to come...
Re: [Xpand] Adding files to ouput [message #534267 is a reply to message #534265] Tue, 18 May 2010 14:32 Go to previous messageGo to next message
Karsten Thoms is currently offline Karsten ThomsFriend
Messages: 762
Registered: July 2009
Location: Dortmund, Germany
Senior Member

Hi Maxime!

I'm not sure if I understand correct, but maybe the append flag for an outlet is what you are searching for. In the workflow generator component configuration add
<outlet path="..." name="APPEND_OUT" append="true"...

When you want to append something to a specific file use the FILE statement and name the APPEND_OUT outlet:

«FILE fileExp APPEND_OUT»

Regards,
~Karsten


Need professional support for Xtext, EMF, Eclipse IDE?
Go to: http://devhub.karakun.com
Twitter : @kthoms
Blog : www.karsten-thoms.de
Re: [Xpand] Adding files to ouput [message #534273 is a reply to message #534265] Tue, 18 May 2010 14:42 Go to previous messageGo to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
Sometimes I'm surprised as how quick people answer Smile

I generate JAVA code, and all my classes will extend an Entity class that is already written and set in stone.

I just want to have a copy of this file written with my generated files, so that I don't have to copy/paste it from explorer after generation.

(actually I have a few packages, not just one file)


One day I shall master M2T, but that day has yet to come...
Re: [Xpand] Adding files to ouput [message #534283 is a reply to message #534273] Tue, 18 May 2010 14:57 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hello Maxime,

why don't you have a look at org.eclipse.emf.mwe.utils.FileCopy ?

Regards
Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: [Xpand] Adding files to ouput [message #534290 is a reply to message #534265] Tue, 18 May 2010 15:12 Go to previous messageGo to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
That's what I need.
I just have to update to MWE 0.8

Thank you.


One day I shall master M2T, but that day has yet to come...
Re: [Xpand] Adding files to ouput [message #534431 is a reply to message #534265] Wed, 19 May 2010 07:50 Go to previous messageGo to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
I have a noob question :s

I downloaded the emft-mwe-Update-0.8.0M5.zip (latest stable build), but I don't know how to install it.

I tried uninstalling MWE and copy/paste files from zip to eclipse directory, but doesn't work. So how can I install it ? Is there a site that I can add to add it using eclipse ?

Regards,

maxime

EDIT : found how to install MWE 1.0, but i get an error when running my workflow files. Still searching.


One day I shall master M2T, but that day has yet to come...

[Updated on: Wed, 19 May 2010 09:18]

Report message to a moderator

Re: [Xpand] Adding files to ouput [message #534581 is a reply to message #534431] Wed, 19 May 2010 15:09 Go to previous messageGo to next message
Sven Efftinge is currently offline Sven EfftingeFriend
Messages: 1823
Registered: July 2009
Senior Member
The easiest way to install it is via update manager.
http://download.itemis.com/updates/milestones/

Sven


Maxime Lecourt schrieb:
> I have a noob question :s
>
> I downloaded the emft-mwe-Update-0.8.0M5.zip (latest stable build), but
> I don't know how to install it.
>
> I tried uninstalling MWE and copy/paste files from zip to eclipse
> directory, but doesn't work. So how can I install it ? Is there a site
> that I can add to add it using eclipse ?
>
> Regards,
>
> maxime


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : blog.efftinge.de
Re: [Xpand] Adding files to ouput [message #534796 is a reply to message #534265] Thu, 20 May 2010 11:28 Go to previous messageGo to next message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
Updated to new version, I have a problem with FileCopy.

workflow tells me file does not exist.

I tried pointing to my file following what I found there
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.m2t/org .eclipse.xpand/doc/org.eclipse.xpand.doc/html/xpand_referenc e.html?root=Modeling_Project&view=co

So I get
	<component id="copier" class="org.eclipse.emf.mwe.utils.FileCopy"
		sourceFile="genCPP/src/fr/onera/gamme/pool/Entity.java"
		targetFile="genCPP/src-gen/myEntity/Entity.java"
	/>


One day I shall master M2T, but that day has yet to come...
Re: [Xpand] Adding files to ouput [message #534801 is a reply to message #534796] Thu, 20 May 2010 11:39 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hello Maxime,

please note: "." is the root of the project you execute the workflow within so in your case

<component id="copier" class="org.eclipse.emf.mwe.utils.FileCopy"
		sourceFile="../genCPP/src/fr/onera/gamme/pool/Entity.java"
		targetFile="../genCPP/src-gen/myEntity/Entity.java"
	/>


might be working (asuming genCPP is the project name)

AND: the target dir must exist.

~Christian


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 20 May 2010 11:42]

Report message to a moderator

Re: [Xpand] Adding files to ouput [message #534802 is a reply to message #534265] Thu, 20 May 2010 11:55 Go to previous message
MaximeLecourt  is currently offline MaximeLecourt Friend
Messages: 108
Registered: February 2010
Location: France
Senior Member
Thanks, works perfectly now.

One day I shall master M2T, but that day has yet to come...
Previous Topic:[Xpand] Versions of logging bundles for Xpand/Xtend in recent builds
Next Topic:[XPAND] Use multiple meta-models inside the same template
Goto Forum:
  


Current Time: Fri Apr 19 17:04:20 GMT 2024

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

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

Back to the top