use of com.google.devtools.build.lib.rules.android.ResourceContainer in project bazel by bazelbuild.
the class AarImportTest method testNoCustomJavaPackage.
@Test
public void testNoCustomJavaPackage() throws Exception {
ResourceContainer resourceContainer = getConfiguredTarget("//a:foo").getProvider(AndroidResourcesProvider.class).getDirectAndroidResources().iterator().next();
// aar_import should not set a custom java package. Instead aapt will read the
// java package from the manifest.
assertThat(resourceContainer.getJavaPackage()).isNull();
}
use of com.google.devtools.build.lib.rules.android.ResourceContainer in project bazel by bazelbuild.
the class AarImportTest method testResourcesProvided.
@Test
public void testResourcesProvided() throws Exception {
ConfiguredTarget aarImportTarget = getConfiguredTarget("//a:foo");
NestedSet<ResourceContainer> directResources = aarImportTarget.getProvider(AndroidResourcesProvider.class).getDirectAndroidResources();
assertThat(directResources).hasSize(1);
ResourceContainer resourceContainer = directResources.iterator().next();
assertThat(resourceContainer.getManifest()).isNotNull();
Iterable<Artifact> resourceArtifacts = resourceContainer.getArtifacts();
assertThat(resourceArtifacts).hasSize(1);
Artifact resourceTreeArtifact = resourceArtifacts.iterator().next();
assertThat(resourceTreeArtifact.isTreeArtifact()).isTrue();
assertThat(resourceTreeArtifact.getExecPathString()).endsWith("_aar/unzipped/resources/foo");
}
Aggregations