Exemple #1
0
        public static void Run(Action <RunProgramConfigurator> programBuilderAction)
        {
            var runActionBuilder = new RunProgramActionBuilder();
            var action           = runActionBuilder.ConfigureAction(programBuilderAction);

            action.Invoke();
        }
Exemple #2
0
 private static Action BuildNugetPackRunner(NuGetPackCmdConfigurator packConfiguration)
 {
     var runProgramBuilder = new RunProgramActionBuilder();
     return runProgramBuilder.ConfigureAction(c =>
         {
             c.Executable = NuGetExePath;
             c.Arguments("pack", packConfiguration.NuSpec, "-OutputDirectory", packConfiguration.OutputDirectory);
         });
 }
        public Action BuildAction <TActionConfigurator>(Action <TActionConfigurator> actionConfigurator)
        {
            if (actionConfigurator is Action <MsBuildActionConfigurator> )
            {
                var builder = new MsBuildActionBuilder();
                return(builder.ConfigureAction(actionConfigurator as Action <MsBuildActionConfigurator>));
            }

            if (actionConfigurator is Action <RunProgramConfigurator> )
            {
                var builder = new RunProgramActionBuilder();
                return(builder.ConfigureAction(actionConfigurator as Action <RunProgramConfigurator>));
            }

            if (actionConfigurator is Action <XmlTransformConfigurator> )
            {
                var builder = new XmlTransformActionBuilder();
                return(builder.ConfigureAction(actionConfigurator as Action <XmlTransformConfigurator>));
            }

            // TODO: Implement with proper exception
            throw new Exception("Unknown builder!");
        }
Exemple #4
0
 public static void Run(Action<RunProgramConfigurator> programBuilderAction)
 {
     var runActionBuilder = new RunProgramActionBuilder();
     var action = runActionBuilder.ConfigureAction(programBuilderAction);
     action.Invoke();
 }