use of com.android.tools.idea.npw.project.AndroidSourceSet in project intellij by bazelbuild.
the class BlazeAndroidProjectPathsTest method getResourceSourceSetsWithTargetDirectory.
/**
* If we have a resource module and a target directory, then we can get the res dir from the
* module, and use the target directory for everything else.
*/
@Test
public void getResourceSourceSetsWithTargetDirectory() {
AndroidFacet facet = mockResourceFacet();
File resourceFile = VfsUtilCore.virtualToIoFile(resource);
File targetFile = VfsUtilCore.virtualToIoFile(target);
List<AndroidSourceSet> sourceSets = AndroidSourceSet.getSourceSets(facet, target);
assertThat(sourceSets).hasSize(1);
AndroidSourceSet sourceSet = sourceSets.get(0);
AndroidProjectPaths paths = sourceSet.getPaths();
assertThat(sourceSet.getName()).isEqualTo("com.google.target");
assertThat(paths.getModuleRoot()).isEqualTo(resourceFile);
assertThat(paths.getSrcDirectory(null)).isEqualTo(targetFile);
assertThat(paths.getTestDirectory(null)).isEqualTo(targetFile);
assertThat(paths.getResDirectory()).isEqualTo(new File(resourceFile, "res"));
assertThat(paths.getAidlDirectory(null)).isEqualTo(targetFile);
assertThat(paths.getManifestDirectory()).isEqualTo(targetFile);
}
Aggregations