Search in sources :

Example 6 with XmlNode

use of com.android.aapt.Resources.XmlNode in project bundletool by google.

the class ResourceAnalyzerTest method transitive_deepChain.

@Test
public void transitive_deepChain() throws Exception {
    // AndroidManifest
    // --> 0x7f010001 (ref) --> 0x7f010002 (ref) --> 0x7f010003 (ref) --> 0x7f020004 (string)
    XmlNode manifest = AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application", xmlResourceReferenceAttribute(NO_NAMESPACE_URI, "attribute_pointint_to_a_ref", /* attrResourceId= */
    0x999999, /* valueResourceId= */
    0x7f010001)))))).getManifestRoot().getProto();
    ResourceTable resourceTable = resourceTable(pkg(0x7f, "com.test.app", type(0x01, "ref", entry(0x0001, "ref1", reference(0x7f010002, DEFAULT_CONFIG)), entry(0x0002, "ref2", reference(0x7f010003, DEFAULT_CONFIG)), entry(0x0003, "ref3", reference(0x7f020004, DEFAULT_CONFIG))), type(0x02, "string", entry(0x0004, "name_str", value("hello", DEFAULT_CONFIG)), entry(0x0099, "not_referenced", value("", DEFAULT_CONFIG)))));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(manifest).setResourceTable(resourceTable)).build();
    ImmutableSet<ResourceId> resourceIds = new ResourceAnalyzer(appBundle).findAllAppResourcesReachableFromBaseManifest();
    assertThat(resourceIds).containsExactly(ResourceId.create(0x7f010001), ResourceId.create(0x7f010002), ResourceId.create(0x7f010003), ResourceId.create(0x7f020004));
}
Also used : RawString(com.android.aapt.Resources.RawString) Value(com.android.aapt.Resources.Value) String(com.android.aapt.Resources.String) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) Primitive(com.android.aapt.Resources.Primitive) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ResourcesTableFactory.resourceTable(com.android.tools.build.bundletool.testing.ResourcesTableFactory.resourceTable) Symbol(com.android.aapt.Resources.Attribute.Symbol) ANDROID_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI) ManifestProtoUtils.xmlCompiledItemAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlCompiledItemAttribute) Item(com.android.aapt.Resources.Item) ResourceId(com.android.tools.build.bundletool.model.ResourceId) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResourcesTableFactory.reference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.reference) ResourcesTableFactory.entry(com.android.tools.build.bundletool.testing.ResourcesTableFactory.entry) Attribute(com.android.aapt.Resources.Attribute) ResourcesTableFactory.pkg(com.android.tools.build.bundletool.testing.ResourcesTableFactory.pkg) ResourcesTableFactory.type(com.android.tools.build.bundletool.testing.ResourcesTableFactory.type) ResourceTable(com.android.aapt.Resources.ResourceTable) Nullable(javax.annotation.Nullable) StyledString(com.android.aapt.Resources.StyledString) ManifestProtoUtils.xmlNode(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlNode) ImmutableSet(com.google.common.collect.ImmutableSet) Style(com.android.aapt.Resources.Style) ResourcesTableFactory.value(com.android.tools.build.bundletool.testing.ResourcesTableFactory.value) ConfigValue(com.android.aapt.Resources.ConfigValue) Reference(com.android.aapt.Resources.Reference) Test(org.junit.Test) NO_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.NO_NAMESPACE_URI) ManifestProtoUtils.xmlElement(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlElement) Truth.assertThat(com.google.common.truth.Truth.assertThat) ResourcesTableFactory.fileReference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.fileReference) CompoundValue(com.android.aapt.Resources.CompoundValue) Id(com.android.aapt.Resources.Id) FileReference(com.android.aapt.Resources.FileReference) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ManifestProtoUtils.xmlResourceReferenceAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlResourceReferenceAttribute) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) Configuration(com.android.aapt.ConfigurationOuterClass.Configuration) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) ResourceId(com.android.tools.build.bundletool.model.ResourceId) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ResourceTable(com.android.aapt.Resources.ResourceTable) Test(org.junit.Test)

Example 7 with XmlNode

use of com.android.aapt.Resources.XmlNode in project bundletool by google.

the class ResourceAnalyzerTest method transitive_item_ref.

