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

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.

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: 1901
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 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
Previous Topic:[Xpand] Encoding problem when linking or copying xpt tempates
Next Topic:[Acceleo] Profile, Stereotype and getValue
Goto Forum:

Current Time: Thu Jun 01 10:16:05 GMT 2023

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

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

Back to the top