Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » Acceleo : Skip code generation(Based on certain condition, how to skip code generation for a given file path)
icon5.gif  Acceleo : Skip code generation [message #755899] Thu, 10 November 2011 05:52 Go to next message
Kunal Prasad is currently offline Kunal PrasadFriend
Messages: 18
Registered: September 2009
Junior Member
Hi,

I have two source folders in a target project to generate. One is 'src' and other is 'src-gen'. I generate code in 'src-gen'. Here I wish to skip code generation for if a source file of same name already exists in 'src' source folder under same package. How to put this logic in an Acceleo script, please suggest with an example.

Thanks,
Kunal
Re: Acceleo : Skip code generation [message #756816 is a reply to message #755899] Tue, 15 November 2011 09:15 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Kunal,

There is currently no simple way to achieve this. It is a known bug (... though I did not find it on the bugzilla; submitted https://bugs.eclipse.org/bugs/show_bug.cgi?id=363782 for the record).

The only workaround I can think of for now is to encapsulate your "file" block inside of an "if", and make the condition of the "if" a call to a Java service that will return either "true" or "false" depending on whether the file already exists or not.

Or if you are trying this for files that support comments, use protected areas or JMerge to prevent Acceleo from overwriting "protected" regions of the code.

Laurent Goubet
Obeo
Previous Topic:[Xpand] Encoding problem when linking or copying xpt tempates
Next Topic:[Acceleo] Profile, Stereotype and getValue
Goto Forum:
  


Current Time: Fri Apr 26 13:09:45 GMT 2024

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

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

Back to the top