示例#1
0
        public void Solution(String solutionLocation)
        {
            this.solutionLocation = solutionLocation;
            IList <string> artifacts          = new List <string>();
            var            solutionReferences = new List <string>();
            var            solutionFile       = SolutionFile.Parse(solutionLocation);
            var            projectsInSolution = solutionFile.ProjectsInOrder;

            projectsInSolution.ToList().ForEach(p =>
            {
                if (p.ProjectType == SolutionProjectType.KnownToBeMSBuildFormat)
                {
                    var solutionFolder  = Path.GetFullPath(solutionLocation);
                    var projectLocation = Path.Combine(Path.GetDirectoryName(solutionFolder), p.RelativePath);
                    if (File.Exists(projectLocation))
                    {
                        var project = new Project(projectLocation);

                        string assemblyName = GetAssemblyName(p, project);
                        if (assemblyName != null)
                        {
                            var artifact = new Artifact(solutionLocation, project.FullPath, assemblyName);
                            artifacts.Add(assemblyName);
                            artifactRepository.Add(artifact);
                        }
                        var projectReferences = GetProjectReferences(solutionLocation, project);
                        solutionReferences.AddRange(projectReferences); // this may be wrong

                        ProjectCollection.GlobalProjectCollection.UnloadProject(project);
                    }
                }
            });
            var solution = new SolutionExtract(solutionLocation, solutionReferences, artifacts);

            solutionRepository.Add(solution);
        }
示例#2
0
 public void Add(SolutionExtract solution)
 {
     Solutions.Add(solution);
 }
示例#3
0
 public SolutionNode(SolutionExtract solution)
 {
     Location = solution.Location;
 }