private MSBuildHost GetNode() { MSBuildHost result = null; result = _nodes.Take(); return(result); }
public async Task <(Project project, List <string> projectReferences, string targetPath)> AddProject(string solutionDir, string projectFile) { if (buildHost == null) { buildHost = new MSBuildHost(sdkPath); } var(info, projectReferences, targetPath) = await buildHost.LoadProject(solutionDir, projectFile); OnProjectAdded(info); return(CurrentSolution.GetProject(info.Id), projectReferences, targetPath); }
public async Task InitialiseAsync() { var tasks = new List <Task>(); for (int i = 0; i < Environment.ProcessorCount; i++) { var newNode = new MSBuildHost(DotNetCliService.Instance.Info.BasePath, i + 1); _nodes.Add(newNode); tasks.Add(newNode.EnsureConnectionAsync()); } await Task.WhenAll(tasks); }
public async Task InitialiseBuildNodesAsync(bool returnAfter1Ready = false) { var tasks = new List <Task>(); for (int i = 0; i < Environment.ProcessorCount; i++) { var newNode = new MSBuildHost(DotNetCliService.Instance.Info.BasePath, i + 1); tasks.Add(newNode.EnsureConnectionAsync().ContinueWith(t => { _buildNodes.Add(newNode); })); } if (returnAfter1Ready) { await Task.WhenAny(tasks); } else { await Task.WhenAll(tasks); } }
private void FreeNode(MSBuildHost node) { _nodes.Add(node); }