public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.Fubu).Add("fubu", "1.2.0.0"));

            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("fubu", "1.0.0.1", UpdateMode.Fixed);
                    test.LocalDependency("fubu", "1.0.0.1");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("fubu"),
                Operation = OperationType.Update,
                ForceUpdates = false
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.Fubu).Add("fubu", "1.2.0.0"));

            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("fubu", "1.0.0.1", UpdateMode.Fixed);
                    test.LocalDependency("fubu", "1.0.0.1");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution     = theSolution,
                Dependency   = new Dependency("fubu"),
                Operation    = OperationType.Update,
                ForceUpdates = false
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            theScenario = SolutionGraphScenario.Create(scenario => scenario.Solution("Test"));

            theSolution = theScenario.Find("Test");

            var cache = theSolution.Cache.ToFeed();

            FeedScenario.Create(scenario =>
            {
                scenario.For(cache).Add("FubuCore", "1.0.0.1");
                scenario.Offline();
            });

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("FubuCore", "1.0.0.1", UpdateMode.Fixed),
                Operation = OperationType.Install,
                Project = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
                {
                    scenario.For(Feed.Fubu)
                            .Add("FubuCore", "1.1.0.0")
                            .Add("FubuCore", "1.2.0.0");
                });

            theScenario = SolutionScenario.Create(scenario =>
                {
                    scenario.Solution("Test", sln =>
                        {
                            sln.LocalDependency("FubuCore", "1.1.0.0");

                            sln.ProjectDependency("Test1", "FubuCore");
                        });
                });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
                {
                    Solution = theSolution,
                    Dependency = new Dependency("FubuCore"),
                    Operation = OperationType.Update,
                    ForceUpdates = false
                };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.Fubu).Add("FubuCore", "1.0.0.1"));
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.NuGetV2)
                .Add("TopShelf", "1.1.0.0")
                .Add("log4net", "1.0.0.5")
                .Add("log4net", "1.0.1.1")
                .ConfigureRepository(nuget =>
                {
                    nuget.ConfigurePackage("TopShelf", "1.1.0.0", topshelf => topshelf.DependsOn("log4net"));
                });
            });

            theScenario = SolutionScenario.Create(scenario => scenario.Solution("Test"));
            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution   = theSolution,
                Dependency = new Dependency("TopShelf", "1.1.0.0", UpdateMode.Fixed),
                Operation  = OperationType.Install,
                Project    = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", sln =>
                {
                    sln.LocalDependency("FubuCore", "1.1.0.0");

                    sln.ProjectDependency("Test1", "FubuCore");
                });
            });

            theSolution = theScenario.Find("Test");

            FeedScenario.Create(scenario =>
            {
                scenario.For(theSolution.Cache.ToFeed())
                .Add("FubuCore", "1.1.0.0")
                .Add("FubuCore", "1.2.0.0");

                scenario.Offline();
            });

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution     = theSolution,
                Dependency   = new Dependency("FubuCore"),
                Operation    = OperationType.Update,
                ForceUpdates = false
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.Fubu).Add("FubuCore", "1.0.0.1"));
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.NuGetV2)
                        .Add("TopShelf", "1.1.0.0")
                        .Add("log4net", "1.0.0.5")
                        .Add("log4net", "1.0.1.1")
                        .ConfigureRepository(nuget =>
                        {
                            nuget.ConfigurePackage("TopShelf", "1.1.0.0", topshelf => topshelf.DependsOn("log4net"));
                        });
            });

            theScenario = SolutionGraphScenario.Create(scenario => scenario.Solution("Test"));
            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("TopShelf", "1.1.0.0", UpdateMode.Fixed),
                Operation = OperationType.Install,
                Project = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
