remove proejct.migrated.json

This commit is contained in:
Bryan Thornbury 2016-10-04 16:40:20 -07:00
parent 49637d0fe9
commit 3149af8941
2 changed files with 0 additions and 33 deletions

View file

@ -19,7 +19,6 @@ namespace Microsoft.DotNet.ProjectJsonMigration
new MigratePackageDependenciesRule(),
new MigrateConfigurationsRule(),
new MigrateScriptsRule(),
new TemporaryMutateProjectJsonRule(),
new WorkaroundOptionsRule(),
new SaveOutputProjectRule()
};

View file

@ -1,32 +0,0 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.IO;
using System.Linq;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
/// <summary>
/// This rule is temporary while project.json still exists in the new project system.
/// It renames your existing project.json (if output directory is the current project directory),
/// creates a copy, then mutates that copy.
///
/// Mutations:
/// - inject a dependency on the Microsoft.SDK targets
/// - removing the "runtimes" node.
/// </summary>
public class TemporaryMutateProjectJsonRule : IMigrationRule
{
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
var sourceProjectFile = Path.Combine(migrationSettings.ProjectDirectory, "project.json");
var renamedProjectFile = Path.Combine(migrationSettings.ProjectDirectory, "project.migrated.json");
File.Copy(sourceProjectFile, renamedProjectFile);
sourceProjectFile = renamedProjectFile;
}
}
}