Skip to content
Permalink
Browse files

Fix import order issue for androidx

Bug: 948803
Change-Id: I61de64544305af054571c3aa5f535a8b95f611a9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1542137
Reviewed-by: Nico Weber <thakis@chromium.org>
Reviewed-by: Sam Maier <smaier@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Yun Liu <yliuyliu@google.com>
Cr-Commit-Position: refs/heads/master@{#647808}
  • Loading branch information
Yun Liu Commit Bot
Yun Liu authored and Commit Bot committed Apr 4, 2019
1 parent 5b2567a commit f40227d9c888639f7676636b073768bc0103c408
Showing with 4 additions and 12 deletions.
  1. +3 −0 .clang-format
  2. +1 −4 styleguide/java/java.md
  3. +0 −8 tools/android/checkstyle/chromium-style-5.0.xml
@@ -34,3 +34,6 @@ IPC_STRUCT_END|\
IPC_STRUCT_TRAITS_END|\
POLPARAMS_END|\
PPAPI_END_MESSAGE_MAP$"

# TODO: Remove this once clang-format r357700 is rolled in.
JavaImportGroups: ['android', 'androidx', 'com', 'dalvik', 'junit', 'org', 'com.google.android.apps.chrome', 'org.chromium', 'java', 'javax']
@@ -206,6 +206,7 @@ if (someConditional)
This is the order of the import groups:

1. android
1. androidx
1. com (except com.google.android.apps.chrome)
1. dalvik
1. junit
@@ -215,10 +216,6 @@ This is the order of the import groups:
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
[//base](https://chromium.googlesource.com/chromium/src/+/master/base/)
@@ -98,14 +98,6 @@
<module name="NoFinalizer">
<property name="severity" value="info"/>
</module>
<module name="ImportOrder">
<property name="severity" value="error"/>
<message key="import.ordering" value="Wrong order for {0} import. Follow the AOSP Java Code Style: https://source.android.com/setup/code-style#order-import-statements. When using Android Studio, use Ctrl+Alt+O to sort imports. A style configuration file can be found at //tools/android/android_studio/ChromiumStyle.xml."/>
<property name="groups" value="android, com, dalvik, junit, org, com.google.android.apps.chrome, org.chromium, java, javax"/>
<property name="ordered" value="true"/>
<property name="option" value="top"/>
<property name="separated" value="true"/>
</module>
<module name="RegexpSinglelineJava">
<property name="id" value="StringBufferCheck"/>
<property name="severity" value="error"/>

0 comments on commit f40227d

Please sign in to comment.
You can’t perform that action at this time.