Ejemplo n.º 1
0
 private void applyProjectTemplates(TemplateRequest request, TemplatePlan plan)
 {
     GenericEnumerableExtensions.Each <ProjectRequest>(request.Projects, delegate(ProjectRequest proj)
     {
         this.buildProjectPlan(plan, proj);
     });
 }
Ejemplo n.º 2
0
 private void applyTestingTemplates(TemplateRequest request, TemplatePlan plan)
 {
     GenericEnumerableExtensions.Each <ProjectRequest>(request.TestingProjects, delegate(ProjectRequest proj)
     {
         this.buildProjectPlan(plan, proj);
         plan.Add(new CopyProjectReferences(proj.OriginalProject));
     });
 }
Ejemplo n.º 3
0
        protected override void configurePlan(string directory, TemplatePlan plan)
        {
            ProjectPlan current = plan.Steps.OfType <ProjectPlan>().LastOrDefault <ProjectPlan>();

            GenericEnumerableExtensions.Each <ProjectDirectory>(ProjectDirectory.PlanForDirectory(directory), delegate(ProjectDirectory x)
            {
                current.Add(x);
            });
        }
Ejemplo n.º 4
0
        private void applySolutionTemplates(TemplateRequest request, TemplatePlan plan)
        {
            SolutionPlanner planner = new SolutionPlanner();

            GenericEnumerableExtensions.Each <Template>(this._library.Find(TemplateType.Solution, request.Templates), delegate(Template template)
            {
                planner.CreatePlan(template, plan);
            });
        }
Ejemplo n.º 5
0
 public void DetermineSteps(string directory, TemplatePlan plan)
 {
     GenericEnumerableExtensions.Each <TextFile>(from x in TextFile.FileSystem.FindFiles(directory, this._matching)
                                                 select new TextFile(x, FubuCore.StringExtensions.PathRelativeTo(x, directory)), delegate(TextFile file)
     {
         this._action(file, plan);
         plan.MarkHandled(file.Path);
     });
 }
Ejemplo n.º 6
0
 public void CreatePlan(Template template, TemplatePlan plan)
 {
     this.configurePlan(template.Path, plan);
     GenericEnumerableExtensions.Each <ITemplatePlanner>(this._planners, delegate(ITemplatePlanner x)
     {
         x.DetermineSteps(template.Path, plan);
     });
     plan.CopyUnhandledFiles(template.Path);
 }
Ejemplo n.º 7
0
        public TemplatePlan BuildPlan(TemplateRequest request)
        {
            TemplatePlan plan = new TemplatePlan(request.RootDirectory);

            if (FubuCore.StringExtensions.IsNotEmpty(request.SolutionName))
            {
                TemplatePlanBuilder.determineSolutionFileHandling(request, plan);
            }
            this.applySolutionTemplates(request, plan);
            request.Substitutions.CopyTo(plan.Substitutions);
            this.applyProjectTemplates(request, plan);
            this.applyTestingTemplates(request, plan);
            return(plan);
        }
Ejemplo n.º 8
0
        private void buildProjectPlan(TemplatePlan plan, ProjectRequest proj)
        {
            ProjectPlan projectPlan = new ProjectPlan(proj.Name)
            {
                DotNetVersion = (proj.Version ?? DotNetVersion.V40)
            };

            plan.Add(projectPlan);
            proj.Substitutions.CopyTo(projectPlan.Substitutions);
            ProjectPlanner planner = new ProjectPlanner();

            if (FubuCore.StringExtensions.IsNotEmpty(proj.Template))
            {
                planner.CreatePlan(this._library.Find(TemplateType.Project, proj.Template), plan);
            }
            GenericEnumerableExtensions.Each <Template>(this._library.Find(TemplateType.Alteration, proj.Alterations), delegate(Template template)
            {
                planner.CreatePlan(template, plan);
            });
        }
Ejemplo n.º 9
0
        private static void determineSolutionFileHandling(TemplateRequest request, TemplatePlan plan)
        {
            string sourceDirectory = plan.SourceDirectory;
            string expectedFile    = FubuCore.StringExtensions.AppendPath(sourceDirectory, new string[]
            {
                request.SolutionName
            });

            if (Path.GetExtension(expectedFile) != ".sln")
            {
                expectedFile += ".sln";
            }
            if (File.Exists(expectedFile))
            {
                plan.Add(new ReadSolution(expectedFile));
                return;
            }
            plan.Add(new CreateSolution(request.SolutionName)
            {
                Version = request.Version
            });
        }
Ejemplo n.º 10
0
 protected override void configurePlan(string directory, TemplatePlan plan)
 {
     GenericEnumerableExtensions.Each <SolutionDirectory>(SolutionDirectory.PlanForDirectory(directory), new Action <SolutionDirectory>(plan.Add));
 }
Ejemplo n.º 11
0
 protected abstract void configurePlan(string directory, TemplatePlan plan);