|
4 | 4 | </PropertyGroup>
|
5 | 5 |
|
6 | 6 | <PropertyGroup>
|
7 |
| - <PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksums</PublishDependsOnTargets> |
| 7 | + <PublishDependsOnTargets>$(PublishDependsOnTargets);_PublishInstallersAndChecksumsAndProductVersion</PublishDependsOnTargets> |
8 | 8 |
|
9 | 9 | <_UploadPathRoot>aspnetcore</_UploadPathRoot>
|
| 10 | + <ProductVersionFileName>productVersion.txt</ProductVersionFileName> |
| 11 | + <ProductVersionFileLocation>$(ArtifactsShippingPackagesDir)$(ProductVersionFileName)</ProductVersionFileLocation> |
10 | 12 | </PropertyGroup>
|
11 | 13 |
|
12 | 14 | <!-- $(InstallersOutputPath), $(SymbolsOutputPath), and $(ChecksumExtensions) are not defined. Root Directory.Build.props is not imported. -->
|
|
31 | 33 | <_ChecksumsToPublish Include="$(ArtifactsDir)**\*.sha512" />
|
32 | 34 | </ItemGroup>
|
33 | 35 |
|
34 |
| - <Target Name="_PublishInstallersAndChecksums"> |
| 36 | + <Target |
| 37 | + Name="_PublishInstallersAndChecksumsAndProductVersion" |
| 38 | + DependsOnTargets="_WriteProductVersionFile"> |
35 | 39 | <!--
|
36 | 40 | This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#,
|
37 | 41 | and npm project. We use SignalR.Npm.FunctionalTests.npmproj because it is non-shipping (we need a non-stable
|
|
69 | 73 | <PublishFlatContainer>true</PublishFlatContainer>
|
70 | 74 | <RelativeBlobPath>$(_UploadPathRoot)/%(_InstallersToPublish.UploadPathSegment)/$(_PackageVersion)/%(Filename)%(Extension)</RelativeBlobPath>
|
71 | 75 | </ItemsToPushToBlobFeed>
|
| 76 | + |
| 77 | + <ItemsToPushToBlobFeed Include="$(ProductVersionFileLocation)" Condition=" '$(PublishInstallerBaseVersion)' == 'true'"> |
| 78 | + <PublishFlatContainer>true</PublishFlatContainer> |
| 79 | + <RelativeBlobPath>$(_UploadPathRoot)/Runtime/$(_PackageVersion)/$(ProductVersionFileName)</RelativeBlobPath> |
| 80 | + </ItemsToPushToBlobFeed> |
72 | 81 | </ItemGroup>
|
73 | 82 | </Target>
|
| 83 | + |
| 84 | + <Target |
| 85 | + Name="_WriteProductVersionFile" |
| 86 | + Condition=" '$(PublishInstallerBaseVersion)' == 'true'"> |
| 87 | + <!-- |
| 88 | + This target is defined in eng/targets/Packaging.targets and Npm.Common.targets and included in every C#, F#, |
| 89 | + and npm project. We use Microsoft.AspNetCore.App.Runtime.csproj because it is shipping (we need a stable |
| 90 | + version string to use for productVersion.txt). |
| 91 | + --> |
| 92 | + <MSBuild Projects="$(RepoRoot)src\Framework\App.Runtime\src\Microsoft.AspNetCore.App.Runtime.csproj" |
| 93 | + Properties="DisableYarnCheck=true;ExcludeFromBuild=false" |
| 94 | + Targets="_GetPackageVersionInfo" |
| 95 | + SkipNonexistentProjects="false"> |
| 96 | + <Output TaskParameter="TargetOutputs" ItemName="_ResolvedProductVersionInfo" /> |
| 97 | + </MSBuild> |
| 98 | + |
| 99 | + <PropertyGroup> |
| 100 | + <_ProductVersion>@(_ResolvedProductVersionInfo->'%(PackageVersion)')</_ProductVersion> |
| 101 | + </PropertyGroup> |
| 102 | + |
| 103 | + <!-- Generate productVersion.txt containing the value of $(PackageVersion) --> |
| 104 | + <WriteLinesToFile |
| 105 | + File="$(ProductVersionFileLocation)" |
| 106 | + Lines="$(_ProductVersion)" |
| 107 | + Overwrite="true" |
| 108 | + Encoding="ASCII" /> |
| 109 | + </Target> |
74 | 110 | </Project>
|
0 commit comments