use of com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverImpl in project intellij by bazelbuild.
the class MockBlazeProjectDataBuilder method build.
public BlazeProjectData build() {
TargetMap targetMap = this.targetMap != null ? this.targetMap : new TargetMap(ImmutableMap.of());
BlazeInfo blazeInfo = this.blazeInfo;
if (blazeInfo == null) {
String outputBase = this.outputBase != null ? this.outputBase : "/usr/workspace/1234";
blazeInfo = BlazeInfo.createMockBlazeInfo(outputBase, outputBase + "/execroot", outputBase + "/execroot/bin", outputBase + "/execroot/gen", outputBase + "/execroot/testlogs");
}
BlazeVersionData blazeVersionData = this.blazeVersionData != null ? this.blazeVersionData : BlazeVersionData.builder().build();
WorkspacePathResolver workspacePathResolver = this.workspacePathResolver != null ? this.workspacePathResolver : new WorkspacePathResolverImpl(workspaceRoot);
ArtifactLocationDecoder artifactLocationDecoder = this.artifactLocationDecoder != null ? this.artifactLocationDecoder : new ArtifactLocationDecoderImpl(blazeInfo, workspacePathResolver, RemoteOutputArtifacts.EMPTY);
WorkspaceLanguageSettings workspaceLanguageSettings = this.workspaceLanguageSettings != null ? this.workspaceLanguageSettings : new WorkspaceLanguageSettings(WorkspaceType.JAVA, ImmutableSet.of());
SyncState syncState = this.syncState != null ? this.syncState : new SyncState(ImmutableMap.of());
return new BlazeProjectData(new ProjectTargetData(targetMap, /* ideInterfaceState= */
null, RemoteOutputArtifacts.EMPTY), blazeInfo, blazeVersionData, workspacePathResolver, artifactLocationDecoder, workspaceLanguageSettings, syncState);
}
use of com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverImpl in project intellij by bazelbuild.
the class SourceDirectoryCalculatorTest method getDecoder.
private static ArtifactLocationDecoder getDecoder() {
File root = new File("/root");
WorkspaceRoot workspaceRoot = new WorkspaceRoot(root);
BlazeInfo roots = BlazeInfo.createMockBlazeInfo("/", "/root", "/root/out/crosstool/bin", "/root/out/crosstool/gen", "/root/out/crosstool/testlogs");
return new ArtifactLocationDecoderImpl(roots, new WorkspacePathResolverImpl(workspaceRoot), RemoteOutputArtifacts.EMPTY);
}
use of com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverImpl in project intellij by bazelbuild.
the class RelatedWorkspacePathFinderTest method setUp.
@Before
public void setUp() throws IOException {
files = new MockFileOperationProvider();
intellij.registerApplicationService(FileOperationProvider.class, files);
relatedPathFinder = new RelatedWorkspacePathFinder();
workspacePathResolver = new WorkspacePathResolverImpl(new WorkspaceRoot(WORKSPACE_ROOT));
}
use of com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverImpl in project intellij by bazelbuild.
the class ProjectViewManagerImpl method computeWorkspacePathResolver.
@Nullable
private static WorkspacePathResolver computeWorkspacePathResolver(Project project, BlazeContext context) {
BlazeProjectData projectData = BlazeProjectDataManager.getInstance(project).getBlazeProjectData();
if (projectData != null) {
return projectData.getWorkspacePathResolver();
}
// otherwise try to compute the workspace path resolver from scratch
WorkspaceRoot workspaceRoot = WorkspaceRoot.fromProject(project);
BlazeVcsHandler vcsHandler = BlazeVcsHandler.vcsHandlerForProject(project);
if (vcsHandler == null) {
return null;
}
BlazeVcsHandler.BlazeVcsSyncHandler vcsSyncHandler = vcsHandler.createSyncHandler(project, workspaceRoot);
if (vcsSyncHandler == null) {
return new WorkspacePathResolverImpl(workspaceRoot);
}
boolean ok = vcsSyncHandler.update(context, BlazeExecutor.getInstance().getExecutor());
return ok ? vcsSyncHandler.getWorkspacePathResolver() : null;
}
use of com.google.idea.blaze.base.sync.workspace.WorkspacePathResolverImpl in project intellij by bazelbuild.
the class AllInBuildFileTestContextProviderTest method setProjectView.
protected void setProjectView(String... contents) {
ProjectViewParser projectViewParser = new ProjectViewParser(context, new WorkspacePathResolverImpl(workspaceRoot));
projectViewParser.parseProjectView(Joiner.on("\n").join(contents));
ProjectViewSet result = projectViewParser.getResult();
assertThat(result.getProjectViewFiles()).isNotEmpty();
errorCollector.assertNoIssues();
projectViewManager.setProjectView(result);
}
Aggregations