@Test
public void transitive_item_ref() throws Exception {
    // AndroidManifest --> 0x7f010001 (ref) --> 0x7f020002 (string)
    XmlNode manifest = AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application", xmlResourceReferenceAttribute(NO_NAMESPACE_URI, "some_attribute_pointing_to_a_ref", /* attrResourceId= */
    0x999999, /* valueResourceId= */
    0x7f010001)))))).getManifestRoot().getProto();
    ResourceTable resourceTable = resourceTable(pkg(0x7f, "com.test.app", type(0x01, "ref", entry(0x0001, "name_ref", reference(0x7f020002, DEFAULT_CONFIG))), type(0x02, "string", entry(0x0002, "name_str", value("hello", DEFAULT_CONFIG)), entry(0x0099, "not_referenced", value("", DEFAULT_CONFIG)))));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(manifest).setResourceTable(resourceTable)).build();
    ImmutableSet<ResourceId> resourceIds = new ResourceAnalyzer(appBundle).findAllAppResourcesReachableFromBaseManifest();
    assertThat(resourceIds).containsExactly(ResourceId.create(0x7f010001), ResourceId.create(0x7f020002));
}
Also used : RawString(com.android.aapt.Resources.RawString) Value(com.android.aapt.Resources.Value) String(com.android.aapt.Resources.String) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) Primitive(com.android.aapt.Resources.Primitive) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ResourcesTableFactory.resourceTable(com.android.tools.build.bundletool.testing.ResourcesTableFactory.resourceTable) Symbol(com.android.aapt.Resources.Attribute.Symbol) ANDROID_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI) ManifestProtoUtils.xmlCompiledItemAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlCompiledItemAttribute) Item(com.android.aapt.Resources.Item) ResourceId(com.android.tools.build.bundletool.model.ResourceId) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResourcesTableFactory.reference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.reference) ResourcesTableFactory.entry(com.android.tools.build.bundletool.testing.ResourcesTableFactory.entry) Attribute(com.android.aapt.Resources.Attribute) ResourcesTableFactory.pkg(com.android.tools.build.bundletool.testing.ResourcesTableFactory.pkg) ResourcesTableFactory.type(com.android.tools.build.bundletool.testing.ResourcesTableFactory.type) ResourceTable(com.android.aapt.Resources.ResourceTable) Nullable(javax.annotation.Nullable) StyledString(com.android.aapt.Resources.StyledString) ManifestProtoUtils.xmlNode(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlNode) ImmutableSet(com.google.common.collect.ImmutableSet) Style(com.android.aapt.Resources.Style) ResourcesTableFactory.value(com.android.tools.build.bundletool.testing.ResourcesTableFactory.value) ConfigValue(com.android.aapt.Resources.ConfigValue) Reference(com.android.aapt.Resources.Reference) Test(org.junit.Test) NO_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.NO_NAMESPACE_URI) ManifestProtoUtils.xmlElement(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlElement) Truth.assertThat(com.google.common.truth.Truth.assertThat) ResourcesTableFactory.fileReference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.fileReference) CompoundValue(com.android.aapt.Resources.CompoundValue) Id(com.android.aapt.Resources.Id) FileReference(com.android.aapt.Resources.FileReference) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ManifestProtoUtils.xmlResourceReferenceAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlResourceReferenceAttribute) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) Configuration(com.android.aapt.ConfigurationOuterClass.Configuration) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) ResourceId(com.android.tools.build.bundletool.model.ResourceId) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ResourceTable(com.android.aapt.Resources.ResourceTable) Test(org.junit.Test)

Example 8 with XmlNode

use of com.android.aapt.Resources.XmlNode in project bundletool by google.

the class ResourceAnalyzerTest method attributeWithCompiledItem_ref_resolved.