Exemplo n.º 8
0
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.NuGetV2)
                .Add("FubuCore", "1.2.0.0-alpha");
            });

            theScenario = SolutionScenario.Create(scenario => scenario.Solution("Test"));

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution   = theSolution,
                Dependency = new Dependency("FubuCore", "1.2.0.0", UpdateMode.Fixed)
                {
                    NugetStability = NugetStability.Anything
                },
                Operation = OperationType.Install,
                Project   = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            theScenario = SolutionScenario.Create(scenario => scenario.Solution("Test"));

            theSolution = theScenario.Find("Test");

            var cache = theSolution.Cache.ToFeed();

            FeedScenario.Create(scenario =>
            {
                scenario.For(cache).Add("FubuCore", "1.0.0.1");
                scenario.Offline();
            });

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution   = theSolution,
                Dependency = new Dependency("FubuCore", "1.0.0.1", UpdateMode.Fixed),
                Operation  = OperationType.Install,
                Project    = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                        .Add("Serenity", "1.1.0.0")
                        .Add("Serenity", "1.2.0.0")
                        .ConfigureRepository(fubu =>
                        {
                            fubu.ConfigurePackage("Serenity", "1.1.0.0", serenity => serenity.DependsOn("WebDriver", "1.1.0.0"));
                            fubu.ConfigurePackage("Serenity", "1.2.0.0", serenity =>
                            {
                                serenity.DependsOn("WebDriver", "1.2.0.0");
                                serenity.DependsOn("Something");
                                serenity.DependsOn("SomethingElse", "0.9.9.9");
                            });
                        });

                scenario.For(Feed.NuGetV2)
                        .Add("Something", "1.0.0.5")
                        .Add("SomethingElse", "0.9.9.9")
                        .Add("WebDriver", "1.1.0.0")
                        .Add("WebDriver", "1.2.0.0");
            });

            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", sln =>
                {
                    sln.SolutionDependency("WebDriver", "1.1.0.0", UpdateMode.Fixed);
                    sln.SolutionDependency("Serenity", "1.1.0.0", UpdateMode.Float);

                    sln.LocalDependency("Serenity", "1.1.0.0");

                    sln.ProjectDependency("Test1", "Serenity");
                    sln.ProjectDependency("Test1", "WebDriver");

                    sln.ProjectDependency("Test2", "Serenity");
                    sln.ProjectDependency("Test2", "WebDriver");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("Serenity"),
                Operation = OperationType.Update,
                ForceUpdates = true
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                .Add("Serenity", "1.1.0.0")
                .Add("Serenity", "1.2.0.0")
                .ConfigureRepository(fubu =>
                {
                    fubu.ConfigurePackage("Serenity", "1.1.0.0", serenity => serenity.DependsOn("WebDriver", "1.1.0.0"));
                    fubu.ConfigurePackage("Serenity", "1.2.0.0", serenity =>
                    {
                        serenity.DependsOn("WebDriver", "1.2.0.0");
                        serenity.DependsOn("Something");
                        serenity.DependsOn("SomethingElse", "0.9.9.9");
                    });
                });

                scenario.For(Feed.NuGetV2)
                .Add("Something", "1.0.0.5")
                .Add("SomethingElse", "0.9.9.9")
                .Add("WebDriver", "1.1.0.0")
                .Add("WebDriver", "1.2.0.0");
            });

            theScenario = SolutionScenario.Create(scenario =>
            {
                scenario.Solution("Test", sln =>
                {
                    sln.SolutionDependency("WebDriver", "1.1.0.0", UpdateMode.Fixed);
                    sln.SolutionDependency("Serenity", "1.1.0.0", UpdateMode.Float);

                    sln.LocalDependency("Serenity", "1.1.0.0");

                    sln.ProjectDependency("Test1", "Serenity");
                    sln.ProjectDependency("Test1", "WebDriver");

                    sln.ProjectDependency("Test2", "Serenity");
                    sln.ProjectDependency("Test2", "WebDriver");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution     = theSolution,
                Dependency   = new Dependency("Serenity"),
                Operation    = OperationType.Update,
                ForceUpdates = true
            };

            thePlan = theBuilder.PlanFor(request);
        }
Exemplo n.º 12
0
        private NugetPlan buildPlan(NugetPlanRequest request, Dependency parent = null, int depth = 0)
        {
            var plan = new NugetPlan();
            var target = request.Dependency;
            var solution = request.Solution;

            var key = target.Copy();
            if (key.IsFloat())
            {
                key = target.AsFloat();
            }

            if (_planCache.Has(key))
            {
                return _planCache[key];
            }

            _planCache.Fill(key, plan);

            RippleLog.Info("* Analyzing " + target);

            if (target.Version.IsEmpty())
            {
                var remote = solution.FeedService.NugetFor(solution, target);
                target.Version = remote.Version.ToString();
            }

            if (request.UpdatesCurrentDependency())
            {
                var configured = solution.Dependencies.Find(target.Name);
                var shouldUpdate = (depth != 0 || request.Operation == OperationType.Update) && (request.ForceUpdates || configured.IsFloat());
                if (shouldUpdate)
                {
                    plan.AddStep(new UpdateDependency(target));
                }
                else
                {
                    RippleLog.Info("Warning: This operation requires {0} to be updated to {1} but it is marked as fixed. Use the force option to correct this.".ToFormat(target.Name, target.Version));
                }
            }
            else if(!solution.Dependencies.Has(target.Name))
            {
                plan.AddStep(new InstallSolutionDependency(target));
            }

            projectInstallations(plan, parent, request);

            var nugetDependencies = solution.FeedService.DependenciesFor(solution, target, target.Mode);
            nugetDependencies.Each(x =>
            {
                var childPlan = buildPlan(request.CopyFor(x), target, depth + 1);
                plan.Import(childPlan);
            });

            return plan;
        }
Exemplo n.º 13
0
        public void importing_a_plan_with_no_overlaps()
        {
            var plan2 = new NugetPlan();
            plan2.AddStep(new UpdateDependency(new Dependency("d3")));
            plan2.AddStep(new UpdateDependency(new Dependency("d4")));

            thePlan.Import(plan2);
            thePlan.ShouldHaveTheSameElementsAs(
                update("d1"),
                update("d2"),
                update("d3"),
                update("d4")
            );
        }
Exemplo n.º 14
0
        public static NugetPlan PlanFor(INugetOperationContext context, Solution solution)
        {
            var aggregatePlan = new NugetPlan();

            var requests = context.Requests(solution);
            requests.Each(request =>
            {
                request.Solution = solution;

                var plan = solution.Builder.PlanFor(request);
                aggregatePlan.Import(plan);
            });

            return aggregatePlan;
        }
Exemplo n.º 15
0
        public void importing_a_plan_with_no_overlaps()
        {
            var plan2 = new NugetPlan();

            plan2.AddStep(new UpdateDependency(new Dependency("d3")));
            plan2.AddStep(new UpdateDependency(new Dependency("d4")));

            thePlan.Import(plan2);
            thePlan.ShouldHaveTheSameElementsAs(
                update("d1"),
                update("d2"),
                update("d3"),
                update("d4")
                );
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                        .Add("FubuTestingSupport", "1.1.0.0")
                        .Add("FubuTestingSupport", "1.2.0.0")
                        .Add("StructureMap", "2.6.4") // this just makes the test flow easier
                        .ConfigureRepository(fubu =>
                        {
                            fubu.ConfigurePackage("FubuTestingSupport", "1.2.0.0", support =>
                            {
                                support.DependsOn("StructureMap").Min("2.6.4");
                            });
                        });

                scenario.For(Feed.NuGetV2)
                    .Add("structuremap", "2.6.3");
            });

            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", sln =>
                {
                    sln.LocalDependency("FubuTestingSupport", "1.1.0.0");
                    sln.LocalDependency("structuremap", "2.6.3");

                    sln.SolutionDependency("structuremap", "2.6.3", UpdateMode.Fixed);

                    sln.ProjectDependency("Test1", "FubuTestingSupport");
                    sln.ProjectDependency("Test1", "structuremap");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("FubuTestingSupport"),
                Operation = OperationType.Update,
                ForceUpdates = false
            };

            thePlan = theBuilder.PlanFor(request);
        }
