Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo] file-exists/ generate once
[Acceleo] file-exists/ generate once [message #1095762] Tue, 27 August 2013 13:48 Go to next message
Martin Eisengardt is currently offline Martin EisengardtFriend
Messages: 9
Registered: July 2009
Junior Member
Hi.

Im am facing a problem. I tried to search the forums and via google but I did not get any information on it.

I have a file I want to only generate if it does not exist. If the user decides to manipulate it the changes should be kept. On normal files and codes I would simply use [protected.... but there is no way to do this on the mentioned file. It is an xml and as soon as I embedd the xml in a user code with "<!-- [protected..." the editor silently removes the comment and acceleo recreates the whole file.

To solve the issue I wrote a query and a java service (fileExists(String) : Boolean).

All I want to know is: How to I get the target generation folder within the java service? The code is running at eclipse main folder. The current working dir is not set to the generation root.

Or is there any other way to solve this request?

Greetings

[Updated on: Tue, 27 August 2013 14:49]

Report message to a moderator

Re: [Acceleo] file-exists/ generate once [message #1096501 is a reply to message #1095762] Wed, 28 August 2013 13:27 Go to previous messageGo to next message
Johan Hardy is currently offline Johan HardyFriend
Messages: 47
Registered: December 2012
Member

If you use an UI launcher plugin, the target folder is easily accessible. I had a similar problem a couple of day ago, I needed to change the target folder path wrt a persistent property value (refer to my old post http://www.eclipse.org/forums/index.php/t/512935/).

Concerning XML and protected block, I don't have any solution.
Re: [Acceleo] file-exists/ generate once [message #1097423 is a reply to message #1096501] Thu, 29 August 2013 17:50 Go to previous message
Martin Eisengardt is currently offline Martin EisengardtFriend
Messages: 9
Registered: July 2009
Junior Member
thanks. It is fine to me for generating the problematic xml file only once. However: For normal xml files you could simply use the protected code and embedd it into xml comments. Wink

Hmmm. It would be finde for me if this only works as eclipse plugin and not standalone. For testing the generator run it is not important if it overwrites the file.

Thanks for your hint.
Previous Topic:[Xpand] Hiding Xpand template from user
Next Topic:Adding Modelelemets to the Model during Editing
Goto Forum:
  


Current Time: Fri Mar 29 10:50:28 GMT 2024

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

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

Back to the top