Pinning the SDK version for migrated apps.
This commit is contained in:
parent
29b197534c
commit
4173d19b3c
7 changed files with 23 additions and 12 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-20160929-1</Version>
|
<Version>1.0.0-alpha-20160929-2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
|
||||||
// TODO: https://github.com/dotnet/sdk/issues/67
|
// TODO: https://github.com/dotnet/sdk/issues/67
|
||||||
private AddPropertyTransform<CommonCompilerOptions> XmlDocTransformFilePath =>
|
private AddPropertyTransform<CommonCompilerOptions> XmlDocTransformFilePath =>
|
||||||
new AddPropertyTransform<CommonCompilerOptions>("DocumentationFile",
|
new AddPropertyTransform<CommonCompilerOptions>("DocumentationFile",
|
||||||
@"$(OutputPath)\$(AssemblyName).xml",
|
@"$(OutputPath)\$(TargetFramework)\$(AssemblyName).xml",
|
||||||
compilerOptions => compilerOptions.GenerateXmlDocumentation != null && compilerOptions.GenerateXmlDocumentation.Value);
|
compilerOptions => compilerOptions.GenerateXmlDocumentation != null && compilerOptions.GenerateXmlDocumentation.Value);
|
||||||
|
|
||||||
private AddPropertyTransform<CommonCompilerOptions> OutputNameTransform =>
|
private AddPropertyTransform<CommonCompilerOptions> OutputNameTransform =>
|
||||||
|
|
|
@ -66,6 +66,8 @@ namespace Microsoft.DotNet.TestFramework
|
||||||
foreach (string lockFile in Directory.GetFiles(_testAssetRoot, "project.lock.json", SearchOption.AllDirectories))
|
foreach (string lockFile in Directory.GetFiles(_testAssetRoot, "project.lock.json", SearchOption.AllDirectories))
|
||||||
{
|
{
|
||||||
string destinationLockFile = lockFile.Replace(_testAssetRoot, Path);
|
string destinationLockFile = lockFile.Replace(_testAssetRoot, Path);
|
||||||
|
Directory.CreateDirectory(System.IO.Path.GetDirectoryName(destinationLockFile));
|
||||||
|
|
||||||
File.Copy(lockFile, destinationLockFile, true);
|
File.Copy(lockFile, destinationLockFile, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,11 +8,14 @@ namespace Microsoft.DotNet.Tools.Migrate
|
||||||
{
|
{
|
||||||
public static string GetSdkVersion(this ProjectRootElement projectRootElement)
|
public static string GetSdkVersion(this ProjectRootElement projectRootElement)
|
||||||
{
|
{
|
||||||
return projectRootElement
|
//TODO: Temporarily pinning the SDK version for Migration. Once we have packageref migration we can remove this.
|
||||||
.Items
|
return "1.0.0-alpha-20160929-1";
|
||||||
.Where(i => i.ItemType == "PackageReference")
|
|
||||||
.First(i => i.Include == ConstantPackageNames.CSdkPackageName)
|
// return projectRootElement
|
||||||
.GetMetadataWithName("version").Value;
|
// .Items
|
||||||
|
// .Where(i => i.ItemType == "PackageReference")
|
||||||
|
// .First(i => i.Include == ConstantPackageNames.CSdkPackageName)
|
||||||
|
// .GetMetadataWithName("version").Value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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-20160929-1</Version>
|
<Version>1.0.0-alpha-20160929-2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,8 @@
|
||||||
"Microsoft.Net.Compilers.netcore": "2.0.0-beta6-60922-08",
|
"Microsoft.Net.Compilers.netcore": "2.0.0-beta6-60922-08",
|
||||||
"Microsoft.CodeAnalysis.Build.Tasks": "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.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": {
|
"frameworks": {
|
||||||
"netcoreapp1.0": {
|
"netcoreapp1.0": {
|
||||||
|
|
|
@ -29,6 +29,9 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
public void It_migrates_apps(string projectName)
|
public void It_migrates_apps(string projectName)
|
||||||
{
|
{
|
||||||
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName, callingMethod: "i").WithLockFiles().Path;
|
var projectDirectory = TestAssetsManager.CreateTestInstance(projectName, callingMethod: "i").WithLockFiles().Path;
|
||||||
|
|
||||||
|
CleanBinObj(projectDirectory);
|
||||||
|
|
||||||
var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName);
|
var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName);
|
||||||
|
|
||||||
var outputsIdentical =
|
var outputsIdentical =
|
||||||
|
@ -100,7 +103,7 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
{
|
{
|
||||||
var projectDirectory =
|
var projectDirectory =
|
||||||
TestAssetsManager.CreateTestInstance(projectName, callingMethod: "i").WithLockFiles().Path;
|
TestAssetsManager.CreateTestInstance(projectName, callingMethod: "i").WithLockFiles().Path;
|
||||||
var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, projectName);
|
var outputComparisonData = BuildProjectJsonMigrateBuildMSBuild(projectDirectory, Path.GetFileNameWithoutExtension(projectName));
|
||||||
|
|
||||||
var outputsIdentical =
|
var outputsIdentical =
|
||||||
outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs);
|
outputComparisonData.ProjectJsonBuildOutputs.SetEquals(outputComparisonData.MSBuildBuildOutputs);
|
||||||
|
@ -260,7 +263,10 @@ namespace Microsoft.DotNet.Migration.Tests
|
||||||
|
|
||||||
foreach (var dir in dirs)
|
foreach (var dir in dirs)
|
||||||
{
|
{
|
||||||
Directory.Delete(dir, true);
|
if(Directory.Exists(dir))
|
||||||
|
{
|
||||||
|
Directory.Delete(dir, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue