dotnet-installer/src/Microsoft.DotNet.ProjectJsonMigration/Rules/SaveOutputProjectRule.cs
Bryan Thornbury b0554d3ff3 PR Feedback
2016-08-30 12:00:56 -07:00

20 lines
793 B
C#

// 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.IO;
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
public class SaveOutputProjectRule : IMigrationRule
{
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
var outputName = Path.GetFileNameWithoutExtension(
migrationRuleInputs.DefaultProjectContext.GetOutputPaths("_").CompilationFiles.Assembly);
var outputProject = Path.Combine(migrationSettings.OutputDirectory, outputName + ".csproj");
migrationRuleInputs.OutputMSBuildProject.Save(outputProject);
}
}
}