Search in sources :

Example 1 with DefaultOnDiskBuildInfo

use of com.facebook.buck.rules.DefaultOnDiskBuildInfo in project buck by facebook.

the class AndroidBinaryIntegrationTest method testDxFindsReferencedResources.

@Test
public void testDxFindsReferencedResources() throws IOException {
    DefaultOnDiskBuildInfo buildInfo = new DefaultOnDiskBuildInfo(BuildTargetFactory.newInstance("//java/com/sample/lib:lib#dex"), new ProjectFilesystem(tmpFolder.getRoot()), ObjectMappers.newDefaultInstance());
    Optional<ImmutableList<String>> resourcesFromMetadata = buildInfo.getValues(DexProducedFromJavaLibrary.REFERENCED_RESOURCES);
    assertTrue(resourcesFromMetadata.isPresent());
    assertEquals(ImmutableSet.of("com.sample.top_layout", "com.sample2.title"), ImmutableSet.copyOf(resourcesFromMetadata.get()));
}
Also used : DefaultOnDiskBuildInfo(com.facebook.buck.rules.DefaultOnDiskBuildInfo) ImmutableList(com.google.common.collect.ImmutableList) ProjectFilesystem(com.facebook.buck.io.ProjectFilesystem) Test(org.junit.Test)

Aggregations

ProjectFilesystem (com.facebook.buck.io.ProjectFilesystem)1 DefaultOnDiskBuildInfo (com.facebook.buck.rules.DefaultOnDiskBuildInfo)1 ImmutableList (com.google.common.collect.ImmutableList)1 Test (org.junit.Test)1