Run() public method

public Run ( Recipe recipe, Task task ) : void
recipe Recipe
task Task
return void
示例#1
0
        public static void Main(string[] args)
        {
            Console.WriteLine("Golem (Beta) 2008\nYour friendly executable .NET build tool. \n");

            IList<Recipe> found;
            RecipeCataloger finder = CreateCataloger(out found);

            if(args.Length > 0)
            {
                if(args[0] == "-T")
                {

                    ShowList(found);
                    return;
                }
                else if(args[0].ToLower() == "-?")
                {
                    Console.WriteLine("Help: \n");
                    Console.WriteLine("golem -T   # List build tasks");
                    Console.WriteLine("golem -?   # Show this help");
                    Console.WriteLine("golem -?   # Show this help");
                    return;
                }

                var parts = args[0].Split(':');
                var runner = new TaskRunner(finder);

                if(parts.Length == 2 && args.Length == 1)
                {
                    runner.Run(parts[0],parts[1]);
                }
                else if(parts.Length ==2 && args.Length > 1)
                {
                    //TODO: Tidy this up and refactor
                    var dest = new string[args.Length-1];
                    Array.Copy(args,1,dest,0,args.Length-1);
                    runner.Run(parts[0],parts[1],dest);
                }
                else
                {
                    Console.WriteLine("Type golem -? for help, or try one of the following tasks:\n");
                    ShowList(found);
                }
            }
            else
            {

                ShowList(found);
            }
        }
 public void Can_Execute_Tasks_With_Parameters()
 {
     var runner = new TaskRunner(cataloger);
     var demo5 = found[4];
     Assert.AreEqual("demo5", found[4].Name);
     Assert.AreEqual("foo", found[4].Tasks[0].Name);
     runner.Run(demo5,demo5.Tasks[0],"TESTING","123");
 }
示例#3
0
 public void Can_Run_Task_By_Name()
 {
     var runner = new TaskRunner(cataloger);
     Locations.StartDirs = new[] {Environment.CurrentDirectory + "..\\..\\..\\..\\"};
     runner.Run("demo","list");
     Assert.AreEqual("LIST", AppDomain.CurrentDomain.GetData("TEST"));
 }
示例#4
0
 public void Can_Run_Task()
 {
     var recipeInfo = found[1];
     var runner = new TaskRunner(cataloger);
     runner.Run(recipeInfo, recipeInfo.Tasks[0]);
     Assert.AreEqual("TEST", AppDomain.CurrentDomain.GetData("TEST"));
 }
示例#5
0
 public void Can_Infer_Recipe_Category_And_Task_Name()
 {
     var runner = new TaskRunner(cataloger);
     runner.Run("demo3", "hello");
 }
示例#6
0
 public void Recipes_Inheriting_RecipeBase_Have_Contextual_Information()
 {
     var demo4 = found[3];
     var runner = new TaskRunner(cataloger);
     runner.Run(demo4,demo4.Tasks[0]);
 }
示例#7
0
 public void Functions_Are_Called_In_Correct_Order_With_Dependencies()
 {
     var runner = new TaskRunner(cataloger);
     runner.Run("demo2", "one");
 }
 public void Can_Execute_Tasks_With_Parameters_By_Name()
 {
     var runner = new TaskRunner(cataloger);
         runner.Run("demo5", "foo", "TESTING", "123");
 }