Addressing code review comments.
This commit is contained in:
parent
47eafb9ef4
commit
a4dcff9ea8
5 changed files with 19 additions and 17 deletions
|
@ -28,6 +28,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsMultiTFM => ProjectContexts.Count() > 1;
|
||||
|
||||
public MigrationRuleInputs(
|
||||
IEnumerable<ProjectContext> projectContexts,
|
||||
ProjectRootElement outputMSBuildProject,
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
|||
MigrateImports(
|
||||
migrationRuleInputs.CommonPropertyGroup,
|
||||
targetFramework,
|
||||
migrationRuleInputs.ProjectContexts.Count() > 1);
|
||||
migrationRuleInputs.IsMultiTFM);
|
||||
|
||||
MigrateDependencies(
|
||||
project,
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
|||
csproj,
|
||||
scriptSet.Value,
|
||||
scriptSet.Key,
|
||||
migrationRuleInputs.ProjectContexts.Count() > 1);
|
||||
migrationRuleInputs.IsMultiTFM);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,20 +34,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
|||
CleanExistingProperties(csproj);
|
||||
CleanExistingPackageReferences(csproj);
|
||||
|
||||
if(migrationRuleInputs.ProjectContexts.Count() == 1)
|
||||
{
|
||||
_transformApplicator.Execute(
|
||||
FrameworkTransform.Transform(
|
||||
migrationRuleInputs.ProjectContexts.Single().TargetFramework),
|
||||
propertyGroup,
|
||||
mergeExisting: true);
|
||||
_transformApplicator.Execute(
|
||||
FrameworkRuntimeIdentifiersTransform.Transform(
|
||||
migrationRuleInputs.ProjectContexts.Single()),
|
||||
propertyGroup,
|
||||
mergeExisting: true);
|
||||
}
|
||||
else
|
||||
if(migrationRuleInputs.IsMultiTFM)
|
||||
{
|
||||
_transformApplicator.Execute(
|
||||
FrameworksTransform.Transform(
|
||||
|
@ -65,6 +52,19 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
|||
propertyGroup,
|
||||
mergeExisting: true);
|
||||
}
|
||||
else
|
||||
{
|
||||
_transformApplicator.Execute(
|
||||
FrameworkTransform.Transform(
|
||||
migrationRuleInputs.ProjectContexts.Single().TargetFramework),
|
||||
propertyGroup,
|
||||
mergeExisting: true);
|
||||
_transformApplicator.Execute(
|
||||
FrameworkRuntimeIdentifiersTransform.Transform(
|
||||
migrationRuleInputs.ProjectContexts.Single()),
|
||||
propertyGroup,
|
||||
mergeExisting: true);
|
||||
}
|
||||
}
|
||||
|
||||
private void CleanExistingProperties(ProjectRootElement csproj)
|
||||
|
|
|
@ -201,7 +201,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
|
|||
}
|
||||
|
||||
[Fact]
|
||||
public void ItDoesNotConditionToPackageTargetFallBackWhenMigratingASingleTFM()
|
||||
public void ItDoesNotAddConditionToPackageTargetFallBackWhenMigratingASingleTFM()
|
||||
{
|
||||
var importPropertyName = "PackageTargetFallback";
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue