Skip to content

[5.2] Respect local OS line endings when generating files - #407

Merged
tsegismont merged 1 commit into
5.2from
backport/406-to-5.2
Nov 30, 2026
Merged

tsegismont merged 1 commit into
5.2from
backport/406-to-5.2

Conversation

@tsegismont

Copy link
Copy Markdown
Member

Backport of #406 to 5.2
Cherry-picked commit: e1f5ce5

* Respect local OS line endings when generating files

This avoids listing all files changes in a Git diff and IDEs.

Closes eclipse-vertx/vert.x#5849

* Read the line separator at class load and use a constant converter

Instead of reading the system line separator on each pass over the
generated files, it is read once when the Processor class is loaded.

The converter is a constant that is a no-op when the local line
separator is LF, and otherwise replaces LF with the local separator.

* Verify generated files use the system line separator

Compile a model with the testgen2 generator and check the generated
Java source contains only the system line separator.

The 5.x CI matrix already runs the tests on Windows (JDK 25), where
the LF to CRLF conversion is exercised.

---------

Co-authored-by: Thomas Segismont <tsegismont@gmail.com>
(cherry picked from commit e1f5ce5)
Signed-off-by: Thomas Segismont <tsegismont@gmail.com>
@tsegismont tsegismont added this to the 5.2.4 milestone Nov 30, 2026
@tsegismont
tsegismont merged commit 2d791c0 into 5.2 Nov 30, 2026
5 checks passed
@tsegismont
tsegismont deleted the backport/406-to-5.2 branch November 30, 2026 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants