Did anyone create the Java Code Formatter Profile for Eclipse IDE that conforms to the Android Code Style Rules?

后端 未结 5 2037
轮回少年
轮回少年 2021-01-30 04:53

Android Code Style Guide defines \"Android Code Style Rules\".
To conform to these rules one have to change quite a number of settings of the Java Code Formatter (Window->Pr

相关标签:
5条回答
  • 2021-01-30 05:00

    There are pre-made formatter rules available from the platform/development.git repository (GitHub mirror, in folder /ide/eclipse).

    So you can simply import android-formatting.xml and android.importorder as mentioned here.

    0 讨论(0)
  • 2021-01-30 05:01

    The link in kroimon's answer to android formatter rules is broken. Here is the correct one.

    0 讨论(0)
  • 2021-01-30 05:06

    On a related note, here's how developers around Google keep their various Eclipse instances all in agreement: Workspace Mechanic for Eclipse

    0 讨论(0)
  • 2021-01-30 05:11

    I think personal or team preferences vary to much to globally enforce a coding style. So every body should deploy his project specific coding style.

    0 讨论(0)
  • 2021-01-30 05:19

    Sync the source code according to these instructions. The formatting guidelines are in the file development/ide/eclipse/android-formatting.xml. You can import it with Eclipse.

    Menu bar -> Window -> Preferences -> Java -> Code Style -> Formatter -> Import

    Point it to the path of the android-formatting.xml

    0 讨论(0)
提交回复
热议问题