Exemplo n.º 17
0
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                .Add("FubuTestingSupport", "1.1.0.0")
                .Add("FubuTestingSupport", "1.2.0.0")
                .Add("StructureMap", "2.6.4")         // this just makes the test flow easier
                .ConfigureRepository(fubu =>
                {
                    fubu.ConfigurePackage("FubuTestingSupport", "1.2.0.0", support =>
                    {
                        support.DependsOn("StructureMap").Min("2.6.4");
                    });
                });

                scenario.For(Feed.NuGetV2)
                .Add("structuremap", "2.6.3");
            });

            theScenario = SolutionScenario.Create(scenario =>
            {
                scenario.Solution("Test", sln =>
                {
                    sln.LocalDependency("FubuTestingSupport", "1.1.0.0");
                    sln.LocalDependency("structuremap", "2.6.3");

                    sln.SolutionDependency("structuremap", "2.6.3", UpdateMode.Fixed);

                    sln.ProjectDependency("Test1", "FubuTestingSupport");
                    sln.ProjectDependency("Test1", "structuremap");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution     = theSolution,
                Dependency   = new Dependency("FubuTestingSupport"),
                Operation    = OperationType.Update,
                ForceUpdates = false
            };

            thePlan = theBuilder.PlanFor(request);
        }
Exemplo n.º 18
0
        public static NugetPlan PlanFor(INugetOperationContext context, Solution solution)
        {
            var aggregatePlan = new NugetPlan();

            var requests = context.Requests(solution);

            requests.Each(request =>
            {
                request.Solution = solution;

                var plan = solution.Builder.PlanFor(request);
                aggregatePlan.Import(plan);
            });

            return(aggregatePlan);
        }
Exemplo n.º 19
0
        private NugetPlan buildPlan(NugetPlanRequest request, Dependency parent = null)
        {
            var plan = new NugetPlan();
            var target = request.Dependency;
            var solution = request.Solution;

            var key = target.Copy();
            if (key.IsFloat())
            {
                key = target.AsFloat();
            }

            if (_planCache.Has(key))
            {
                return _planCache[key];
            }

            _planCache.Fill(key, plan);

            RippleLog.Info("* Analyzing " + target);

            if (target.Version.IsEmpty())
            {
                var remote = solution.FeedService.NugetFor(target);
                target.Version = remote.Version.ToString();
            }

            if (request.UpdatesCurrentDependency())
            {
                updateDependency(plan, request);
            }
            else if(!solution.Dependencies.Has(target.Name))
            {
                plan.AddStep(new InstallSolutionDependency(target));
            }

            projectInstallations(plan, parent, request);

            var nugetDependencies = solution.FeedService.DependenciesFor(target, target.Mode);
            nugetDependencies.Each(x =>
            {
                var childPlan = buildPlan(request.CopyFor(x), target);
                plan.Import(childPlan);
            });

            return plan;
        }
Exemplo n.º 20
0
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                .Add("FubuMVC.Katana", "1.0.0.1")
                .Add("FubuMVC.Core", "1.0.1.1")
                .Add("FubuMVC.Core", "1.1.0.2")
                .Add("FubuMVC.OwinHost", "1.2.0.0")
                .Add("FubuMVC.OwinHost", "1.3.0.0")
                .ConfigureRepository(teamcity =>
                {
                    teamcity.ConfigurePackage("FubuMVC.Katana", "1.0.0.1", katana =>
                    {
                        katana.DependsOn("FubuMVC.Core");
                        katana.DependsOn("FubuMVC.OwinHost");
                    });

                    teamcity.ConfigurePackage("FubuMVC.OwinHost", "1.2.0.0", owin => owin.DependsOn("FubuMVC.Core"));
                    teamcity.ConfigurePackage("FubuMVC.OwinHost", "1.3.0.0", owin =>
                    {
                        owin.DependsOn("FubuMVC.Core");
                        owin.DependsOn("FixedNuget");
                    });
                });

                scenario.For(Feed.NuGetV2)
                .Add("FixedNuget", "1.0.0.0");
            });

            theScenario = SolutionGraphScenario.Create(scenario => scenario.Solution("Test"));
            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution   = theSolution,
                Dependency = new Dependency("FubuMVC.Katana", UpdateMode.Float),
                Operation  = OperationType.Install,
                Project    = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.Fubu)
                        .Add("FubuMVC.Katana", "1.0.0.1")
                        .Add("FubuMVC.Core", "1.0.1.1")
                        .Add("FubuMVC.Core", "1.1.0.2")
                        .Add("FubuMVC.OwinHost", "1.2.0.0")
                        .Add("FubuMVC.OwinHost", "1.3.0.0")
                        .ConfigureRepository(teamcity =>
                        {
                            teamcity.ConfigurePackage("FubuMVC.Katana", "1.0.0.1", katana =>
                            {
                                katana.DependsOn("FubuMVC.Core");
                                katana.DependsOn("FubuMVC.OwinHost");
                            });

                            teamcity.ConfigurePackage("FubuMVC.OwinHost", "1.2.0.0", owin => owin.DependsOn("FubuMVC.Core"));
                            teamcity.ConfigurePackage("FubuMVC.OwinHost", "1.3.0.0", owin =>
	                        {
		                        owin.DependsOn("FubuMVC.Core");
		                        owin.DependsOn("FixedNuget");
	                        });
                        });

	            scenario.For(Feed.NuGetV2)
	                    .Add("FixedNuget", "1.0.0.0");
            });

            theScenario = SolutionScenario.Create(scenario => scenario.Solution("Test"));
            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("FubuMVC.Katana", UpdateMode.Float),
                Operation = OperationType.Install,
                Project = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
