Project Json mapping migration support

This commit is contained in:
Bryan Thornbury 2016-09-08 14:40:46 -07:00
parent 3a567e5957
commit 362f71a94a
17 changed files with 910 additions and 201 deletions

View file

@ -18,13 +18,11 @@ namespace Microsoft.DotNet.ProjectJsonMigration
public class ProjectMigrator
{
// TODO: Migrate PackOptions
// TODO: Support Mappings in IncludeContext Transformations
// TODO: Migrate Multi-TFM projects
// TODO: Tests
// TODO: Out of Scope
// - Globs that resolve to directories: /some/path/**/somedir
// - Migrating Deprecated project.jsons
// - Configuration dependent source exclusion
private readonly IMigrationRule _ruleSet;
@ -85,7 +83,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration
if (diagnostics.Any())
{
MigrationErrorCodes.MIGRATE1011(
$"{projectDirectory}{Environment.NewLine}{string.Join(Environment.NewLine, diagnostics.Select(d => d.Message))}")
$"{projectDirectory}{Environment.NewLine}{string.Join(Environment.NewLine, diagnostics.Select(d => FormatDiagnosticMessage(d)))}")
.Throw();
}
@ -99,6 +97,11 @@ namespace Microsoft.DotNet.ProjectJsonMigration
}
}
private string FormatDiagnosticMessage(DiagnosticMessage d)
{
return $"{d.Message} (line: {d.StartLine}, file: {d.SourceFilePath})";
}
private void SetupOutputDirectory(string projectDirectory, string outputDirectory)
{
if (!Directory.Exists(outputDirectory))