Golem.Core.TaskRunner.Run C# (CSharp) Method

Run() public method

public Run ( Recipe recipe, Task task ) : void
recipe Recipe
task Task
return void
        public void Run(Recipe recipe, Task task, params object[] parameters )
        {
            //TODO: Tasks should run in their own appdomain?
            //      We need to create an app domain that has the
            //      base dir the same as the target assembly

            var recipeInstance = Activator.CreateInstance(recipe.Class);
            SetContextualInformationIfInheritsRecipeBase(recipeInstance);
            task.Method.Invoke(recipeInstance, parameters);
        }

Same methods

TaskRunner::Run ( string recipeName, string taskName ) : void

Usage Example

Esempio n. 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);
            }
        }
All Usage Examples Of Golem.Core.TaskRunner::Run