SelectFinalInvocation() private method

private SelectFinalInvocation ( CompilerInvocation invocation ) : void
invocation CompilerInvocation
return void
Example #1
0
        public static IEnumerable <CompilerInvocation> GetInvocations(Options options = null, IEnumerable <string> logFiles = null)
        {
            var analyzer          = new LogAnalyzer();
            var invocationBuckets = new Dictionary <string, IEnumerable <CompilerInvocation> >(StringComparer.OrdinalIgnoreCase);

            using (Disposable.Timing("Analyzing log files"))
            {
#if true
                Parallel.ForEach(logFiles, logFile =>
                {
                    var set = analyzer.AnalyzeLogFile(logFile);
                    lock (invocationBuckets)
                    {
                        invocationBuckets.Add(Path.GetFileNameWithoutExtension(logFile), set);
                    }
                });
#else
                foreach (var logFile in logFiles)
                {
                    var set = analyzer.AnalyzeLogFile(logFile);
                    lock (invocationBuckets)
                    {
                        invocationBuckets.Add(Path.GetFileNameWithoutExtension(logFile), set);
                    }
                }
#endif
            }

            var buckets = invocationBuckets.OrderBy(kvp => kvp.Key).ToArray();
            foreach (var bucket in buckets)
            {
                foreach (var invocation in bucket.Value)
                {
                    analyzer.SelectFinalInvocation(invocation);
                }
            }

            FixOutputPaths(analyzer);

            if (options != null && options.SanityCheck)
            {
                using (Disposable.Timing("Sanity check"))
                {
                    SanityCheck(analyzer, options);
                }
            }

            return(analyzer.Invocations);
        }
Example #2
0
        public static IEnumerable<CompilerInvocation> GetInvocations(Options options = null, IEnumerable<string> logFiles = null)
        {
            var analyzer = new LogAnalyzer();
            var invocationBuckets = new Dictionary<string, IEnumerable<CompilerInvocation>>(StringComparer.OrdinalIgnoreCase);
            using (Disposable.Timing("Analyzing log files"))
            {
            #if true
                Parallel.ForEach(logFiles, logFile =>
                {
                    var set = analyzer.AnalyzeLogFile(logFile);
                    lock (invocationBuckets)
                    {
                        invocationBuckets.Add(Path.GetFileNameWithoutExtension(logFile), set);
                    }
                });
            #else
                foreach (var logFile in logFiles)
                {
                    var set = analyzer.AnalyzeLogFile(logFile);
                    lock (invocationBuckets)
                    {
                        invocationBuckets.Add(Path.GetFileNameWithoutExtension(logFile), set);
                    }
                }
            #endif
            }

            var buckets = invocationBuckets.OrderBy(kvp => kvp.Key).ToArray();
            foreach (var bucket in buckets)
            {
                foreach (var invocation in bucket.Value)
                {
                    analyzer.SelectFinalInvocation(invocation);
                }
            }

            FixOutputPaths(analyzer);

            if (options != null && options.SanityCheck)
            {
                using (Disposable.Timing("Sanity check"))
                {
                    SanityCheck(analyzer, options);
                }
            }

            return analyzer.Invocations;
        }