@Test
public void attributeWithCompiledItem_ref_resolved() throws Exception {
    XmlNode manifest = AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application", xmlResourceReferenceAttribute(ANDROID_NAMESPACE_URI, "name", /* attrResourceId= */
    0x999999, /* valueResourceId= */
    0x12345678)))))).getManifestRoot().getProto();
    ResourceTable resourceTable = resourceTable(pkg(0x12, "com.test.app", type(0x34, "string", entry(0x5678, "name", value("hello", DEFAULT_CONFIG)))));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(manifest).setResourceTable(resourceTable)).build();
    ImmutableSet<ResourceId> resourceIds = new ResourceAnalyzer(appBundle).findAllAppResourcesReachableFromBaseManifest();
    assertThat(resourceIds).containsExactly(ResourceId.create(0x12345678));
}
Also used : RawString(com.android.aapt.Resources.RawString) Value(com.android.aapt.Resources.Value) String(com.android.aapt.Resources.String) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) Primitive(com.android.aapt.Resources.Primitive) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ResourcesTableFactory.resourceTable(com.android.tools.build.bundletool.testing.ResourcesTableFactory.resourceTable) Symbol(com.android.aapt.Resources.Attribute.Symbol) ANDROID_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI) ManifestProtoUtils.xmlCompiledItemAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlCompiledItemAttribute) Item(com.android.aapt.Resources.Item) ResourceId(com.android.tools.build.bundletool.model.ResourceId) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResourcesTableFactory.reference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.reference) ResourcesTableFactory.entry(com.android.tools.build.bundletool.testing.ResourcesTableFactory.entry) Attribute(com.android.aapt.Resources.Attribute) ResourcesTableFactory.pkg(com.android.tools.build.bundletool.testing.ResourcesTableFactory.pkg) ResourcesTableFactory.type(com.android.tools.build.bundletool.testing.ResourcesTableFactory.type) ResourceTable(com.android.aapt.Resources.ResourceTable) Nullable(javax.annotation.Nullable) StyledString(com.android.aapt.Resources.StyledString) ManifestProtoUtils.xmlNode(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlNode) ImmutableSet(com.google.common.collect.ImmutableSet) Style(com.android.aapt.Resources.Style) ResourcesTableFactory.value(com.android.tools.build.bundletool.testing.ResourcesTableFactory.value) ConfigValue(com.android.aapt.Resources.ConfigValue) Reference(com.android.aapt.Resources.Reference) Test(org.junit.Test) NO_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.NO_NAMESPACE_URI) ManifestProtoUtils.xmlElement(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlElement) Truth.assertThat(com.google.common.truth.Truth.assertThat) ResourcesTableFactory.fileReference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.fileReference) CompoundValue(com.android.aapt.Resources.CompoundValue) Id(com.android.aapt.Resources.Id) FileReference(com.android.aapt.Resources.FileReference) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ManifestProtoUtils.xmlResourceReferenceAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlResourceReferenceAttribute) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) Configuration(com.android.aapt.ConfigurationOuterClass.Configuration) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) ResourceId(com.android.tools.build.bundletool.model.ResourceId) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ResourceTable(com.android.aapt.Resources.ResourceTable) Test(org.junit.Test)

Example 9 with XmlNode

use of com.android.aapt.Resources.XmlNode in project bundletool by google.

the class ResourceAnalyzerTest method customManifest_filteredRefs_resolved.

