use of com.google.idea.blaze.base.model.primitives.ExecutionRootPath in project intellij by bazelbuild.
the class IdeInfoFromProtobuf method makeCToolchainIdeInfo.
private static CToolchainIdeInfo makeCToolchainIdeInfo(IntellijIdeInfo.CToolchainIdeInfo cToolchainIdeInfo) {
Collection<ExecutionRootPath> builtInIncludeDirectories = makeExecutionRootPathList(cToolchainIdeInfo.getBuiltInIncludeDirectoryList());
ExecutionRootPath cppExecutable = new ExecutionRootPath(cToolchainIdeInfo.getCppExecutable());
UnfilteredCompilerOptions compilerOptions = UnfilteredCompilerOptions.builder().registerSingleOrSplitOption("-isystem").build(cToolchainIdeInfo.getUnfilteredCompilerOptionList());
CToolchainIdeInfo.Builder builder = CToolchainIdeInfo.builder().addBaseCompilerOptions(cToolchainIdeInfo.getBaseCompilerOptionList()).addCCompilerOptions(cToolchainIdeInfo.getCOptionList()).addCppCompilerOptions(cToolchainIdeInfo.getCppOptionList()).addBuiltInIncludeDirectories(builtInIncludeDirectories).setCppExecutable(cppExecutable).setTargetName(cToolchainIdeInfo.getTargetName()).addUnfilteredCompilerOptions(compilerOptions.getUninterpretedOptions()).addUnfilteredToolchainSystemIncludes(makeExecutionRootPathList(compilerOptions.getExtractedOptionValues("-isystem")));
return builder.build();
}
use of com.google.idea.blaze.base.model.primitives.ExecutionRootPath in project intellij by bazelbuild.
the class BlazeConfigurationResolver method collectExecutionRootPaths.
private static Set<ExecutionRootPath> collectExecutionRootPaths(TargetMap targetMap, ImmutableMap<TargetKey, CToolchainIdeInfo> toolchainLookupMap) {
Set<ExecutionRootPath> paths = Sets.newHashSet();
for (TargetIdeInfo target : targetMap.targets()) {
if (target.cIdeInfo != null) {
paths.addAll(target.cIdeInfo.localIncludeDirectories);
paths.addAll(target.cIdeInfo.transitiveSystemIncludeDirectories);
paths.addAll(target.cIdeInfo.transitiveIncludeDirectories);
paths.addAll(target.cIdeInfo.transitiveQuoteIncludeDirectories);
}
}
Set<CToolchainIdeInfo> toolchains = new LinkedHashSet<>(toolchainLookupMap.values());
for (CToolchainIdeInfo toolchain : toolchains) {
paths.addAll(toolchain.builtInIncludeDirectories);
paths.addAll(toolchain.unfilteredToolchainSystemIncludes);
}
return paths;
}
use of com.google.idea.blaze.base.model.primitives.ExecutionRootPath in project intellij by bazelbuild.
the class ExecutionRootPathResolverTest method testIllegalWorkspacePaths.
@Test
public void testIllegalWorkspacePaths() {
ImmutableList<File> files = pathResolver.resolveToIncludeDirectories(new ExecutionRootPath("tools/fast/:include"));
assertThat(files).isEmpty();
}
use of com.google.idea.blaze.base.model.primitives.ExecutionRootPath in project intellij by bazelbuild.
the class ExecutionRootPathResolverTest method testExternalWorkspacePathRelativeToExecRoot.
@Test
public void testExternalWorkspacePathRelativeToExecRoot() {
ImmutableList<File> files = pathResolver.resolveToIncludeDirectories(new ExecutionRootPath("external/guava/src"));
assertThat(files).containsExactly(new File(EXECUTION_ROOT, "external/guava/src"));
}
use of com.google.idea.blaze.base.model.primitives.ExecutionRootPath in project intellij by bazelbuild.
the class ExecutionRootPathResolverTest method testGenfilesPathRelativeToExecRoot.
@Test
public void testGenfilesPathRelativeToExecRoot() {
ImmutableList<File> files = pathResolver.resolveToIncludeDirectories(new ExecutionRootPath("bazel-out/crosstool/genfiles/res/normal"));
assertThat(files).containsExactly(new File(EXECUTION_ROOT, "bazel-out/crosstool/genfiles/res/normal"));
}
Aggregations