internal void AddProjectReference(ProjectGraphNode reference, ProjectItemInstance projectReferenceItem, GraphBuilder.GraphEdges edges) { _projectReferences.Add(reference); reference._referencingProjects.Add(this); // First edge wins, in accordance with vanilla msbuild behaviour when multiple msbuild tasks call into the same logical project edges[(this, reference)] = projectReferenceItem;
private ParsedProject ParseProject(ConfigurationMetadata configurationMetadata) { // TODO: ProjectInstance just converts the dictionary back to a PropertyDictionary, so find a way to directly provide it. var globalProperties = configurationMetadata.GlobalProperties.ToDictionary(); var projectInstance = _projectInstanceFactory( configurationMetadata.ProjectFullPath, globalProperties, _projectCollection); if (projectInstance == null) { throw new InvalidOperationException(ResourceUtilities.GetResourceString("NullReferenceFromProjectInstanceFactory")); } var graphNode = new ProjectGraphNode(projectInstance); var referenceInfos = ParseReferences(graphNode); return(new ParsedProject(configurationMetadata, graphNode, referenceInfos)); }
private List <ProjectInterpretation.ReferenceInfo> ParseReferences(ProjectGraphNode parsedProject) { var referenceInfos = new List <ProjectInterpretation.ReferenceInfo>(); foreach (var referenceInfo in _projectInterpretation.GetReferences(parsedProject.ProjectInstance)) { if (FileUtilities.IsSolutionFilename(referenceInfo.ReferenceConfiguration.ProjectFullPath)) { throw new InvalidOperationException(ResourceUtilities.FormatResourceStringIgnoreCodeAndKeyword( "StaticGraphDoesNotSupportSlnReferences", referenceInfo.ReferenceConfiguration.ProjectFullPath, referenceInfo.ReferenceConfiguration.ProjectFullPath )); } SubmitProjectForParsing(referenceInfo.ReferenceConfiguration); referenceInfos.Add(referenceInfo); } return(referenceInfos); }
/// <summary> /// Indexer which sets or returns results for the specified node /// </summary> /// <param name="node">The node</param> /// <returns>The results for the specified node</returns> /// <exception>KeyNotFoundException is returned if the specified node doesn't exist when reading this property.</exception> public BuildResult this[ProjectGraphNode node] => ResultsByNode[node];
public ProjectItemInstance this[(ProjectGraphNode node, ProjectGraphNode reference)key]