Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save lbussell/39bb703efc1ff7ad47e0f67128610792 to your computer and use it in GitHub Desktop.
Save lbussell/39bb703efc1ff7ad47e0f67128610792 to your computer and use it in GitHub Desktop.
dotnet/arcade patch to enable NuGetRepack in source-build
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Logan Bussell <[email protected]>
Date: Wed, 25 May 2022 11:15:39 -0700
Subject: [PATCH] Enable NuGetRepack in source build
---
src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props | 1 -
src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj | 5 ++++-
src/Microsoft.DotNet.NuGetRepack/Directory.Build.props | 5 -----
3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props
index 3155d00f..871734a0 100644
--- a/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props
+++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/DefaultVersions.props
@@ -72,7 +72,6 @@
<UsingToolIbcOptimization>false</UsingToolIbcOptimization>
<UsingToolVisualStudioIbcTraining>false</UsingToolVisualStudioIbcTraining>
<UsingToolSymbolUploader>false</UsingToolSymbolUploader>
- <UsingToolNuGetRepack>false</UsingToolNuGetRepack>
</PropertyGroup>
<!--
diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj
index 54929336..119a2496 100644
--- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj
+++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj
@@ -27,6 +27,10 @@
<Import Project="$(_NuGetRestoreTargets)" />
+ <ItemGroup>
+ <PackageReference Include="Microsoft.DotNet.NuGetRepack.Tasks" Version="$(MicrosoftDotnetNuGetRepackTasksVersion)" Condition="'$(UsingToolNuGetRepack)' == 'true'" IsImplicitlyDefined="true" />
+ </ItemGroup>
+
<ItemGroup Condition="'$(DotNetBuildFromSource)' != 'true'">
<!-- Copy of 'sn.exe' in form of NuGet package. -->
<PackageReference Include="sn" Version="$(SNVersion)" IsImplicitlyDefined="true" />
@@ -34,7 +38,6 @@
<PackageReference Include="MicroBuild.Core.Sentinel" Version="1.0.0" IsImplicitlyDefined="true" />
<PackageReference Include="vswhere" Version="$(VSWhereVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Feed" Version="$(MicrosoftDotNetBuildTasksFeedVersion)" IsImplicitlyDefined="true" />
- <PackageReference Include="Microsoft.DotNet.NuGetRepack.Tasks" Version="$(MicrosoftDotnetNuGetRepackTasksVersion)" Condition="'$(UsingToolNuGetRepack)' == 'true'" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.SignTool" Version="$(MicrosoftDotNetSignToolVersion)" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.SymbolUploader.Build.Task" Version="$(MicrosoftSymbolUploaderBuildTaskVersion)" Condition="'$(PublishToSymbolServer)' == 'true'" IsImplicitlyDefined="true" />
<PackageReference Include="Microsoft.DotNet.Build.Tasks.VisualStudio" Version="$(MicrosoftDotNetBuildTasksVisualStudioVersion)" Condition="'$(UsingToolVSSDK)' == 'true'" IsImplicitlyDefined="true" />
diff --git a/src/Microsoft.DotNet.NuGetRepack/Directory.Build.props b/src/Microsoft.DotNet.NuGetRepack/Directory.Build.props
index 14dec147..da0dcf51 100644
--- a/src/Microsoft.DotNet.NuGetRepack/Directory.Build.props
+++ b/src/Microsoft.DotNet.NuGetRepack/Directory.Build.props
@@ -3,9 +3,4 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)\.., Directory.Build.props))\Directory.Build.props" />
- <!-- Don't include NuGetRepack in source-build until we find a reason to use it. -->
- <PropertyGroup>
- <ExcludeFromSourceBuild>true</ExcludeFromSourceBuild>
- </PropertyGroup>
-
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment