View source | Discuss this page | Page history | Printable version   

How to Migrate Sources Format (since 3.0PR19Q1)

Contents

Who should read this document

This document is important for developers that:

Starting from 3.0PR19Q1, Openbravo sources are formatted differently than they were before. Here you can find why and what changed in Java sources.

Workspace migration

  1. If required update Eclipse. Minimum supported Eclipse version is Photon (4.8), although the latest Eclipse IDE for Java EE Developers release is recommended.
  2. Reimport preferences.
  3. Open Window > Preferences > Java > Code Style > Formatter and ensure that:
    1. Active profile field is set to Openbravo.
    2. Formatter implementation field is set to Eclipse [built-in]. Note this field only appear if you have installed Luna Formatter plugin, which is no longer required.
Eclipse-formatting-preferences.png

Applying new format

Java

From Eclipse (this is the recommended approach to format complete modules):

Eclipse-cleanup.png

From command line (this is the recommended approach to format before backporting or merging):

Bulbgraph.png   Formatting from command line will not apply Clean Up step defined above. This usually should not be a big problem for merges and backports; but if many conflicts appear due to the lack of that clean up, execute it first from Eclipse.

Sources migration

Working with pi

Just migrate your workspace, nothing else is required.

Backports

When backporting a changeset to an older release that has not been formatted with the new rules, it is generally easier to apply the new formatting first to do the backport later. In order to make the changesets more readable, this should be split into two commits: one for the reformatting and another one for the backport itself.

Merges

Before merging a branch that started in a changest where new formatting is not applied yet, it is highly recommendable to format before doing the merge, in this way, conflicts will be prevented.

Modules

It's decision of each module owner when to apply new formatting rules.

Retrieved from "http://wiki.openbravo.com/wiki/How_to_Migrate_Sources_Format_(since_3.0PR19Q1)"

This page has been accessed 3,519 times. This page was last modified on 18 February 2019, at 13:57. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.