示例#1
0
        private AssemblyReference[] GetAssemblyReferences(ProjectExtractor extractor)
        {
            var references = extractor.GetAssemblyReferenceNodes();

            return(references.Select(r => CreateAssemblyReference(r, () => r.IsPrivate))
                   .Where(ar => ar.AssemblyReferneceType != AssemblyReferneceType.None).ToArray());
        }
示例#2
0
        private static string[] GetCopyLocals(ResolveConfig config, string project)
        {
            var extractor = new ProjectExtractor(project, config);
            var projectReferenceNodes = extractor.GetProjectReferenceNodes().ToArray();
            Array.ForEach(projectReferenceNodes, n => n.Include = config.GetAssemblyNameByProjectPath(ToFullPath(n.Include, project)));

            var nodes = extractor.GetAssemblyReferenceNodes()
               .Concat(projectReferenceNodes.Where(n => !string.IsNullOrEmpty(n.Include)))
               .Where(n => n.IsPrivate && config.IsManaged(n.Include, n.HintPath, project));

            return nodes.Select(n => n.Include).ToArray();
        }
示例#3
0
        private AssemblyReference[] GetRuntimeReferences(ProjectExtractor extractor)
        {
            var references = extractor.GetCommonRuntimeReferenceNodes();

            if (!string.IsNullOrEmpty(runtimeProfile))
            {
                var profileReferences = extractor.GetRuntimeReferenceNodes(runtimeProfile);
                references = references.Concat(profileReferences);
            }
            else
            {
                var defaultReferences = extractor.GetDefaultRuntimeReferenceNodes();
                references = references.Concat(defaultReferences);
            }

            return(references.Select(r => CreateAssemblyReference(r, () => true))
                   .Where(ar => ar.AssemblyReferneceType != AssemblyReferneceType.None).ToArray());
        }
示例#4
0
 public ProjectNode BuildUp()
 {
     if (!cache.ContainsKey(projectFullPath))
     {
         var extractor = new ProjectExtractor(projectFullPath, resolveConfig);
         var project   = new ProjectNode
         {
             Id = extractor.GetId(),
             AssemblyReferences = GetAssemblyReferences(extractor),
             ProjectReferences  = GetProjectReferences(extractor),
             RuntimeReferences  = GetRuntimeReferences(extractor),
             FullPath           = projectFullPath,
             Output             = resolveConfig.GetAssemblyNameByProjectPath(projectFullPath)
         };
         cache[projectFullPath] = project;
     }
     return(cache[projectFullPath]);
 }
示例#5
0
 public ProjectNode BuildUp()
 {
     if (!cache.ContainsKey(projectFullPath))
     {
         var extractor = new ProjectExtractor(projectFullPath, resolveConfig);
         var project = new ProjectNode
                           {
                               Id = extractor.GetId(),
                               AssemblyReferences = GetAssemblyReferences(extractor),
                               ProjectReferences = GetProjectReferences(extractor),
                               RuntimeReferences = GetRuntimeReferences(extractor),
                               FullPath = projectFullPath,
                               Output = resolveConfig.GetAssemblyNameByProjectPath(projectFullPath)
                           };
         cache[projectFullPath] = project;
     }
     return cache[projectFullPath];
 }
示例#6
0
        private ProjectReference[] GetProjectReferences(ProjectExtractor extractor)
        {
            var nodesByXPath = extractor.GetProjectReferenceNodes();

            return(nodesByXPath.Select(CreateProjectReference).ToArray());
        }
示例#7
0
 private AssemblyReference[] GetAssemblyReferences(ProjectExtractor extractor)
 {
     var references = extractor.GetAssemblyReferenceNodes();
     return references.Select(r => CreateAssemblyReference(r, () => r.IsPrivate))
         .Where(ar => ar.AssemblyReferneceType != AssemblyReferneceType.None).ToArray();
 }
示例#8
0
        private AssemblyReference[] GetRuntimeReferences(ProjectExtractor extractor)
        {
            var references = extractor.GetCommonRuntimeReferenceNodes();
            if (!string.IsNullOrEmpty(runtimeProfile))
            {
                var profileReferences = extractor.GetRuntimeReferenceNodes(runtimeProfile);
                references = references.Concat(profileReferences);
            }
            else
            {
                var defaultReferences = extractor.GetDefaultRuntimeReferenceNodes();
                references = references.Concat(defaultReferences);
            }

            return references.Select(r => CreateAssemblyReference(r, ()=> true))
                .Where(ar => ar.AssemblyReferneceType != AssemblyReferneceType.None).ToArray();
        }
示例#9
0
 private ProjectReference[] GetProjectReferences(ProjectExtractor extractor)
 {
     var nodesByXPath = extractor.GetProjectReferenceNodes();
     return nodesByXPath.Select(CreateProjectReference).ToArray();
 }