Updating to a new SDK and adding a work around to set project.lock.json for migrated projects.
This commit is contained in:
parent
68e1aae6cc
commit
29b197534c
5 changed files with 33 additions and 3 deletions
|
@ -16,7 +16,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NETCore.Sdk">
|
<PackageReference Include="Microsoft.NETCore.Sdk">
|
||||||
<Version>1.0.0-alpha-20160927-2</Version>
|
<Version>1.0.0-alpha-20160929-1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
||||||
new MigrateConfigurationsRule(),
|
new MigrateConfigurationsRule(),
|
||||||
new MigrateScriptsRule(),
|
new MigrateScriptsRule(),
|
||||||
new TemporaryMutateProjectJsonRule(),
|
new TemporaryMutateProjectJsonRule(),
|
||||||
|
new WorkaroundOptionsRule(),
|
||||||
new SaveOutputProjectRule()
|
new SaveOutputProjectRule()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
// 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 Microsoft.DotNet.ProjectJsonMigration.Transforms;
|
||||||
|
|
||||||
|
namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
|
{
|
||||||
|
public class WorkaroundOptionsRule : IMigrationRule
|
||||||
|
{
|
||||||
|
private readonly ITransformApplicator _transformApplicator;
|
||||||
|
|
||||||
|
private AddPropertyTransform<object> ProjectLockFileTransform =>
|
||||||
|
new AddPropertyTransform<object>("ProjectLockFile",
|
||||||
|
frameworks => "$(MSBuildProjectDirectory)/project.lock.json",
|
||||||
|
frameworks => true);
|
||||||
|
|
||||||
|
public WorkaroundOptionsRule(ITransformApplicator transformApplicator = null)
|
||||||
|
{
|
||||||
|
_transformApplicator = transformApplicator ?? new TransformApplicator();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
|
||||||
|
{
|
||||||
|
var propertyGroup = migrationRuleInputs.CommonPropertyGroup;
|
||||||
|
|
||||||
|
_transformApplicator.Execute(ProjectLockFileTransform.Transform(string.Empty), propertyGroup);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,7 +16,7 @@
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="Microsoft.NETCore.Sdk">
|
<PackageReference Include="Microsoft.NETCore.Sdk">
|
||||||
<Version>1.0.0-alpha-20160927-2</Version>
|
<Version>1.0.0-alpha-20160929-1</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -238,7 +238,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
File.Delete(Path.Combine(projectDirectory, "project.lock.json"));
|
File.Delete(Path.Combine(projectDirectory, "project.lock.json"));
|
||||||
|
|
||||||
MigrateProject(projectDirectory);
|
MigrateProject(projectDirectory);
|
||||||
Restore3(projectDirectory, projectName);
|
Restore(projectDirectory);
|
||||||
BuildMSBuild(projectDirectory, projectName);
|
BuildMSBuild(projectDirectory, projectName);
|
||||||
|
|
||||||
var msbuildBuildOutputs = new HashSet<string>(CollectBuildOutputs(projectDirectory));
|
var msbuildBuildOutputs = new HashSet<string>(CollectBuildOutputs(projectDirectory));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue