20 lines
793 B
C#
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);
|
|
}
|
|
}
|
|
}
|