/// <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)); } }
public bool Contains(IBuilder builder) { var resolved = ResolveBuilder(builder); var converted = ConvertBuilder(resolved); return(baseContext.Contains(converted ?? resolved)); }
/// <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) { 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)); } }
/// <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) { if (!context.Contains(this)) { var solutionBuildContext = new SolutionBuildContext(inSolutionReferenceBuilderFactory, context, this); projectBuilders = new HashSet <ISlnProjectBuilder>( from project in projects select CreateProjectBuilder(solutionBuildContext, project) into builder where builder != null select builder ); solutionBuildContext.AddBuilder(this, projectBuilders); } else { projectBuilders = new HashSet <ISlnProjectBuilder>(context.GetDependencies(this).Cast <ISlnProjectBuilder>()); } projectDependencies = MultipleDependenciesHelper.CreateMultipleDependencies(new HashSet <IBuilder>(projectBuilders)); }
/// <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)); } }