Exemplo n.º 22
0
        public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.NuGetV2).Add("fubu", "1.2.0.0"));

            theScenario = SolutionGraphScenario.Create(scenario => scenario.Solution("Test"));
            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution   = theSolution,
                Dependency = new Dependency("fubu", "1.2.0.0", UpdateMode.Fixed),
                Operation  = OperationType.Install
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.NuGetV2).Add("fubu", "1.2.0.0"));

            theScenario = SolutionScenario.Create(scenario => scenario.Solution("Test"));
            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("fubu", "1.2.0.0", UpdateMode.Fixed),
                Operation = OperationType.Install
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario => scenario.For(Feed.Fubu).Add("FubuCore", "1.0.0.1"));

            theScenario = SolutionScenario.Create(scenario => scenario.Solution("Test"));

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("FubuCore", "1.0.0.1", UpdateMode.Fixed),
                Operation = OperationType.Install,
                Project = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
                {
                    scenario.For(Feed.NuGetV2)
                            .Add("FubuCore", "1.2.0.0")
                            .Add("FubuCore", "1.3.0.0")
                            .Add("Bottles", "1.1.0.0")
                            .ConfigureRepository(nuget =>
                                {
                                    nuget.ConfigurePackage("Bottles", "1.1.0.0", bottles => bottles.DependsOn("FubuCore").Min("1.3.0.0"));
                                });
                });

            theScenario = SolutionScenario.Create(scenario =>
                {
                    scenario.Solution("Test", test =>
                        {
                            test.ProjectDependency("Test", "FubuCore");
                            test.LocalDependency("FubuCore", "1.2.0.0");
                            test.SolutionDependency("FubuCore", "1.2.0.0", UpdateMode.Fixed);
                        });
                });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
                {
                    Solution = theSolution,
                    Dependency = new Dependency("Bottles", "1.1.0.0", UpdateMode.Fixed),
                    Operation = OperationType.Install,
                    ForceUpdates = false,
                    Project = "Test"
                };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.NuGetV2)
                    // Omitting this effectively says "FubuCore" doesn't exist in the feed
                    // so we force it to use the local version instead
                    //.Add("FubuCore", "1.2.0.0")
                    .Add("Bottles", "1.1.0.0")
                    .ConfigureRepository(nuget =>
                    {
                        nuget.ConfigurePackage("Bottles", "1.1.0.0", bottles => bottles.DependsOn("FubuCore", "1.2.0.0"));
                    });
            });

            theScenario = SolutionScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("FubuCore", "1.2.0.0", UpdateMode.Float);
                    test.ProjectDependency("Test", "FubuCore");
                    test.LocalDependency("FubuCore", "1.2.0.0");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution = theSolution,
                Dependency = new Dependency("Bottles", "1.1.0.0", UpdateMode.Fixed),
                Operation = OperationType.Install,
                Project = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.NuGetV2)
                // Omitting this effectively says "FubuCore" doesn't exist in the feed
                // so we force it to use the local version instead
                //.Add("FubuCore", "1.2.0.0")
                .Add("Bottles", "1.1.0.0")
                .ConfigureRepository(nuget =>
                {
                    nuget.ConfigurePackage("Bottles", "1.1.0.0", bottles => bottles.DependsOn("FubuCore", "1.2.0.0"));
                });
            });

            theScenario = SolutionScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.SolutionDependency("FubuCore", "1.2.0.0", UpdateMode.Float);
                    test.ProjectDependency("Test", "FubuCore");
                    test.LocalDependency("FubuCore", "1.2.0.0");
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution   = theSolution,
                Dependency = new Dependency("Bottles", "1.1.0.0", UpdateMode.Fixed),
                Operation  = OperationType.Install,
                Project    = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.NuGetV2)
                .Add("FubuCore", "1.2.0.0")
                .Add("FubuCore", "1.3.0.0")
                .Add("Bottles", "1.1.0.0")
                .ConfigureRepository(nuget =>
                {
                    nuget.ConfigurePackage("Bottles", "1.1.0.0", bottles => bottles.DependsOn("FubuCore").Min("1.3.0.0"));
                });
            });

            theScenario = SolutionGraphScenario.Create(scenario =>
            {
                scenario.Solution("Test", test =>
                {
                    test.ProjectDependency("Test", "FubuCore");
                    test.LocalDependency("FubuCore", "1.2.0.0");
                    test.SolutionDependency("FubuCore", "1.2.0.0", UpdateMode.Fixed);
                });
            });

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
            {
                Solution     = theSolution,
                Dependency   = new Dependency("Bottles", "1.1.0.0", UpdateMode.Fixed),
                Operation    = OperationType.Install,
                ForceUpdates = false,
                Project      = "Test"
            };

            thePlan = theBuilder.PlanFor(request);
        }
