-
Notifications
You must be signed in to change notification settings - Fork 54
/
Publishing.props
59 lines (51 loc) · 2.74 KB
/
Publishing.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<Project>
<PropertyGroup>
<ProducesDotNetReleaseShippingAssets>true</ProducesDotNetReleaseShippingAssets>
<!-- This avoids creating VS.*.symbols.nupkg packages that are identical to the original package. -->
<AutoGenerateSymbolPackages>false</AutoGenerateSymbolPackages>
<!-- Set PlatformName to TargetArchitecture to create unique build manifest files. -->
<PlatformName Condition="'$(TargetArchitecture)' != ''">$(TargetArchitecture)</PlatformName>
</PropertyGroup>
<Target Name="GetNonStableProductVersion">
<!-- Retrieve the non-stable runtime pack product version.
Don't stabilize the package version in order to retrieve the VersionSuffix. -->
<MSBuild Projects="$(RepoRoot)src/windowsdesktop/src/sfx/Microsoft.WindowsDesktop.App.Runtime.sfxproj"
Targets="ReturnProductVersion"
Properties="IsShipping=false">
<Output TaskParameter="TargetOutputs" PropertyName="NonStableProductVersion" />
</MSBuild>
</Target>
<!-- This target only runs when EnableDefaultArtifacts=true which is a single build leg in CI. -->
<Target Name="GenerateProductVersionFiles"
DependsOnTargets="GetNonStableProductVersion"
BeforeTargets="PublishToAzureDevOpsArtifacts"
Condition="'$(EnableDefaultArtifacts)' == 'true'">
<!-- Retrieve the runtime pack version -->
<MSBuild Projects="$(RepoRoot)src/windowsdesktop/src/sfx/Microsoft.WindowsDesktop.App.Runtime.sfxproj"
Targets="ReturnProductVersion">
<Output TaskParameter="TargetOutputs" PropertyName="ProductVersion" />
</MSBuild>
<ItemGroup>
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)productVersion.txt" />
<ProductVersionFile Include="$(ArtifactsShippingPackagesDir)windowsdesktop-productVersion.txt" />
</ItemGroup>
<!-- Generate productVersion.txt file containing the product version. -->
<WriteLinesToFile File="%(ProductVersionFile.Identity)"
Lines="$(ProductVersion)"
Overwrite="true"
Encoding="ASCII" />
<ItemGroup>
<Artifact Include="@(ProductVersionFile)"
RelativeBlobPath="WindowsDesktop/$(NonStableProductVersion)/%(Filename)%(Extension)" />
</ItemGroup>
</Target>
<Target Name="AddRelativeBlobPathToInstallerArtifacts"
DependsOnTargets="GetNonStableProductVersion"
BeforeTargets="PublishToAzureDevOpsArtifacts"
AfterTargets="GenerateChecksumsFromArtifacts">
<ItemGroup>
<Artifact Condition="'%(Artifact.PublishFlatContainer)' == 'true' and '%(Artifact.RelativeBlobPath)' == ''"
RelativeBlobPath="WindowsDesktop/$(NonStableProductVersion)/%(Filename)%(Extension)" />
</ItemGroup>
</Target>
</Project>