Print dependency diagnostics

- Downgrade lock file validation changes to warning instead of an error
- Don't show dependency information. Once we get log levels it'll be verbose.
The response file can be used to debug things.
This commit is contained in:
David Fowler 2015-10-17 03:49:49 -07:00
parent 55ef859423
commit 357242f7b6
2 changed files with 19 additions and 2 deletions

View file

@ -73,6 +73,21 @@ namespace Microsoft.DotNet.Tools.Compiler
// Create the library exporter
var exporter = context.CreateExporter(configuration);
bool success = true;
// Print out dependency diagnostics
foreach (var diag in context.LibraryManager.GetAllDiagnostics())
{
success &= diag.Severity != DiagnosticMessageSeverity.Error;
Console.WriteLine(diag.FormattedMessage);
}
// If there were dependency errors don't bother compiling
if (!success)
{
return false;
}
// Gather exports for the project
var dependencies = exporter.GetCompilationDependencies().ToList();
@ -96,7 +111,9 @@ namespace Microsoft.DotNet.Tools.Compiler
}
// Dump dependency data
ShowDependencyInfo(dependencies);
// TODO: Turn on only if verbose, we can look at the response
// file anyways
// ShowDependencyInfo(dependencies);
// Hackily generate the output path
if (string.IsNullOrEmpty(outputPath))

View file

@ -121,7 +121,7 @@ namespace Microsoft.Extensions.ProjectModel
ErrorCodes.NU1006,
$"{lockFileValidationMessage}. Please run \"dnu restore\" to generate a new lock file.",
Path.Combine(Project.ProjectDirectory, LockFile.FileName),
DiagnosticMessageSeverity.Error));
DiagnosticMessageSeverity.Warning));
}
}