Exemplo n.º 29
0
        public static NugetPlan PlanFor(INugetOperationContext context, Solution solution)
        {
            var aggregatePlan = new NugetPlan();

            var requests = context.Requests(solution).ToArray();

            requests.Where(x => x.Dependency.IsFixed()).Each(request =>
            {
                request.Solution = solution;

                var plan = solution.Builder.PlanFor(request);
                aggregatePlan.Import(plan);
            });

            requests.Where(x => x.Dependency.IsFloat()).Each(request =>
            {
                request.Solution = solution;

                var plan = solution.Builder.PlanFor(request);
                aggregatePlan.Import(plan);
            });

            return(aggregatePlan);
        }
        public void SetUp()
        {
            FeedScenario.Create(scenario =>
            {
                scenario.For(Feed.NuGetV2)
                        .Add("FubuCore", "1.2.0.0-alpha");
            });

            theScenario = SolutionScenario.Create(scenario => scenario.Solution("Test"));

            theSolution = theScenario.Find("Test");

            theBuilder = new NugetPlanBuilder();

            var request = new NugetPlanRequest
                {
                    Solution = theSolution,
                    Dependency = new Dependency("FubuCore", "1.2.0.0", UpdateMode.Fixed) { NugetStability = NugetStability.Anything },
                    Operation = OperationType.Install,
                    Project = "Test"
                };

            thePlan = theBuilder.PlanFor(request);
        }
