/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { builders.Clear(); if (alias != null && !context.Contains(this)) { foreach (var childRef in alias.References) { if (childRef.Type == reference.Type) { var builder = referenceBuilderFactory.CreateReferenceBuilder(childRef, project); builder.AddToContext(context); builders.Add(builder); } } context.AddBuilder(this, builders); } else { foreach (var dep in context.GetDependencies(this)) { builders.Add(dep); } } }
/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { var moduleName = reference.Uri.Host; var projectName = reference.Uri.AbsolutePath.TrimStart('/'); if (suite.HasModule(moduleName)) { var module = suite.GetModule(moduleName); referencedProject = module.GetProjectOrTestProject(projectName); if (!context.Contains(this)) { if (referencedProject != null) { subtasks = new HashSet <IBuilder>(); context.AddBuilder(this, SubtaskGenerator(context)); } else { throw new InvalidReferenceException(string.Format("Module {0} has no project called {1}", moduleName, projectName)); } } else { subtasks = new HashSet <IBuilder>(context.GetDependencies(this)); } } else { throw new InvalidReferenceException(string.Format("Suite has no module called {0}", moduleName)); } }
private IBuilder CreateRuntimeReferenceDeployment(IBuildContext context, Project project, IReferenceBuilder refBuilder) { var copy = new CopyResultBuilder(refBuilder, targetRoot, targetRoot.GetChildDirectory(project.Module.Name, createIfMissing: true)); context.AddBuilder(copy, new[] { refBuilder }); return(copy); }
/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { foreach (var builder in sourceBuilders) { builder.AddToContext(context); } context.AddBuilder(this, sourceBuilders); }
private IBuilder AddProductBuildStep(IBuildContext context, Product product, IBuilder rootBuilder) { var productOutput = targetRoot.GetChildDirectory(product.Name, createIfMissing: true); var copyResultsStep = coreBuilderFactory.CreateCopyResultBuilder(rootBuilder, productOutput); context.AddBuilder(copyResultsStep); var resultBuilders = new List <IPostProcessor>(); if (product.PostProcessors.Any()) { var factories = postProcessorFactories.ToList(); foreach (var pp in product.PostProcessors) { var postProcessor = factories .Select(f => f.CreatePostProcessorFor(product, pp, new[] { copyResultsStep })) .FirstOrDefault(p => p != null); if (postProcessor != null) { resultBuilders.Add(postProcessor); } } } if (resultBuilders.Any()) { var merger = coreBuilderFactory.CreateMergingBuilder(resultBuilders, new DescriptionTag(String.Format("Product {0}'s result builders", product.Name))); context.AddBuilder(merger); return(merger); } else { return(copyResultsStep); } }
/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { if (!context.Contains(this)) { referenceBuilders = new HashSet <IBuilder>(project.References.Select(CreateReferenceBuilder)); foreach (var refBuilder in referenceBuilders) { refBuilder.AddToContext(context); } context.AddBuilder(this, referenceBuilders); } else { referenceBuilders = new HashSet <IBuilder>(context.GetDependencies(this)); } }
public void AddBuilder(IBuilder builder, IEnumerable <IBuilder> prerequisites) { IBuilder finalBuilder = ConvertBuilder(builder); IEnumerable <IBuilder> finalPrerequisites = null; if (finalBuilder != null) { finalPrerequisites = new IBuilder[0]; } else { finalBuilder = builder; } if (finalPrerequisites == null) { finalPrerequisites = prerequisites.Select(ResolveBuilder); } baseContext.AddBuilder(finalBuilder, finalPrerequisites); }
/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { if (!context.Contains(this)) { log.DebugFormat("Creating reference builders for {0}", project.Name); referenceBuilders = new HashSet <IBuilder>( project.References.Where(r => r.Type == ReferenceType.Build).Select(CreateReferenceBuilder)); foreach (var refBuilder in referenceBuilders) { refBuilder.AddToContext(context); } context.AddBuilder(this, referenceBuilders); log.DebugFormat("{0} added to build context", project.Name); } else { referenceBuilders = new HashSet <IBuilder>(context.GetDependencies(this)); } }
/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { string projectName = reference.Uri.Host; referencedProject = module.GetProjectOrTestProject(projectName); if (!context.Contains(this)) { if (referencedProject != null) { subtasks = new HashSet <IBuilder>(); context.AddBuilder(this, SubtaskGenerator(context)); } else { throw new InvalidReferenceException(string.Format("Module {0} has no project called {1}", module.Name, projectName)); } } else { subtasks = new HashSet <IBuilder>(context.GetDependencies(this)); } }
public void AddToContext(IBuildContext context) { context.AddBuilder(this, dependencies); }
/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { context.AddBuilder(this, new IBuilder[0]); }
/// <summary> /// Prepares a builder to be ran in a given build context. /// /// <para>This is the place where a builder can add additional dependencies.</para> /// </summary> /// <param name="context">The current build context</param> public void AddToContext(IBuildContext context) { context.AddBuilder(this, new[] { slnBuilder }); }
public void AddToContext(IBuildContext context) { context.AddBuilder(this, new IBuilder[0]); }
private IBuilder CreateRuntimeReferenceDeployment(IBuildContext context, Project project, IReferenceBuilder refBuilder) { var copy = new CopyResultBuilder(refBuilder, targetRoot, targetRoot.GetChildDirectory(project.Module.Name, createIfMissing: true)); context.AddBuilder(copy, new[] { refBuilder }); return copy; }
public void AddToContext(IBuildContext context) { context.AddBuilder(this, dependencies); }
private IBuilder AddProductBuildStep(IBuildContext context, Product product, IBuilder rootBuilder) { var productOutput = targetRoot.GetChildDirectory(product.Name, createIfMissing: true); var copyResultsStep = coreBuilderFactory.CreateCopyResultBuilder(rootBuilder, productOutput); context.AddBuilder(copyResultsStep); var resultBuilders = new List<IPostProcessor>(); if (product.PostProcessors.Any()) { var factories = postProcessorFactories.ToList(); foreach (var pp in product.PostProcessors) { var postProcessor = factories .Select(f => f.CreatePostProcessorFor(product, pp, new[] { copyResultsStep })) .FirstOrDefault(p => p != null); if (postProcessor != null) { resultBuilders.Add(postProcessor); } } } if (resultBuilders.Any()) { var merger = coreBuilderFactory.CreateMergingBuilder(resultBuilders, new DescriptionTag(String.Format("Product {0}'s result builders", product.Name))); context.AddBuilder(merger); return merger; } else { return copyResultsStep; } }