public void SetUp()
        {
            thePlan = TemplatePlan.CreateClean("copy-references");

            thePlan.FileSystem.WriteStringToFile("ripple.dependencies.config", @"FubuCore
            FubuMVC.Core
            ");

            thePlan.Add(new CreateSolution("References"));
            var originalPlan = new ProjectPlan("References");
            thePlan.Add(originalPlan);
            originalPlan.Add(new SystemReference("System.Data"));
            originalPlan.Add(new SystemReference("System.Configuration"));
            originalPlan.Add(new CopyFileToProject("ripple.dependencies.config", "ripple.dependencies.config"));
            originalPlan.NugetDeclarations.Add("Bottles");
            originalPlan.NugetDeclarations.Add("FubuMVC.Core");
            originalPlan.NugetDeclarations.Add("FubuLocalization");

            testingPlan = new ProjectPlan("References.Testing");
            thePlan.Add(testingPlan);
            thePlan.Add(new CopyProjectReferences("References"));

            thePlan.Execute();

            theOriginalProject = thePlan.Solution.FindProject("References").Project;
            theTestingProject = thePlan.Solution.FindProject("References.Testing").Project;
        }
예제 #2
0
        public static void ExecutePlan(TemplatePlan plan)
        {
            plan.Execute();

            new RakeStep().Alter(plan);

            plan.WriteInstructions();
        }
예제 #3
0
        public void alter_by_creating_new_project_from_default_template()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            thePlan.Add(new ProjectPlan("MyProject"));

            thePlan.Execute();

            var file = thePlan.SourceDirectory.AppendPath("MyProject", "MyProject.csproj");
            File.Exists(file).ShouldBeTrue();

            var project = CsProjFile.LoadFrom(file);
            project.ShouldNotBeNull();  // really just a smoke test
        }
        public void copy_a_deep_path_to_the_right_spot()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");
            thePlan.Add(projectPlan);

            thePlan.FileSystem.WriteStringToFile("foo.txt", "some text");
            projectPlan.Add(new CopyFileToProject("bar/folder/foo.txt", "foo.txt"));

            thePlan.Execute();

            var file = FileSystem.Combine(thePlan.SourceDirectory, "MyProject", "bar", "folder", "foo.txt");
            File.Exists(file).ShouldBeTrue();
        }
        public void adds_the_project_file_to_the_csproj_file_as_Content()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");
            thePlan.Add(projectPlan);

            thePlan.FileSystem.WriteStringToFile("foo.txt", "some text");
            projectPlan.Add(new CopyFileToProject("foo.txt", "foo.txt"));

            thePlan.Execute();

            var project = CsProjFile.LoadFrom("copy-file-to-project".AppendPath("src", "MyProject", "MyProject.csproj"));
            project.Find<Content>("foo.txt").ShouldNotBeNull();
        }
        public void applies_substitutions()
        {
            thePlan = TemplatePlan.CreateClean("copy-file-to-project");

            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");
            thePlan.Add(projectPlan);
            projectPlan.Substitutions.Set("%TEAM%", "Chiefs");

            thePlan.FileSystem.WriteStringToFile("foo.txt", "*%TEAM%*");
            projectPlan.Add(new CopyFileToProject("foo.txt", "foo.txt"));

            thePlan.Execute();

            var file = FileSystem.Combine(thePlan.SourceDirectory, "MyProject", "foo.txt");
            thePlan.FileSystem.ReadStringFromFile(file).ShouldEqual("*Chiefs*");
        }
예제 #7
0
        public void alter_by_creating_a_new_project_with_a_project_template_file()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            thePlan.Add(new ProjectPlan("MyProject")
            {
                ProjectTemplateFile = "Project.txt"
            });

            thePlan.Execute();

            var file = thePlan.SourceDirectory.AppendPath("MyProject", "MyProject.csproj");
            File.Exists(file).ShouldBeTrue();

            var project = CsProjFile.LoadFrom(file);
            project.All<AssemblyReference>().Any(x => x.Include == "System.Data")
                .ShouldBeTrue(); // the 'special' testing template has this reference, but the default template does not
        }
예제 #8
0
        public void project_path_is_substituted()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            thePlan.Add(new ProjectPlan("MyProject"));

            thePlan.Execute();

            thePlan.CurrentProject.ApplySubstitutions("*%PROJECT_PATH%*")
                   .ShouldEqual("*src/MyProject/MyProject.csproj*");
        }
예제 #9
0
        public void project_plan_applies_the_dot_net_version_2()
        {
            thePlan = TemplatePlan.CreateClean("create-solutionProject");
            thePlan.Add(new CreateSolution("MySolution"));
            var projectPlan = new ProjectPlan("MyProject");
            projectPlan.DotNetVersion = DotNetVersion.V45;

            thePlan.Add(projectPlan);

            thePlan.Execute();

            var file = thePlan.SourceDirectory.AppendPath("MyProject", "MyProject.csproj");
            File.Exists(file).ShouldBeTrue();

            var project = CsProjFile.LoadFrom(file);
            project.DotNetVersion.ShouldEqual(DotNetVersion.V45);
        }
예제 #10
0
        private void executePlan(Action<TemplateRequest> configure = null)
        {
            if (configure != null)
            {
                configure(theRequest);
            }

            thePlan = new TemplatePlanBuilder(library).BuildPlan(theRequest);

            thePlan.Execute();
        }