Beispiel #1
0
        /// <summary>
        /// This method is called automatically when the task is run.
        /// </summary>
        /// <returns>Boolean to indicate if the task was sucessful.</returns>
        public override bool Execute()
        {
            // Override assembly resolve (cf comments in CurrentDomain_AssemblyResolve)
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            try
            {
                var args           = ParseArguments(Arguments);
                var processor      = new AssemblyProcessorProgram();
                var redirectLogger = new RedirectLogger(Log);
                var result         = processor.Run(args.ToArray(), redirectLogger);

                if (result != 0)
                {
                    Log.LogError($"Failed to run assembly processor with parameters: {Arguments}");
                    Log.LogError("Check the previous logs");
                }

                return(result == 0);
            }
            finally
            {
                AppDomain.CurrentDomain.AssemblyResolve -= CurrentDomain_AssemblyResolve;
            }
        }
Beispiel #2
0
        public static int Main(string[] args)
        {
            var program = new AssemblyProcessorProgram();

            return(program.Run(args));
        }