From 7c58b8b7677a668a64d88e15a367fcdd39567edc Mon Sep 17 00:00:00 2001 From: William Godbe Date: Tue, 12 May 2020 17:10:02 -0700 Subject: [PATCH] Add .version file to shared framework zip (#21587) * Add .version file to shared framework zip * Fix test * Test for proper version file depending on env --- .../src/Microsoft.AspNetCore.App.Runtime.csproj | 14 ++++++++++---- src/Framework/test/SharedFxTests.cs | 4 +++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj b/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj index 2c5b5cd3e49..adcdc8fbeea 100644 --- a/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj +++ b/src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj @@ -67,7 +67,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant $(IntermediateOutputPath)ignoreme.dev.runtimeconfig.json - $(IntermediateOutputPath)$(SharedFxName).versions.txt + $(IntermediateOutputPath)$(SharedFxName).versions.txt + $(IntermediateOutputPath).version none @@ -259,7 +260,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant + + @@ -402,7 +408,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant - + @@ -501,7 +507,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant BeforeTargets="_GetPackageFiles"> - + diff --git a/src/Framework/test/SharedFxTests.cs b/src/Framework/test/SharedFxTests.cs index 2b7fae9f295..1d2f4e6d9de 100644 --- a/src/Framework/test/SharedFxTests.cs +++ b/src/Framework/test/SharedFxTests.cs @@ -15,6 +15,7 @@ namespace Microsoft.AspNetCore { private readonly string _expectedTfm; private readonly string _expectedRid; + private readonly string _expectedVersionFileName; private readonly string _sharedFxRoot; private readonly ITestOutputHelper _output; @@ -26,6 +27,7 @@ namespace Microsoft.AspNetCore _sharedFxRoot = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ASPNET_RUNTIME_PATH")) ? Path.Combine(TestData.GetTestDataValue("SharedFrameworkLayoutRoot"), "shared", TestData.GetTestDataValue("RuntimePackageVersion")) : Environment.GetEnvironmentVariable("ASPNET_RUNTIME_PATH"); + _expectedVersionFileName = string.IsNullOrEmpty(Environment.GetEnvironmentVariable("ASPNET_RUNTIME_PATH")) ? ".version" : "Microsoft.AspNetCore.App.versions.txt"; } [Fact] @@ -133,7 +135,7 @@ namespace Microsoft.AspNetCore [Fact] public void ItContainsVersionFile() { - var versionFile = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.versions.txt"); + var versionFile = Path.Combine(_sharedFxRoot, _expectedVersionFileName); AssertEx.FileExists(versionFile); var lines = File.ReadAllLines(versionFile); Assert.Equal(2, lines.Length);