Skip to content

Commit 9f5b23e

Browse files
committed
Avoid intermediate FullNugetVersion file
Use the same mechanism as in aspnetcore, windowsdesktop and runtime to retrieve the non stable product version in Publishing.props and update the Artifact items with that version.
1 parent ad7e8bd commit 9f5b23e

File tree

4 files changed

+22
-11
lines changed

4 files changed

+22
-11
lines changed

eng/Publishing.props

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,23 @@
2626
<ItemGroup>
2727
<Artifact Update="$(ArtifactsShippingPackagesDir)dotnet-sdk-pgo-*" Visibility="External" />
2828
</ItemGroup>
29+
30+
<Target Name="GetNonStableProductVersion">
31+
<!-- Retrieve the non-stable product version. -->
32+
<MSBuild Projects="$(RepoRoot)src/Layout/redist/redist.csproj"
33+
Targets="ReturnProductVersion">
34+
<Output TaskParameter="TargetOutputs" PropertyName="NonStableProductVersion" />
35+
</MSBuild>
36+
</Target>
37+
38+
<Target Name="AddRelativeBlobPathToBlobArtifacts"
39+
DependsOnTargets="GetNonStableProductVersion"
40+
BeforeTargets="PublishToAzureDevOpsArtifacts"
41+
AfterTargets="GenerateChecksumsFromArtifacts">
42+
<ItemGroup>
43+
<Artifact Condition="'%(Artifact.PublishFlatContainer)' == 'true' and '%(Artifact.RelativeBlobPath)' == ''"
44+
RelativeBlobPath="Sdk/$(NonStableProductVersion)/%(Filename)%(Extension)" />
45+
</ItemGroup>
46+
</Target>
47+
2948
</Project>

eng/Signing.props

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project>
22

33
<PropertyGroup>
4-
<RelativeBlobPathParent>Sdk/$([System.IO.File]::ReadAllText('$(ArtifactsTmpDir)FullNugetVersion.version').Trim())</RelativeBlobPathParent>
54
<PublishBinariesAndBadge Condition="'$(PublishBinariesAndBadge)' == ''">true</PublishBinariesAndBadge>
65
</PropertyGroup>
76

@@ -115,8 +114,7 @@
115114
</ItemGroup>
116115

117116
<ItemGroup>
118-
<Artifact Include="@(SdkArtifact)"
119-
RelativeBlobPath="$(RelativeBlobPathParent)/%(Filename)%(Extension)">
117+
<Artifact Include="@(SdkArtifact)">
120118
<ChecksumPath Condition="$([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.wixpack.zip')) != 'true'">%(FullPath).sha512</ChecksumPath>
121119
</Artifact>
122120
</ItemGroup>

src/Installer/redist-installer/Directory.Build.targets

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,6 @@
2828
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>dotnet-sdk$(PgoTerm)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
2929
</PropertyGroup>
3030

31-
<!-- This is a hack to make the full nuget version available during the publishing step -->
32-
<Target Name="GenerateFullNugetVersionFile"
33-
BeforeTargets="Build">
34-
<WriteLinesToFile File="$(ArtifactsTmpDir)FullNugetVersion.version"
35-
Lines="$(FullNugetVersion)"
36-
Overwrite="true" />
37-
</Target>
38-
3931
<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" />
4032

4133
<Import Project="targets\RestoreLayout.targets" />

src/Layout/redist/redist.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,4 +103,6 @@
103103
</ItemGroup>
104104
</Target>
105105

106+
<Target Name="ReturnProductVersion" Returns="$(FullNugetVersion)" />
107+
106108
</Project>

0 commit comments

Comments
 (0)