Exemple #1
0
        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;
Exemple #2
0
        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));
        }
Exemple #3
0
        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);
        }
Exemple #4
0
 /// <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];
Exemple #5
0
 public ProjectItemInstance this[(ProjectGraphNode node, ProjectGraphNode reference)key]