use of com.facebook.buck.model.BuildId in project buck by facebook.
the class MiniAaptTest method testProcessFileNamesInDirectory.
@Test
public void testProcessFileNamesInDirectory() throws IOException, ResourceParseException {
filesystem.touch(Paths.get("res/drawable/icon.png"));
filesystem.touch(Paths.get("res/drawable/another_icon.png.orig"));
filesystem.touch(Paths.get("res/drawable-ldpi/nine_patch.9.png"));
filesystem.touch(Paths.get("res/drawable-ldpi/.DS_Store"));
filesystem.touch(Paths.get("res/transition-v19/some_transition.xml"));
filesystem.writeContentsToPath("<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<resources>" + "<bool name=\"v\">false</bool>" + "</resources>", Paths.get("res/values/value.xml~"));
MiniAapt aapt = new MiniAapt(resolver, filesystem, new FakeSourcePath(filesystem, "res"), Paths.get("R.txt"), ImmutableSet.of());
aapt.processFileNamesInDirectory(filesystem, Paths.get("res/drawable"));
aapt.processFileNamesInDirectory(filesystem, Paths.get("res/drawable-ldpi"));
aapt.processFileNamesInDirectory(filesystem, Paths.get("res/transition-v19"));
aapt.processValues(filesystem, new BuckEventBus(new FakeClock(0), new BuildId("")), Paths.get("res/values"));
assertEquals(ImmutableSet.<RDotTxtEntry>of(new FakeRDotTxtEntry(IdType.INT, RType.DRAWABLE, "icon"), new FakeRDotTxtEntry(IdType.INT, RType.DRAWABLE, "nine_patch"), new FakeRDotTxtEntry(IdType.INT, RType.TRANSITION, "some_transition")), aapt.getResourceCollector().getResources());
}
Aggregations