private void SanitizeInput()
        {
            AssemblyPaths = AssemblyPaths.Select(p => p
                                                 .Replace('\\', Path.DirectorySeparatorChar)
                                                 .Replace('/', Path.DirectorySeparatorChar))
                            .Distinct()
                            .ToArray();

            AssemblyNames = AssemblyNames
                            .Where(n => !string.IsNullOrWhiteSpace(n))
                            .Distinct()
                            .ToArray();
        }
Ejemplo n.º 2
0
        private string[] GenerateCommandLineCommands()
        {
            var args = new List <string>();

            if (RootDescriptorFiles != null)
            {
                foreach (var rootFile in RootDescriptorFiles)
                {
                    args.Add("-x");
                    args.Add(rootFile.ItemSpec);
                }
            }

            foreach (var assemblyItem in RootAssemblyNames)
            {
                args.Add("-a");
                args.Add(assemblyItem.ItemSpec);
            }

            var assemblyDirs = AssemblyPaths.Select(p => Path.GetDirectoryName(p.ItemSpec))
                               .GroupBy(d => d).Select(ds => ds.First());

            foreach (var dir in assemblyDirs)
            {
                args.Add("-d");
                args.Add(dir);
            }

            if (OutputDirectory != null)
            {
                args.Add("-out");
                args.Add(OutputDirectory.ItemSpec);
            }

            if (ExtraArgs != null)
            {
                args.AddRange(ExtraArgs.Split(' '));
            }

            if (DumpDependencies)
            {
                args.Add("--dump-dependencies");
            }

            return(args.ToArray());
        }
Ejemplo n.º 3
0
        private static void Main(string[] args)
        {
            InitializeOptions(args);

            if (Debug)
            {
                Debugger.Launch();
            }

            var assemblies = AssemblyPaths.Select(Assembly.LoadFrom);
            var listeners  = CreateListener().ToArray();
            var result     = Evaluator.Run(assemblies, listeners);

            if (Pause)
            {
                System.Console.WriteLine("Press <enter> to terminate...");
                System.Console.Read();
            }

            var exitCode = -1 * (int)result.State;

            Environment.Exit(exitCode);
        }