private void applyProjectTemplates(TemplateRequest request, TemplatePlan plan) { GenericEnumerableExtensions.Each <ProjectRequest>(request.Projects, delegate(ProjectRequest proj) { this.buildProjectPlan(plan, proj); }); }
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)); }); }
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); }); }
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); }); }
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); }); }
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); }
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); }
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); }); }
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 }); }
protected override void configurePlan(string directory, TemplatePlan plan) { GenericEnumerableExtensions.Each <SolutionDirectory>(SolutionDirectory.PlanForDirectory(directory), new Action <SolutionDirectory>(plan.Add)); }
protected abstract void configurePlan(string directory, TemplatePlan plan);