Pinning the SDK version for migrated apps.

This commit is contained in:
Livar Cunha 2016-09-29 13:05:27 -07:00
parent 29b197534c
commit 4173d19b3c
7 changed files with 23 additions and 12 deletions

View file

@ -16,7 +16,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.Sdk">
<Version>1.0.0-alpha-20160929-1</Version>
<Version>1.0.0-alpha-20160929-2</Version>
</PackageReference>
</ItemGroup>

View file

@ -97,7 +97,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
// TODO: https://github.com/dotnet/sdk/issues/67
private AddPropertyTransform<CommonCompilerOptions> XmlDocTransformFilePath =>
new AddPropertyTransform<CommonCompilerOptions>("DocumentationFile",
@"$(OutputPath)\$(AssemblyName).xml",
@"$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml",
compilerOptions => compilerOptions.GenerateXmlDocumentation != null && compilerOptions.GenerateXmlDocumentation.Value);
private AddPropertyTransform<CommonCompilerOptions> OutputNameTransform =>

View file

@ -66,6 +66,8 @@ namespace Microsoft.DotNet.TestFramework
foreach (string lockFile in Directory.GetFiles(_testAssetRoot, "project.lock.json", SearchOption.AllDirectories))
{
string destinationLockFile = lockFile.Replace(_testAssetRoot, Path);
Directory.CreateDirectory(System.IO.Path.GetDirectoryName(destinationLockFile));
File.Copy(lockFile, destinationLockFile, true);
}

View file

@ -8,11 +8,14 @@ namespace Microsoft.DotNet.Tools.Migrate
{
public static string GetSdkVersion(this ProjectRootElement projectRootElement)
{
return projectRootElement
.Items
.Where(i => i.ItemType == "PackageReference")
.First(i => i.Include == ConstantPackageNames.CSdkPackageName)
.GetMetadataWithName("version").Value;
//TODO: Temporarily pinning the SDK version for Migration. Once we have packageref migration we can remove this.
return "1.0.0-alpha-20160929-1";
// return projectRootElement
// .Items
// .Where(i => i.ItemType == "PackageReference")
// .First(i => i.Include == ConstantPackageNames.CSdkPackageName)
// .GetMetadataWithName("version").Value;
}
}
}

View file

@ -16,7 +16,7 @@
<Version>1.0.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.NETCore.Sdk">
<Version>1.0.0-alpha-20160929-1</Version>
<Version>1.0.0-alpha-20160929-2</Version>
</PackageReference>
</ItemGroup>

View file

@ -13,8 +13,8 @@
"Microsoft.Net.Compilers.netcore": "2.0.0-beta6-60922-08",
"Microsoft.CodeAnalysis.Build.Tasks": "2.0.0-beta6-60922-08",
"Microsoft.Cci": "4.0.0-rc3-24128-00",
"Microsoft.Composition": "1.0.30",
"Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000004"
"Microsoft.NuGet.Build.Tasks": "1.0.0-alpha-000004",
"Microsoft.Composition": "1.0.30"
},
"frameworks": {
"netcoreapp1.0": {

View file

@ -29,6 +29,9 @@ namespace Microsoft.DotNet.Migration.Tests
public void It_migrates_apps(string projectName)
{
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName, callingMethod: "i").WithLockFiles().Path;
CleanBinObj(projectDirectory);
var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName);
var outputsIdentical =
@ -100,7 +103,7 @@ namespace Microsoft.DotNet.Migration.Tests
{
var projectDirectory =
TestAssetsManager.CreateTestInstance(projectName, callingMethod: "i").WithLockFiles().Path;
var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName);
var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, Path.GetFileNameWithoutExtension(projectName));
var outputsIdentical =
outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs);
@ -260,7 +263,10 @@ namespace Microsoft.DotNet.Migration.Tests
foreach (var dir in dirs)
{
Directory.Delete(dir, true);
if(Directory.Exists(dir))
{
Directory.Delete(dir, true);
}
}
}