OSDN Git Service

AAPT2: Allow compatible duplicate Attributes
authorAdam Lesinski <adamlesinski@google.com>
Sat, 9 Dec 2017 00:06:10 +0000 (16:06 -0800)
committerAdam Lesinski <adamlesinski@google.com>
Thu, 11 Jan 2018 21:54:11 +0000 (13:54 -0800)
commit73bff1e8519bb73f17a801f45977d41b69b5b0d0
tree9ac5f4e491ed617b6cefe118b91edb637c6c35a4
parent14c2ae4a6e62b78f2c994112d08dbe3d4de64695
AAPT2: Allow compatible duplicate Attributes

If a resource XML file defines two compatible Attributes, they should
be merged without throwing an error. Ex:

<declare-styleable>
  <attr name="conflict" format="string" />
</declare-styleable>

<declare-styleable>
  <attr name="conflict" format="string|reference" />
</declare-styleable>

In this case, string|reference and string are the same, so these should
merge correctly.

Bug: 65699599
Test: make aapt2_tests
Test: make AaptBasicTest
Change-Id: I7b0f956d2332f7f0b458acd59ca0a606b2cfdf95
22 files changed:
tools/aapt2/ResourceParser.cpp
tools/aapt2/ResourceTable.cpp
tools/aapt2/ResourceTable.h
tools/aapt2/ResourceTable_test.cpp
tools/aapt2/ResourceUtils_test.cpp
tools/aapt2/ResourceValues.cpp
tools/aapt2/ResourceValues.h
tools/aapt2/ResourceValues_test.cpp
tools/aapt2/cmd/Link.cpp
tools/aapt2/format/binary/BinaryResourceParser.cpp
tools/aapt2/format/binary/TableFlattener_test.cpp
tools/aapt2/format/proto/ProtoDeserialize.cpp
tools/aapt2/format/proto/ProtoSerialize_test.cpp
tools/aapt2/integration-tests/BasicTest/Android.mk [new file with mode: 0644]
tools/aapt2/integration-tests/BasicTest/AndroidManifest.xml [new file with mode: 0644]
tools/aapt2/integration-tests/BasicTest/res/values/values.xml [new file with mode: 0644]
tools/aapt2/java/JavaClassGenerator_test.cpp
tools/aapt2/link/XmlCompatVersioner_test.cpp
tools/aapt2/link/XmlReferenceLinker.cpp
tools/aapt2/process/SymbolTable.cpp
tools/aapt2/test/Builders.cpp
tools/aapt2/test/Builders.h