use of com.google.idea.blaze.cpp.CPrefetchFileSource in project intellij by bazelbuild.
the class CPrefetchFileSourceTest method testJavaSourceFilesIgnored.
@Test
public void testJavaSourceFilesIgnored() {
ProjectViewSet projectViewSet = parseProjectView("directories:", " java/com/google", "targets:", " //java/com/google:lib", "additional_languages:", " c", "android_sdk_platform: android-25");
BlazeProjectData projectData = MockBlazeProjectDataBuilder.builder(workspaceRoot).setTargetMap(TargetMapBuilder.builder().addTarget(TargetIdeInfo.builder().setBuildFile(sourceRoot("third_party/library/BUILD")).setLabel("//third_party/library:lib").setKind("java_library").addSource(sourceRoot("third_party/library/Library.java"))).build()).setWorkspaceLanguageSettings(LanguageSupport.createWorkspaceLanguageSettings(projectViewSet)).build();
Set<File> filesToPrefetch = new HashSet<>();
new CPrefetchFileSource().addFilesToPrefetch(getProject(), projectViewSet, getImportRoots(projectViewSet), projectData, filesToPrefetch);
assertThat(filesToPrefetch).isEmpty();
}
use of com.google.idea.blaze.cpp.CPrefetchFileSource in project intellij by bazelbuild.
the class CPrefetchFileSourceTest method testSourceFilesInProjectIgnored.
@Test
public void testSourceFilesInProjectIgnored() {
ProjectViewSet projectViewSet = parseProjectView("directories:", " java/com/google", "targets:", " //java/com/google:lib", "additional_languages:", " c", "android_sdk_platform: android-25");
BlazeProjectData projectData = MockBlazeProjectDataBuilder.builder(workspaceRoot).setTargetMap(TargetMapBuilder.builder().addTarget(TargetIdeInfo.builder().setBuildFile(sourceRoot("java/com/google/BUILD")).setLabel("//java/com/google:lib").setKind("cc_library").addSource(sourceRoot("java/com/google/native.cc")).addSource(sourceRoot("java/com/google/native.h"))).build()).setWorkspaceLanguageSettings(LanguageSupport.createWorkspaceLanguageSettings(projectViewSet)).build();
Set<File> filesToPrefetch = new HashSet<>();
new CPrefetchFileSource().addFilesToPrefetch(getProject(), projectViewSet, getImportRoots(projectViewSet), projectData, filesToPrefetch);
assertThat(filesToPrefetch).isEmpty();
}
use of com.google.idea.blaze.cpp.CPrefetchFileSource in project intellij by bazelbuild.
the class CPrefetchFileSourceTest method testCppHeaderFilesOutsideProjectIncluded.
@Test
public void testCppHeaderFilesOutsideProjectIncluded() {
ProjectViewSet projectViewSet = parseProjectView("directories:", " java/com/google", "targets:", " //java/com/google:lib", "additional_languages:", " c", "android_sdk_platform: android-25");
BlazeProjectData projectData = MockBlazeProjectDataBuilder.builder(workspaceRoot).setTargetMap(TargetMapBuilder.builder().addTarget(TargetIdeInfo.builder().setBuildFile(sourceRoot("third_party/library/BUILD")).setLabel("//third_party/library:dep").setKind("cc_library").setCInfo(CIdeInfo.builder().addSource(sourceRoot("third_party/library/main.cc")).addHeader(sourceRoot("third_party/library/dep.h")).addHeader(sourceRoot("third_party/library/other.h")).addTextualHeader(sourceRoot("third_party/library/textual.h")))).build()).setWorkspaceLanguageSettings(LanguageSupport.createWorkspaceLanguageSettings(projectViewSet)).build();
Set<File> filesToPrefetch = new HashSet<>();
new CPrefetchFileSource().addFilesToPrefetch(getProject(), projectViewSet, getImportRoots(projectViewSet), projectData, filesToPrefetch);
assertThat(filesToPrefetch).containsExactly(workspaceFile("third_party/library/dep.h"), workspaceFile("third_party/library/other.h"), workspaceFile("third_party/library/textual.h"));
}
Aggregations