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>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NETCore.Sdk">
|
||||
<Version>1.0.0-alpha-20160927-2</Version>
|
||||
<Version>1.0.0-alpha-20160929-1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration
|
|||
new MigrateConfigurationsRule(),
|
||||
new MigrateScriptsRule(),
|
||||
new TemporaryMutateProjectJsonRule(),
|
||||
new WorkaroundOptionsRule(),
|
||||
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>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.NETCore.Sdk">
|
||||
<Version>1.0.0-alpha-20160927-2</Version>
|
||||
<Version>1.0.0-alpha-20160929-1</Version>
|
||||
</PackageReference>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
|||
File.Delete(Path.Combine(projectDirectory, "project.lock.json"));
|
||||
|
||||
MigrateProject(projectDirectory);
|
||||
Restore3(projectDirectory, projectName);
|
||||
Restore(projectDirectory);
|
||||
BuildMSBuild(projectDirectory, projectName);
|
||||
|
||||
var msbuildBuildOutputs = new HashSet<string>(CollectBuildOutputs(projectDirectory));
|
||||
|
|
Loading…
Reference in a new issue