Skip to main content



      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 00:52 Go to next message
Eclipse UserFriend
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 04:15 Go to previous message
Eclipse UserFriend
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: Mon Jul 14 06:31:19 EDT 2025

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

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

Back to the top