OSDN Git Service

AAPT2: Fix R.java styleable + indices ordering
authorAdam Lesinski <adamlesinski@google.com>
Fri, 29 Sep 2017 18:15:17 +0000 (11:15 -0700)
committerAdam Lesinski <adamlesinski@google.com>
Mon, 2 Oct 2017 22:42:24 +0000 (15:42 -0700)
commit1ee1a106c5b8d41597a889224b1125b568b6a3a3
tree6f89cc752ae7013225143664d1b00f015f6fd6ef
parent56afee3c1f69978c4aed0c1fcc62856745d7f176
AAPT2: Fix R.java styleable + indices ordering

Make sure that Styleables are directly followed by their indices.
If not, Robolectric breaks. This is not strictly incorrect to have
an arbitrary ordering in R.java, but its easier to just support
Robolectric in this case.

Bug: 65837293
Merged-In: Ia59ba58427ade386d075ca9fc9eb5b53e35beca0
Test: make aapt2_tests

(cherry picked from commit af85c4deb667843a227d62275fe6992005f4c38d)

Change-Id: Ia59ba58427ade386d075ca9fc9eb5b53e35beca0
tools/aapt2/java/ClassDefinition.cpp
tools/aapt2/java/ClassDefinition.h
tools/aapt2/java/JavaClassGenerator_test.cpp