Fix unset ZapRelocationType for fixup (#18589)
[platform/upstream/coreclr.git] / Tools / PublishProduct.targets
1 <?xml version="1.0" encoding="utf-8"?>
2 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3
4   <UsingTask TaskName="ExecWithRetriesForNuGetPush" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
5
6   <!--
7     Utility target for pushing a set of packages using the ExecWithRetriesForNuGetPush task.
8     The per-package retries make this target more reliable than using NuGet.exe
9     when there is a hang.
10   -->
11   <Target Name="NuGetPush">
12     <!-- Interpret an input glob for easy direct usage from command line. -->
13     <ItemGroup Condition="'$(PackagesGlob)'!=''">
14       <PackagesToPush Include="$(PackagesGlob)" />
15     </ItemGroup>
16
17     <Error Text="NuGetSource property is not defined."
18            Condition="'$(NuGetSource)'==''" />
19
20     <PropertyGroup>
21       <NuGetTimeout Condition="'$(NuGetTimeout)'==''">600</NuGetTimeout>
22       <NuGetVerbosity Condition="'$(NuGetVerbosity)'==''">Detailed</NuGetVerbosity>
23
24       <NuGetPushArgsBase>$(NuGetPushArgsBase) push</NuGetPushArgsBase>
25       <NuGetPushArgsBase>$(NuGetPushArgsBase) -Source $(NuGetSource)</NuGetPushArgsBase>
26       <NuGetPushArgsBase>$(NuGetPushArgsBase) -Timeout $(NuGetTimeout)</NuGetPushArgsBase>
27       <NuGetPushArgsBase>$(NuGetPushArgsBase) -Verbosity $(NuGetVerbosity)</NuGetPushArgsBase>
28       <NuGetPushArgsBase Condition="'$(NuGetApiKey)'!=''">$(NuGetPushArgsBase) -ApiKey $(NuGetApiKey)</NuGetPushArgsBase>
29
30       <IgnorableErrorMessagesExistingPackageMessage>Overwriting existing packages is forbidden according to the package retention settings for this feed.</IgnorableErrorMessagesExistingPackageMessage>
31     </PropertyGroup>
32
33     <ItemGroup>
34       <NuGetPushCommand Include="@(PackagesToPush -> '$(NuGetExePath) $(NuGetPushArgsBase) %(Identity)')">
35         <PackageToPush>%(Identity)</PackageToPush>
36       </NuGetPushCommand>
37
38       <!-- There are special failure scenarios that we want to ignore.  Those scenarios are
39            when NuGet reports a failure during a push attempt for something server or timeout related, 
40            and then gets a "Forbidden" response on the next attempt because the package "already exists".  
41            This indicates that the failure was reported, but the push was actually successful.
42       -->
43       <IgnorableErrorMessages Include="$(IgnorableErrorMessagesExistingPackageMessage)">
44         <ConditionalErrorMessage>Pushing took too long</ConditionalErrorMessage>
45       </IgnorableErrorMessages>
46       <IgnorableErrorMessages Include="$(IgnorableErrorMessagesExistingPackageMessage)">
47         <ConditionalErrorMessage>The connection with the server was terminated abnormally</ConditionalErrorMessage>
48       </IgnorableErrorMessages>
49       <IgnorableErrorMessages Include="$(IgnorableErrorMessagesExistingPackageMessage)">
50         <ConditionalErrorMessage>An existing connection was forcibly closed by the remote host</ConditionalErrorMessage>
51       </IgnorableErrorMessages>
52     </ItemGroup>
53
54     <ExecWithRetriesForNuGetPush
55       Command="%(NuGetPushCommand.Identity)"
56       MaxAttempts="$(MaxAttempts)"
57       RetryDelayBase="$(RetryDelayBase)"
58       RetryDelayConstant="$(RetryDelayConstant)"
59       IgnoredErrorMessagesWithConditional="@(IgnorableErrorMessages)"
60       PackageFile="%(NuGetPushCommand.PackageToPush)"
61       PassIfIdenticalV2Feed="$(PassIfIdenticalV2Feed)" />
62   </Target>
63
64 </Project>