Exemplo n.º 31
0
 public void SetUp()
 {
     thePlan = new NugetPlan();
     thePlan.AddStep(new UpdateDependency(new Dependency("d1")));
     thePlan.AddStep(new UpdateDependency(new Dependency("d2")));
 }
Exemplo n.º 32
0
 public void SetUp()
 {
     thePlan = new NugetPlan();
     thePlan.AddStep(new UpdateDependency(new Dependency("d1")));
     thePlan.AddStep(new UpdateDependency(new Dependency("d2")));
 }
Exemplo n.º 33
0
        private NugetPlan buildPlan(NugetPlanRequest request, Dependency parent = null)
        {
            var plan = new NugetPlan();
            var target = request.Dependency;
            var solution = request.Solution;

            var dependencyKey = target.Copy();
            if (dependencyKey.IsFloat())
            {
                dependencyKey = target.AsFloat();
            }

            var key = new PlanKey(dependencyKey, request.Project);
            if (_planCache.Has(key))
            {
                return _planCache[key];
            }

            _planCache.Fill(key, plan);

            RippleLog.Info("* Analyzing " + target);

            if (target.Version.IsEmpty())
            {
                string version = null;
                var local = solution.LocalDependencies();

                if (request.Operation == OperationType.Install && solution.LocalDependencies().Has(target))
                {
                    var localNuget = local.Get(target);
                    version = localNuget.Version.ToString();
                }
                else
                {
                    if (!RippleEnvironment.Connected())
                    {
                        RippleAssert.Fail("Cannot update in offline mode");
                    }

                    var task = solution.FeedService.NugetFor(target);
                    task.Wait();

                    if (!task.Result.Found)
                    {
                        RippleAssert.Fail("Could not find " + request.Dependency);
                    }
                    var remote = task.Result.Nuget;
                    version = remote.Version.ToString();
                }

                target.Version = version;
            }

            if (request.UpdatesCurrentDependency())
            {
                updateDependency(plan, request);
            }
            else if (!solution.Dependencies.Has(target.Name))
            {
                plan.AddStep(new InstallSolutionDependency(target));
            }

            projectInstallations(plan, parent, request);

            var location = request.Operation == OperationType.Install ? SearchLocation.Local : SearchLocation.Remote;

            var nugetDependencies = solution.FeedService.DependenciesFor(target, target.Mode, location);
            nugetDependencies.Each(x =>
            {
                var transitiveDep = request.CopyFor(x);
                var childPlan = buildPlan(transitiveDep, target);
                plan.Import(childPlan);
            });

            return plan;
        }
