use of com.google.idea.blaze.base.sync.workspace.ExecutionRootPathResolver in project intellij by bazelbuild.
the class BlazeConfigurationResolver method update.
public BlazeConfigurationResolverResult update(BlazeContext context, WorkspaceRoot workspaceRoot, ProjectViewSet projectViewSet, BlazeProjectData blazeProjectData, BlazeConfigurationResolverResult oldResult) {
ExecutionRootPathResolver executionRootPathResolver = new ExecutionRootPathResolver(Blaze.getBuildSystem(project), WorkspaceRoot.fromProject(project), blazeProjectData.blazeInfo.getExecutionRoot(), blazeProjectData.workspacePathResolver);
ImmutableMap<TargetKey, CToolchainIdeInfo> toolchainLookupMap = BlazeConfigurationToolchainResolver.buildToolchainLookupMap(context, blazeProjectData.targetMap);
ImmutableMap<File, VirtualFile> headerRoots = collectHeaderRoots(context, blazeProjectData, toolchainLookupMap, executionRootPathResolver);
CompilerInfoCache compilerInfoCache = new CompilerInfoCache();
ImmutableMap<CToolchainIdeInfo, BlazeCompilerSettings> compilerSettings = BlazeConfigurationToolchainResolver.buildCompilerSettingsMap(context, project, toolchainLookupMap, executionRootPathResolver, compilerInfoCache, oldResult.compilerSettings);
BlazeConfigurationResolverResult.Builder builder = BlazeConfigurationResolverResult.builder(project);
buildBlazeConfigurationData(context, workspaceRoot, projectViewSet, blazeProjectData, toolchainLookupMap, headerRoots, compilerSettings, compilerInfoCache, executionRootPathResolver, oldResult, builder);
builder.setCompilerSettings(compilerSettings);
return builder.build();
}
use of com.google.idea.blaze.base.sync.workspace.ExecutionRootPathResolver in project intellij by bazelbuild.
the class BlazeConfigurationResolver method buildBlazeConfigurationData.
private void buildBlazeConfigurationData(BlazeContext parentContext, WorkspaceRoot workspaceRoot, ProjectViewSet projectViewSet, BlazeProjectData blazeProjectData, ImmutableMap<TargetKey, CToolchainIdeInfo> toolchainLookupMap, ImmutableMap<File, VirtualFile> headerRoots, ImmutableMap<CToolchainIdeInfo, BlazeCompilerSettings> compilerSettings, CompilerInfoCache compilerInfoCache, ExecutionRootPathResolver executionRootPathResolver, BlazeConfigurationResolverResult oldConfigurationData, BlazeConfigurationResolverResult.Builder builder) {
// Type specification needed to avoid incorrect type inference during command line build.
Scope.push(parentContext, (ScopedOperation) context -> {
context.push(new TimingScope("Build C configuration map", EventType.Other));
ProjectViewTargetImportFilter filter = new ProjectViewTargetImportFilter(project, workspaceRoot, projectViewSet);
ConcurrentMap<TargetKey, BlazeResolveConfigurationData> targetToData = Maps.newConcurrentMap();
List<ListenableFuture<?>> targetToDataFutures = blazeProjectData.targetMap.targets().stream().filter(target -> target.kind.languageClass == LanguageClass.C).filter(target -> target.kind != Kind.CC_TOOLCHAIN).filter(filter::isSourceTarget).filter(BlazeConfigurationResolver::containsCompiledSources).map(target -> submit(() -> {
BlazeResolveConfigurationData data = createResolveConfiguration(target, toolchainLookupMap, headerRoots, compilerSettings, compilerInfoCache, executionRootPathResolver);
if (data != null) {
targetToData.put(target.key, data);
}
return null;
})).collect(Collectors.toList());
try {
Futures.allAsList(targetToDataFutures).get();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
context.setCancelled();
return;
} catch (ExecutionException e) {
IssueOutput.error("Could not build C resolve configurations: " + e).submit(context);
logger.error("Could not build C resolve configurations", e);
return;
}
findEquivalenceClasses(context, project, blazeProjectData.workspacePathResolver, targetToData, oldConfigurationData, builder);
});
}
Aggregations