Skip to content

Commit 9e2a480

Browse files
authored
[release/3.1] Add .version file to shared framework zip (#21548)
* Add .version file to shared framework zip * Fix test
1 parent f0e8ccf commit 9e2a480

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/Framework/src/Microsoft.AspNetCore.App.Runtime.csproj

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ This package is an internal implementation of the .NET Core SDK and is not meant
6767
<!-- There is no way to suppress the .dev.runtimeconfig.json generation. -->
6868
<ProjectRuntimeConfigDevFilePath>$(IntermediateOutputPath)ignoreme.dev.runtimeconfig.json</ProjectRuntimeConfigDevFilePath>
6969

70-
<VersionFileIntermediateOutputPath>$(IntermediateOutputPath)$(SharedFxName).versions.txt</VersionFileIntermediateOutputPath>
70+
<VersionTxtFileIntermediateOutputPath>$(IntermediateOutputPath)$(SharedFxName).versions.txt</VersionTxtFileIntermediateOutputPath>
71+
<DotVersionFileIntermediateOutputPath>$(IntermediateOutputPath).version</DotVersionFileIntermediateOutputPath>
7172

7273
<!-- The project representing the shared framework doesn't produce a .NET assembly or symbols. -->
7374
<DebugType>none</DebugType>
@@ -256,7 +257,12 @@ This package is an internal implementation of the .NET Core SDK and is not meant
256257
</ItemGroup>
257258

258259
<WriteLinesToFile
259-
File="$(VersionFileIntermediateOutputPath)"
260+
File="$(VersionTxtFileIntermediateOutputPath)"
261+
Lines="@(VersionLines)"
262+
Overwrite="true" />
263+
264+
<WriteLinesToFile
265+
File="$(DotVersionFileIntermediateOutputPath)"
260266
Lines="@(VersionLines)"
261267
Overwrite="true" />
262268
</Target>
@@ -397,7 +403,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
397403

398404
<Target Name="_ResolveSharedFrameworkContent" DependsOnTargets="ResolveReferences;Crossgen">
399405
<ItemGroup>
400-
<SharedFxContent Include="$(VersionFileIntermediateOutputPath)" />
406+
<SharedFxContent Include="$(DotVersionFileIntermediateOutputPath)" />
401407
<SharedFxContent Include="$(ProjectDepsFilePath)" />
402408
<SharedFxContent Include="$(ProjectRuntimeConfigFilePath)" />
403409
<SharedFxContent Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)' != '.pdb'" />
@@ -496,7 +502,7 @@ This package is an internal implementation of the .NET Core SDK and is not meant
496502
BeforeTargets="_GetPackageFiles">
497503

498504
<ItemGroup>
499-
<None Include="$(VersionFileIntermediateOutputPath)" Pack="true" PackagePath="." />
505+
<None Include="$(VersionTxtFileIntermediateOutputPath)" Pack="true" PackagePath="." />
500506
</ItemGroup>
501507
</Target>
502508

src/Framework/test/SharedFxTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void ItContainsValidDepsJson()
131131
[Fact]
132132
public void ItContainsVersionFile()
133133
{
134-
var versionFile = Path.Combine(_sharedFxRoot, "Microsoft.AspNetCore.App.versions.txt");
134+
var versionFile = Path.Combine(_sharedFxRoot, ".version");
135135
AssertEx.FileExists(versionFile);
136136
var lines = File.ReadAllLines(versionFile);
137137
Assert.Equal(2, lines.Length);

0 commit comments

Comments
 (0)