Updating to a new SDK and adding a work around to set project.lock.json for migrated projects.

This commit is contained in:
Livar Cunha 2016-09-28 19:34:41 -07:00
parent 68e1aae6cc
commit 29b197534c
5 changed files with 33 additions and 3 deletions

View file

@ -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>

View file

@ -19,6 +19,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration
new MigrateConfigurationsRule(),
new MigrateScriptsRule(),
new TemporaryMutateProjectJsonRule(),
new WorkaroundOptionsRule(),
new SaveOutputProjectRule()
};

View file

@ -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);
}
}
}

View file

@ -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>

View file

@ -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));