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"); }
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")); }
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")); }
public void Can_Infer_Recipe_Category_And_Task_Name() { var runner = new TaskRunner(cataloger); runner.Run("demo3", "hello"); }
public void Recipes_Inheriting_RecipeBase_Have_Contextual_Information() { var demo4 = found[3]; var runner = new TaskRunner(cataloger); runner.Run(demo4,demo4.Tasks[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"); }