@Test
public void customManifest_filteredRefs_resolved() throws Exception {
    XmlNode baseManifest = AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application", ImmutableList.of(xmlResourceReferenceAttribute(ANDROID_NAMESPACE_URI, "name", /* attrResourceId= */
    0x999998, /* valueResourceId= */
    0x87654321), xmlResourceReferenceAttribute(ANDROID_NAMESPACE_URI, "name2", /* attrResourceId= */
    0x999999, /* valueResourceId= */
    0x12345678))))))).getManifestRoot().getProto();
    AndroidManifest customManifest = AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application", xmlResourceReferenceAttribute(ANDROID_NAMESPACE_URI, "name2", /* attrResourceId= */
    0x999999, /* valueResourceId= */
    0x12345678))))));
    ResourceTable resourceTable = resourceTable(pkg(0x12, "com.test.app", type(0x34, "string", entry(0x5678, "name", value("hello", DEFAULT_CONFIG)))), pkg(0x87, "com.test.app", type(0x65, "string", entry(0x4321, "name2", value("world", DEFAULT_CONFIG)))));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(baseManifest).setResourceTable(resourceTable)).build();
    ImmutableSet<ResourceId> resourceIds = new ResourceAnalyzer(appBundle).findAllAppResourcesReachableFromManifest(customManifest);
    assertThat(resourceIds).containsExactly(ResourceId.create(0x12345678));
}
Also used : RawString(com.android.aapt.Resources.RawString) Value(com.android.aapt.Resources.Value) String(com.android.aapt.Resources.String) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) Primitive(com.android.aapt.Resources.Primitive) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ResourcesTableFactory.resourceTable(com.android.tools.build.bundletool.testing.ResourcesTableFactory.resourceTable) Symbol(com.android.aapt.Resources.Attribute.Symbol) ANDROID_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI) ManifestProtoUtils.xmlCompiledItemAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlCompiledItemAttribute) Item(com.android.aapt.Resources.Item) ResourceId(com.android.tools.build.bundletool.model.ResourceId) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResourcesTableFactory.reference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.reference) ResourcesTableFactory.entry(com.android.tools.build.bundletool.testing.ResourcesTableFactory.entry) Attribute(com.android.aapt.Resources.Attribute) ResourcesTableFactory.pkg(com.android.tools.build.bundletool.testing.ResourcesTableFactory.pkg) ResourcesTableFactory.type(com.android.tools.build.bundletool.testing.ResourcesTableFactory.type) ResourceTable(com.android.aapt.Resources.ResourceTable) Nullable(javax.annotation.Nullable) StyledString(com.android.aapt.Resources.StyledString) ManifestProtoUtils.xmlNode(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlNode) ImmutableSet(com.google.common.collect.ImmutableSet) Style(com.android.aapt.Resources.Style) ResourcesTableFactory.value(com.android.tools.build.bundletool.testing.ResourcesTableFactory.value) ConfigValue(com.android.aapt.Resources.ConfigValue) Reference(com.android.aapt.Resources.Reference) Test(org.junit.Test) NO_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.NO_NAMESPACE_URI) ManifestProtoUtils.xmlElement(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlElement) Truth.assertThat(com.google.common.truth.Truth.assertThat) ResourcesTableFactory.fileReference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.fileReference) CompoundValue(com.android.aapt.Resources.CompoundValue) Id(com.android.aapt.Resources.Id) FileReference(com.android.aapt.Resources.FileReference) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ManifestProtoUtils.xmlResourceReferenceAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlResourceReferenceAttribute) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) Configuration(com.android.aapt.ConfigurationOuterClass.Configuration) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) ResourceId(com.android.tools.build.bundletool.model.ResourceId) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ResourceTable(com.android.aapt.Resources.ResourceTable) Test(org.junit.Test)

Example 10 with XmlNode

use of com.android.aapt.Resources.XmlNode in project bundletool by google.

the class ResourceAnalyzerTest method attributeWithCompiledItem_nonRef_ignored.

@Test
public void attributeWithCompiledItem_nonRef_ignored() throws Exception {
    XmlNode manifest = AndroidManifest.create(xmlNode(xmlElement("manifest", xmlNode(xmlElement("application", // Attributes of all possible types, except for ref.
    ImmutableList.of(// str
    xmlCompiledItemAttribute(NO_NAMESPACE_URI, "str", Item.newBuilder().setStr(String.getDefaultInstance()).build()), // raw_str
    xmlCompiledItemAttribute(NO_NAMESPACE_URI, "raw_str", Item.newBuilder().setRawStr(RawString.getDefaultInstance()).build()), // styled_str
    xmlCompiledItemAttribute(NO_NAMESPACE_URI, "styled_str", Item.newBuilder().setStyledStr(StyledString.getDefaultInstance()).build()), // file
    xmlCompiledItemAttribute(NO_NAMESPACE_URI, "file", Item.newBuilder().setFile(FileReference.getDefaultInstance()).build()), // id
    xmlCompiledItemAttribute(NO_NAMESPACE_URI, "id", Item.newBuilder().setId(Id.getDefaultInstance()).build()), // prim
    xmlCompiledItemAttribute(NO_NAMESPACE_URI, "prim", Item.newBuilder().setPrim(Primitive.getDefaultInstance()).build()))))))).getManifestRoot().getProto();
    ResourceTable resourceTable = resourceTable(pkg(0x0f, "com.test.app", type(0x01, "string", entry(0x0099, "not_referenced", value("", DEFAULT_CONFIG)))));
    AppBundle appBundle = new AppBundleBuilder().addModule("base", builder -> builder.setManifest(manifest).setResourceTable(resourceTable)).build();
    ImmutableSet<ResourceId> resourceIds = new ResourceAnalyzer(appBundle).findAllAppResourcesReachableFromBaseManifest();
    assertThat(resourceIds).isEmpty();
}
Also used : RawString(com.android.aapt.Resources.RawString) Value(com.android.aapt.Resources.Value) String(com.android.aapt.Resources.String) ManifestProtoUtils.androidManifest(com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest) RunWith(org.junit.runner.RunWith) Primitive(com.android.aapt.Resources.Primitive) AndroidManifest(com.android.tools.build.bundletool.model.AndroidManifest) ResourcesTableFactory.resourceTable(com.android.tools.build.bundletool.testing.ResourcesTableFactory.resourceTable) Symbol(com.android.aapt.Resources.Attribute.Symbol) ANDROID_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.ANDROID_NAMESPACE_URI) ManifestProtoUtils.xmlCompiledItemAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlCompiledItemAttribute) Item(com.android.aapt.Resources.Item) ResourceId(com.android.tools.build.bundletool.model.ResourceId) ImmutableList(com.google.common.collect.ImmutableList) Theories(org.junit.experimental.theories.Theories) ResourcesTableFactory.reference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.reference) ResourcesTableFactory.entry(com.android.tools.build.bundletool.testing.ResourcesTableFactory.entry) Attribute(com.android.aapt.Resources.Attribute) ResourcesTableFactory.pkg(com.android.tools.build.bundletool.testing.ResourcesTableFactory.pkg) ResourcesTableFactory.type(com.android.tools.build.bundletool.testing.ResourcesTableFactory.type) ResourceTable(com.android.aapt.Resources.ResourceTable) Nullable(javax.annotation.Nullable) StyledString(com.android.aapt.Resources.StyledString) ManifestProtoUtils.xmlNode(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlNode) ImmutableSet(com.google.common.collect.ImmutableSet) Style(com.android.aapt.Resources.Style) ResourcesTableFactory.value(com.android.tools.build.bundletool.testing.ResourcesTableFactory.value) ConfigValue(com.android.aapt.Resources.ConfigValue) Reference(com.android.aapt.Resources.Reference) Test(org.junit.Test) NO_NAMESPACE_URI(com.android.tools.build.bundletool.model.AndroidManifest.NO_NAMESPACE_URI) ManifestProtoUtils.xmlElement(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlElement) Truth.assertThat(com.google.common.truth.Truth.assertThat) ResourcesTableFactory.fileReference(com.android.tools.build.bundletool.testing.ResourcesTableFactory.fileReference) CompoundValue(com.android.aapt.Resources.CompoundValue) Id(com.android.aapt.Resources.Id) FileReference(com.android.aapt.Resources.FileReference) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ManifestProtoUtils.xmlResourceReferenceAttribute(com.android.tools.build.bundletool.testing.ManifestProtoUtils.xmlResourceReferenceAttribute) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) Configuration(com.android.aapt.ConfigurationOuterClass.Configuration) XmlNode(com.android.aapt.Resources.XmlNode) AppBundle(com.android.tools.build.bundletool.model.AppBundle) ResourceId(com.android.tools.build.bundletool.model.ResourceId) AppBundleBuilder(com.android.tools.build.bundletool.testing.AppBundleBuilder) ResourceTable(com.android.aapt.Resources.ResourceTable) Test(org.junit.Test)

Aggregations

XmlNode (com.android.aapt.Resources.XmlNode)99 Test (org.junit.Test)91 XmlElement (com.android.aapt.Resources.XmlElement)28 AppBundle (com.android.tools.build.bundletool.model.AppBundle)27 ManifestProtoUtils.androidManifest (com.android.tools.build.bundletool.testing.ManifestProtoUtils.androidManifest)23 Truth.assertThat (com.google.common.truth.Truth.assertThat)23 RunWith (org.junit.runner.RunWith)23 ResourceTable (com.android.aapt.Resources.ResourceTable)21 ImmutableList (com.google.common.collect.ImmutableList)21 AndroidManifest (com.android.tools.build.bundletool.model.AndroidManifest)16 Nullable (javax.annotation.Nullable)16 Theories (org.junit.experimental.theories.Theories)16 ZipFile (java.util.zip.ZipFile)12 FileReference (com.android.aapt.Resources.FileReference)10 AppBundleBuilder (com.android.tools.build.bundletool.testing.AppBundleBuilder)10 Configuration (com.android.aapt.ConfigurationOuterClass.Configuration)9 Attribute (com.android.aapt.Resources.Attribute)9 Symbol (com.android.aapt.Resources.Attribute.Symbol)9 CompoundValue (com.android.aapt.Resources.CompoundValue)9 ConfigValue (com.android.aapt.Resources.ConfigValue)9