summaryrefslogtreecommitdiff
path: root/packages/microsoft.dotnet.buildtools/2.1.0-rc1-03006-01/lib/PublishProduct.targets
diff options
context:
space:
mode:
Diffstat (limited to 'packages/microsoft.dotnet.buildtools/2.1.0-rc1-03006-01/lib/PublishProduct.targets')
-rwxr-xr-xpackages/microsoft.dotnet.buildtools/2.1.0-rc1-03006-01/lib/PublishProduct.targets64
1 files changed, 64 insertions, 0 deletions
diff --git a/packages/microsoft.dotnet.buildtools/2.1.0-rc1-03006-01/lib/PublishProduct.targets b/packages/microsoft.dotnet.buildtools/2.1.0-rc1-03006-01/lib/PublishProduct.targets
new file mode 100755
index 0000000000..621e948ed7
--- /dev/null
+++ b/packages/microsoft.dotnet.buildtools/2.1.0-rc1-03006-01/lib/PublishProduct.targets
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+
+ <UsingTask TaskName="ExecWithRetriesForNuGetPush" AssemblyFile="$(BuildToolsTaskDir)Microsoft.DotNet.Build.Tasks.dll" />
+
+ <!--
+ Utility target for pushing a set of packages using the ExecWithRetriesForNuGetPush task.
+ The per-package retries make this target more reliable than using NuGet.exe
+ when there is a hang.
+ -->
+ <Target Name="NuGetPush">
+ <!-- Interpret an input glob for easy direct usage from command line. -->
+ <ItemGroup Condition="'$(PackagesGlob)'!=''">
+ <PackagesToPush Include="$(PackagesGlob)" />
+ </ItemGroup>
+
+ <Error Text="NuGetSource property is not defined."
+ Condition="'$(NuGetSource)'==''" />
+
+ <PropertyGroup>
+ <NuGetTimeout Condition="'$(NuGetTimeout)'==''">600</NuGetTimeout>
+ <NuGetVerbosity Condition="'$(NuGetVerbosity)'==''">Detailed</NuGetVerbosity>
+
+ <NuGetPushArgsBase>$(NuGetPushArgsBase) push</NuGetPushArgsBase>
+ <NuGetPushArgsBase>$(NuGetPushArgsBase) -Source $(NuGetSource)</NuGetPushArgsBase>
+ <NuGetPushArgsBase>$(NuGetPushArgsBase) -Timeout $(NuGetTimeout)</NuGetPushArgsBase>
+ <NuGetPushArgsBase>$(NuGetPushArgsBase) -Verbosity $(NuGetVerbosity)</NuGetPushArgsBase>
+ <NuGetPushArgsBase Condition="'$(NuGetApiKey)'!=''">$(NuGetPushArgsBase) -ApiKey $(NuGetApiKey)</NuGetPushArgsBase>
+
+ <IgnorableErrorMessagesExistingPackageMessage>Overwriting existing packages is forbidden according to the package retention settings for this feed.</IgnorableErrorMessagesExistingPackageMessage>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <NuGetPushCommand Include="@(PackagesToPush -> '$(NuGetExePath) $(NuGetPushArgsBase) %(Identity)')">
+ <PackageToPush>%(Identity)</PackageToPush>
+ </NuGetPushCommand>
+
+ <!-- There are special failure scenarios that we want to ignore. Those scenarios are
+ when NuGet reports a failure during a push attempt for something server or timeout related,
+ and then gets a "Forbidden" response on the next attempt because the package "already exists".
+ This indicates that the failure was reported, but the push was actually successful.
+ -->
+ <IgnorableErrorMessages Include="$(IgnorableErrorMessagesExistingPackageMessage)">
+ <ConditionalErrorMessage>Pushing took too long</ConditionalErrorMessage>
+ </IgnorableErrorMessages>
+ <IgnorableErrorMessages Include="$(IgnorableErrorMessagesExistingPackageMessage)">
+ <ConditionalErrorMessage>The connection with the server was terminated abnormally</ConditionalErrorMessage>
+ </IgnorableErrorMessages>
+ <IgnorableErrorMessages Include="$(IgnorableErrorMessagesExistingPackageMessage)">
+ <ConditionalErrorMessage>An existing connection was forcibly closed by the remote host</ConditionalErrorMessage>
+ </IgnorableErrorMessages>
+ </ItemGroup>
+
+ <ExecWithRetriesForNuGetPush
+ Command="%(NuGetPushCommand.Identity)"
+ MaxAttempts="$(MaxAttempts)"
+ RetryDelayBase="$(RetryDelayBase)"
+ RetryDelayConstant="$(RetryDelayConstant)"
+ IgnoredErrorMessagesWithConditional="@(IgnorableErrorMessages)"
+ PackageFile="%(NuGetPushCommand.PackageToPush)"
+ PassIfIdenticalV2Feed="$(PassIfIdenticalV2Feed)" />
+ </Target>
+
+</Project>