public Solution Build()
        {
            var solution = _files.LoadSolution();

            _files.ForProjects(solution, x =>
            {
                var project = _project.Read(x);
                solution.AddProject(project);
            });

            solution.EachProject(project =>
            {
                if (!project.HasProjFile())
                {
                    return;
                }

                var references = project.Proj.ProjectReferences;
                references.Each(r =>
                {
                    var name = r.ProjectName;
                    if (name.Contains(" "))
                    {
                        name = name.Split(' ').First();
                    }

                    var projectRef = solution.FindProject(name);
                    if (projectRef != null)
                    {
                        project.AddProjectReference(projectRef);
                    }
                });
            });

            solution.UseStorage(NugetStorage.For(solution.Mode));

            _fileSystem.CreateDirectory(solution.PackagesDirectory());

            _files.FinalizeSolution(solution);

            solution.Dependencies.MarkRead();

            return(solution);
        }
Exemple #2
0
        public Solution Build()
        {
            var solution = _files.LoadSolution();

            _files.ForProjects(solution, x =>
            {
                var project = _project.Read(x);
                // Account of no packages/ripple config
                if (project != null)
                {
                    solution.AddProject(project);
                }
            });

            solution.EachProject(project =>
            {
                if (!project.HasCsProjFile())
                {
                    return;
                }

                var references = project.CsProj.ProjectReferences;
                references.Each(r =>
                {
                    var projectRef = solution.FindProject(r);
                    if (projectRef != null)
                    {
                        project.AddProjectReference(projectRef);
                    }
                });
            });

            solution.UseStorage(NugetStorage.For(solution.Mode));

            _fileSystem.CreateDirectory(solution.PackagesDirectory());

            _files.FinalizeSolution(solution);

            solution.Dependencies.MarkRead();

            return(solution);
        }