use of com.android.tools.idea.npw.project.AndroidProjectPaths in project intellij by bazelbuild.
the class BlazeAndroidProjectPathsTest method getWorkspaceSourceSetsWithNoTargetDirectory.
/**
* If no target directory is given, and we have the workspace module, we'll just use the module
* root.
*/
@Test
public void getWorkspaceSourceSetsWithNoTargetDirectory() {
AndroidFacet facet = mockWorkspaceFacet();
File rootFile = VfsUtilCore.virtualToIoFile(root);
List<AndroidSourceSet> sourceSets = AndroidSourceSet.getSourceSets(facet, null);
assertThat(sourceSets).hasSize(1);
AndroidSourceSet sourceSet = sourceSets.get(0);
AndroidProjectPaths paths = sourceSet.getPaths();
assertThat(sourceSet.getName()).isEqualTo(".workspace");
assertThat(paths.getModuleRoot()).isEqualTo(rootFile);
assertThat(paths.getSrcDirectory(null)).isEqualTo(rootFile);
assertThat(paths.getTestDirectory(null)).isEqualTo(rootFile);
assertThat(paths.getResDirectory()).isEqualTo(new File(rootFile, "res"));
assertThat(paths.getAidlDirectory(null)).isEqualTo(rootFile);
assertThat(paths.getManifestDirectory()).isEqualTo(rootFile);
}
use of com.android.tools.idea.npw.project.AndroidProjectPaths 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