0

Add importorder to Java styleguide.

The styleguide refers to the Android Style Guide unless exceptions are listed.
However, the package import order is not listed as an exception, even though
it does not match the Android Style Guide.

This CL adds a section about the requirements for the Java import order.

It does not refer to how to set this up in Eclipse and Android Studio, since
that is already listed under the tools-section.

BUG=None

Review-Url: https://codereview.chromium.org/2738523002
Cr-Commit-Position: refs/heads/master@{#454965}
This commit is contained in:
nyquist
2017-03-06 13:36:51 -08:00
committed by Commit bot
parent d80e6732a3
commit 2d192c4cd3

@ -124,6 +124,27 @@ if (org.chromium.base.BuildConfig.DCHECK_IS_ON) {
}
```
### Import Order
* Static imports go before other imports.
* Each import group must be separated by an empty line.
This is the order of the import groups:
1. android
1. com (except com.google.android.apps.chrome)
1. dalvik
1. junit
1. org
1. com.google.android.apps.chrome
1. org.chromium
1. java
1. javax
This is enforced by the
[Chromium Checkstyle configuration](../../tools/android/checkstyle/chromium-style-5.0.xml)
under the ImportOrder module.
## Location
"Top level directories" are defined as directories with a GN file, such as