public async Task Run(CollectionConfiguration config) { bool rootExists = Directory.Exists(config.RootDirectory); if (!rootExists) { throw new ArgumentException($"Could not locate directory: {config.RootDirectory}"); } if (!Directory.Exists(this.GetPerProjectOutputPath())) { Directory.CreateDirectory(this.GetPerProjectOutputPath()); } this.ClearExistingOutputFiles(); List <Task> metricsCollectionTasks = new List <Task>(); this.Traverse(new DirectoryInfo(config.RootDirectory), config, metricsCollectionTasks); await Task.WhenAll(metricsCollectionTasks); this.statusUpdater("Completed reading all projects."); var metrics = await MetricsCompiler.CompileFromDirectory(this.GetPerProjectOutputPath()); var resultsPath = this.GetResultsPath(); CompletedMetricsHandler.WriteMetrics(metrics, resultsPath); this.statusUpdater($"Wrote results to {resultsPath}."); }
private void HandleCollectedMetrics(IEnumerable <MetricsRow> metrics) { CompletedMetricsHandler.WriteMetrics(metrics, this.GetPerProjectOutputPath()); }