Skip to content

Commit afb7ffc

Browse files
authored
Avoid intermediate FullNugetVersion file (#47542)
1 parent ff6d135 commit afb7ffc

File tree

4 files changed

+24
-13
lines changed

4 files changed

+24
-13
lines changed

eng/Publishing.props

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,30 @@
1919
<ItemGroup Condition="'$(EnableDefaultArtifacts)' == 'true'">
2020
<Artifact Include="$(NuGetPackageRoot)\microsoft.fsharp.compiler\$(MicrosoftFSharpCompilerPackageVersion)\contentFiles\$(FSharpCorePath)\FSharp.Core.*.nupkg;
2121
$(NuGetPackageRoot)\microsoft.fsharp.compiler\$(MicrosoftFSharpCompilerPackageVersion)\contentFiles\$(FSharpCorePath)\FSharp.Compiler.Service.*.nupkg"
22-
PublishFlatContainer="false" />
22+
Kind="Package" />
2323
</ItemGroup>
2424

2525
<!-- The PGO sdk should always have External visibility, even if someone changes the default artifact visibility -->
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/Installer/redist-installer/redist-installer.proj"
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.Kind)' == 'Blob' and '%(Artifact.RelativeBlobPath)' == ''"
44+
RelativeBlobPath="Sdk/$(NonStableProductVersion)/%(Filename)%(Extension)" />
45+
</ItemGroup>
46+
</Target>
47+
2948
</Project>

eng/Signing.props

Lines changed: 2 additions & 4 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

@@ -85,7 +84,7 @@
8584
<Artifact Include="$(ArtifactsPackagesDir)**\VS.Tools.*.nupkg;
8685
$(ArtifactsPackagesDir)**\VS.Redist.*.nupkg"
8786
IsShipping="$([System.String]::Copy('%(RecursiveDir)').StartsWith('Shipping'))"
88-
PublishFlatContainer="false" />
87+
Kind="Package" />
8988
</ItemGroup>
9089

9190
<!-- Only publish this file from win-x64 so that we don't end up with duplicates. -->
@@ -115,8 +114,7 @@
115114
</ItemGroup>
116115

117116
<ItemGroup>
118-
<Artifact Include="@(SdkArtifact)"
119-
RelativeBlobPath="$(RelativeBlobPathParent)/%(Filename)%(Extension)">
117+
<Artifact Include="@(SdkArtifact)" Kind="Blob">
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/Installer/redist-installer/redist-installer.proj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@
2020
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" />
2121
</ItemGroup>
2222

23+
<Target Name="ReturnProductVersion" Returns="$(FullNugetVersion)" />
24+
2325
</Project>

0 commit comments

Comments
 (0)