Merge in 'release/6.0.3xx' changes
This commit is contained in:
commit
00659dc5a0
2 changed files with 37 additions and 31 deletions
|
@ -1,6 +1,7 @@
|
||||||
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
|
<TargetFramework>$(CoreSdkTargetFramework)</TargetFramework>
|
||||||
|
<DefineConstants Condition="'$(IslinuxPortable)' == 'true'">$(DefineConstants);LINUX_PORTABLE</DefineConstants>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -47,39 +47,44 @@ namespace EndToEnd
|
||||||
|
|
||||||
internal void ItDoesNotRollForwardToTheLatestVersion(string packageName, string minorVersion)
|
internal void ItDoesNotRollForwardToTheLatestVersion(string packageName, string minorVersion)
|
||||||
{
|
{
|
||||||
var testProjectCreator = new TestProjectCreator()
|
// https://github.com/NuGet/Home/issues/8571
|
||||||
{
|
#if LINUX_PORTABLE
|
||||||
PackageName = packageName,
|
|
||||||
MinorVersion = minorVersion,
|
|
||||||
};
|
|
||||||
|
|
||||||
var _testInstance = testProjectCreator.Create();
|
|
||||||
|
|
||||||
string projectDirectory = _testInstance.Root.FullName;
|
|
||||||
|
|
||||||
string projectPath = Path.Combine(projectDirectory, "TestAppSimple.csproj");
|
|
||||||
|
|
||||||
// Get the resolved version of .NET Core
|
|
||||||
new RestoreCommand()
|
|
||||||
.WithWorkingDirectory(projectDirectory)
|
|
||||||
.Execute()
|
|
||||||
.Should().Pass();
|
|
||||||
|
|
||||||
string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
|
|
||||||
var assetsFile = new LockFileFormat().Read(assetsFilePath);
|
|
||||||
|
|
||||||
var versionInAssertsJson = GetPackageVersion(assetsFile, packageName);
|
|
||||||
versionInAssertsJson.Should().NotBeNull();
|
|
||||||
|
|
||||||
if (versionInAssertsJson.IsPrerelease && versionInAssertsJson.Patch == 0)
|
|
||||||
{
|
|
||||||
// if the bundled version is, for example, a prerelease of
|
|
||||||
// .NET Core 2.1.1, that we don't roll forward to that prerelease
|
|
||||||
// version for framework-dependent deployments.
|
|
||||||
return;
|
return;
|
||||||
}
|
#else
|
||||||
|
var testProjectCreator = new TestProjectCreator()
|
||||||
|
{
|
||||||
|
PackageName = packageName,
|
||||||
|
MinorVersion = minorVersion,
|
||||||
|
};
|
||||||
|
|
||||||
versionInAssertsJson.ToNormalizedString().Should().BeEquivalentTo(GetExpectedVersion(packageName, minorVersion));
|
var _testInstance = testProjectCreator.Create();
|
||||||
|
|
||||||
|
string projectDirectory = _testInstance.Root.FullName;
|
||||||
|
|
||||||
|
string projectPath = Path.Combine(projectDirectory, "TestAppSimple.csproj");
|
||||||
|
|
||||||
|
// Get the resolved version of .NET Core
|
||||||
|
new RestoreCommand()
|
||||||
|
.WithWorkingDirectory(projectDirectory)
|
||||||
|
.Execute()
|
||||||
|
.Should().Pass();
|
||||||
|
|
||||||
|
string assetsFilePath = Path.Combine(projectDirectory, "obj", "project.assets.json");
|
||||||
|
var assetsFile = new LockFileFormat().Read(assetsFilePath);
|
||||||
|
|
||||||
|
var versionInAssertsJson = GetPackageVersion(assetsFile, packageName);
|
||||||
|
versionInAssertsJson.Should().NotBeNull();
|
||||||
|
|
||||||
|
if (versionInAssertsJson.IsPrerelease && versionInAssertsJson.Patch == 0)
|
||||||
|
{
|
||||||
|
// if the bundled version is, for example, a prerelease of
|
||||||
|
// .NET Core 2.1.1, that we don't roll forward to that prerelease
|
||||||
|
// version for framework-dependent deployments.
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
versionInAssertsJson.ToNormalizedString().Should().BeEquivalentTo(GetExpectedVersion(packageName, minorVersion));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName)
|
private static NuGetVersion GetPackageVersion(LockFile lockFile, string packageName)
|
||||||
|
|
Loading…
Reference in a new issue