Search in sources :

Example 1 with Activity

use of com.android.tools.build.bundletool.model.manifestelements.Activity in project bundletool by google.

the class ManifestEditorTest method addActivity.

@Test
public void addActivity() throws Exception {
    Activity activity = Activity.builder().setName("activityName").build();
    XmlNode activityXmlNode = XmlNode.newBuilder().setElement(activity.asXmlProtoElement().getProto()).build();
    AndroidManifest androidManifest = AndroidManifest.create(androidManifest("com.test.app"));
    AndroidManifest editedManifest = androidManifest.toEditor().addActivity(activity).save();
    assertThat(getApplicationElement(editedManifest).getChildList()).containsExactly(activityXmlNode);
}
Also used : XmlNode(com.android.aapt.Resources.XmlNode) ManifestProtoUtils.withSplitNameActivity(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withSplitNameActivity) Activity(com.android.tools.build.bundletool.model.manifestelements.Activity) ManifestProtoUtils.withMainActivity(com.android.tools.build.bundletool.testing.ManifestProtoUtils.withMainActivity) Test(org.junit.Test)

Aggregations

XmlNode (com.android.aapt.Resources.XmlNode)1 Activity (com.android.tools.build.bundletool.model.manifestelements.Activity)1 ManifestProtoUtils.withMainActivity (com.android.tools.build.bundletool.testing.ManifestProtoUtils.withMainActivity)1 ManifestProtoUtils.withSplitNameActivity (com.android.tools.build.bundletool.testing.ManifestProtoUtils.withSplitNameActivity)1 Test (org.junit.Test)1