예제 #1
0
 public static Bootstrapper AddHostingCommands(this Bootstrapper bootstrapper)
 {
     _ = bootstrapper ?? throw new ArgumentNullException(nameof(bootstrapper));
     bootstrapper.AddCommand <PreviewCommand>();
     bootstrapper.AddCommand <ServeCommand>();
     return(bootstrapper);
 }
예제 #2
0
 public static Bootstrapper AddBuildCommands(this Bootstrapper bootstrapper)
 {
     _ = bootstrapper ?? throw new ArgumentNullException(nameof(bootstrapper));
     bootstrapper.SetDefaultCommand <PipelinesCommand <PipelinesCommandSettings> >();
     bootstrapper.AddCommand <PipelinesCommand <PipelinesCommandSettings> >();
     bootstrapper.AddCommand <DeployCommand>();
     bootstrapper.AddCommands();
     return(bootstrapper);
 }
 public static Bootstrapper AddCommands <TParent>(this Bootstrapper bootstrapper)
 {
     _ = bootstrapper ?? throw new ArgumentNullException(nameof(bootstrapper));
     foreach (Type commandType in typeof(TParent).GetNestedTypes().Where(x => typeof(ICommand).IsAssignableFrom(x)))
     {
         bootstrapper.AddCommand(commandType);
     }
     return(bootstrapper);
 }
 /// <summary>
 /// Adds all commands that implement <see cref="ICommand"/> from the specified assembly.
 /// </summary>
 /// <param name="bootstrapper">The bootstrapper.</param>
 /// <param name="assembly">The assembly to add commands from.</param>
 /// <returns>The current bootstrapper.</returns>
 public static Bootstrapper AddCommands(this Bootstrapper bootstrapper, Assembly assembly)
 {
     _ = bootstrapper ?? throw new ArgumentNullException(nameof(bootstrapper));
     _ = assembly ?? throw new ArgumentNullException(nameof(assembly));
     foreach (Type commandType in bootstrapper.ClassCatalog.GetTypesAssignableTo <ICommand>().Where(x => x.Assembly.Equals(assembly)))
     {
         bootstrapper.AddCommand(commandType);
     }
     return(bootstrapper);
 }