Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Newlines in generated code
Newlines in generated code [message #506177] Wed, 06 January 2010 13:01 Go to next message
Erwin Betschart is currently offline Erwin BetschartFriend
Messages: 4
Registered: July 2009
Junior Member
Hi all

Is there a possibility to influence the newline style in the generated
source (CR or CR+LF)?

We work on windows and linux. If e.g. the model is generated under
windows the next model generation under linux will overwrite all source
files (only different line breaks).
Re: Newlines in generated code [message #506198 is a reply to message #506177] Wed, 06 January 2010 14:11 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 30629
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------030203060001090809050803
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Erwin,

I'd expect the generator to match the target file's convention because
of logic like this in AbstractGeneratorAdapter.generateJava

setLineDelimiter(getLineDelimiter(targetFile,
getEncoding(targetFile)));
String emitterResult = jetEmitter.generate(createMonitor(monitor,
1), arguments, getLineDelimiter());

If the target file doesn't exist, it uses the Eclipse preferences or a
system property.

if (EMFPlugin.IS_ECLIPSE_RUNNING)
{
return EclipseHelper.getLineDelimiter(workspacePath.toString());
}
return System.getProperty(Platform.PREF_LINE_SEPARATOR);



Erwin Betschart wrote:
> Hi all
>
> Is there a possibility to influence the newline style in the generated
> source (CR or CR+LF)?
>
> We work on windows and linux. If e.g. the model is generated under
> windows the next model generation under linux will overwrite all
> source files (only different line breaks).
>

--------------030203060001090809050803
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Erwin,<br>
<br>
I'd expect the generator to match the target file's convention because
of logic like this in AbstractGeneratorAdapter.generateJava<br>
<br>
Previous Topic:How to copy EObjects from one Resource to another
Next Topic:Cross Document References persistence customization
Goto Forum:
  


Current Time: Thu Nov 14 06:00:34 GMT 2019

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

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

Back to the top