Exemplo n.º 34
0
        private void updateDependency(NugetPlan plan, NugetPlanRequest request)
        {
            var target = request.Dependency;
            var solution = request.Solution;

            var configured = solution.Dependencies.Find(target.Name);

            if (!request.ShouldUpdate(configured))
            {
                RippleLog.Info("Warning: This operation requires {0} to be updated to {1} but it is marked as fixed. Use the force option to correct this.".ToFormat(target.Name, target.Version));
                return;
            }

            plan.AddStep(new UpdateDependency(target));
        }
Exemplo n.º 35
0
        private void projectInstallations(NugetPlan plan, Dependency parent, NugetPlanRequest request)
        {
            var target = request.Dependency;
            var solution = request.Solution;

            if (request.InstallToProject())
            {
                var project = solution.FindProject(request.Project);
                installToProject(plan, project, target);
            }

            if (parent == null) return;

            var projects = solution.Projects.Where(x => x.Dependencies.Has(parent.Name));
            projects.Each(project => installToProject(plan, project, target));
        }
Exemplo n.º 36
0
 private void installToProject(NugetPlan plan, Project project, Dependency target)
 {
     if (!project.Dependencies.Has(target.Name))
     {
         plan.AddStep(new InstallProjectDependency(project.Name, Dependency.FloatFor(target.Name)));
     }
 }