Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Retrieve target folder during generation
Retrieve target folder during generation [message #894755] Tue, 10 July 2012 11:49 Go to next message
Niels Brouwers is currently offline Niels BrouwersFriend
Messages: 78
Registered: July 2009
Member
Hi all,

is there a way to retrieve the target folder during generation? With target folder I mean the root folder to which all files are generated, configured in the launch configuration.

I would like to use this to provide a warning to the user in case a file is generated to another location, such that he can manually remove it from the old location. Please note that both locations are determined at forehand.

Thanks!
Re: Retrieve target folder during generation [message #895364 is a reply to message #894755] Thu, 12 July 2012 15:05 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane BegaudeauFriend
Messages: 432
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

Technically, this information is in the "targetFolder" attribute of your Java launcher, you could create a Java service to access this value. In one of our projects, we saved it in a properties file next to the model during the launch of the generation and we retrieve the value from the generator to give it to our Java service;

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau & @acceleo
Google+: stephane.begaudeau & acceleo
Blog: http://stephanebegaudeau.tumblr.com
Acceleo Documentation: http://docs.obeonetwork.com/acceleo
Re: Retrieve target folder during generation [message #896086 is a reply to message #894755] Tue, 17 July 2012 08:39 Go to previous message
Niels Brouwers is currently offline Niels BrouwersFriend
Messages: 78
Registered: July 2009
Member
Hi Stephane,

thanks for answer. Eventually I ended up with using system systems properties to temporarily storing the target folder.

I have overridden generator's 'generate' method to store the target folder in a system property using System.setProperty() and retrieve this property in a Java service wrapper using System.getProperty(). This actually works fine!

Thanks for the help.

Kind regards,
Niels Brouwers.
Previous Topic:[Acceleo] Collection whose elements are all different
Next Topic:[XPAND]Transform XML to TEXT
Goto Forum:
  


Current Time: Fri Dec 09 00:11:48 GMT 2016

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

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