From 6534a648cb442eca76b9ce762e631513efa563a2 Mon Sep 17 00:00:00 2001 From: tmat Date: Thu, 20 Jun 2024 12:37:21 -0700 Subject: [PATCH 1/6] Flow NuGetPackageRoot out of Tools.proj restore --- .../tools/Build.proj | 22 ++++++++++++------- .../tools/Tools.proj | 2 ++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj b/src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj index 11bc975dd42..6d9a43566fd 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Build.proj @@ -149,6 +149,20 @@ <_RestoreToolsProps Include="DotNetPublishUsingPipelines=$(DotNetPublishUsingPipelines)"/> + + + + + + + <_CommonProps Include="@(_RestoreToolsOutput->'NuGetPackageRoot=%(Identity)')"/> + + - - + + <_RestoreToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/> + <_RestoreToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/> + + + + Condition="'$(Restore)' == 'true'"/> + + - + <_CommonProps Include="@(_RestoreToolsOutput->'NuGetPackageRoot=%(Identity)')"/> - - - <_RestoreToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/> - <_RestoreToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/> - - <_PublishProps Include="@(_CommonProps)"/> diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj index c9f11138485..1312bf079f3 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj @@ -86,7 +86,9 @@ Condition="'$(Restore)' == 'true'"/> - + + + - <_RestoreToolsProps Include="BaseIntermediateOutputPath=$(ArtifactsToolsetDir)Common"/> - <_RestoreToolsProps Include="ExcludeRestorePackageImports=true"/> - <_RestoreToolsProps Include="_NuGetRestoreTargets=$(_NuGetRestoreTargets)"/> + <_CommonToolsProps Include="@(_CommonProps)"/> + <_CommonToolsProps Include="BaseIntermediateOutputPath=$(ArtifactsToolsetDir)Common"/> + <_CommonToolsProps Include="_NuGetRestoreTargets=$(_NuGetRestoreTargets)"/> - <_RestoreToolsProps Include="Publish=$(Publish)"/> + <_CommonToolsProps Include="Publish=$(Publish)"/> - <_RestoreToolsProps Include="PublishToSymbolServer=$(PublishToSymbolServer)"/> + <_CommonToolsProps Include="PublishToSymbolServer=$(PublishToSymbolServer)"/> - <_RestoreToolsProps Include="DotNetPublishUsingPipelines=$(DotNetPublishUsingPipelines)"/> + <_CommonToolsProps Include="DotNetPublishUsingPipelines=$(DotNetPublishUsingPipelines)"/> - <_RestoreToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/> - <_RestoreToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/> + <_CommonToolsProps Include="DotNetRuntimeSourceFeed=$(DotNetRuntimeSourceFeed)"/> + <_CommonToolsProps Include="DotNetRuntimeSourceFeedKey=$(DotNetRuntimeSourceFeedKey)"/> + + + + <_RestoreToolsProps Include="@(_CommonToolsProps)"/> + <_RestoreToolsProps Include="ExcludeRestorePackageImports=true"/> - + @@ -7,7 +7,7 @@ net472 - 5 + v4.7.2 .NETFramework .NETFramework,Version=v4.7.2 $(BaseIntermediateOutputPath) From 50dd41dfebd58fc6b113a282bf8c855b5d1838bd Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 27 Jun 2024 08:49:54 -0500 Subject: [PATCH 4/6] Use Microsoft.Build.NoTargets instead of Microsoft.Build.Traversal --- src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj index 06afec5d9ea..a91c51d519f 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj @@ -1,5 +1,5 @@ - + From b7f3b9153c5d11af7110b065a8913378178b0cea Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Thu, 27 Jun 2024 17:33:27 -0500 Subject: [PATCH 5/6] Inline Microsoft.Build.NoTargets to avoid a reference to an external SDK --- ...56.DisableCopyFilesMarkedCopyLocal.targets | 4 + ...Microsoft.Build.NoTargets.3.7.56.Sdk.props | 80 +++++++++++++ ...crosoft.Build.NoTargets.3.7.56.Sdk.targets | 106 ++++++++++++++++++ .../tools/Tools.proj | 6 +- 4 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets create mode 100644 src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props create mode 100644 src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets new file mode 100644 index 00000000000..6be7cc07bca --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props new file mode 100644 index 00000000000..e1dc717defb --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props @@ -0,0 +1,80 @@ + + + + + + true + $(MSBuildAllProjects);$(MsBuildThisFileFullPath) + + + + + true + true + true + + + + + + + false + false + + + PackageReference + + + true + + + false + false + + + false + + + false + + + false + + + true + + + false + false + true + + + true + + + + + + false + true + + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets new file mode 100644 index 00000000000..a62a43a78f5 --- /dev/null +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets @@ -0,0 +1,106 @@ + + + + + + + $(MSBuildToolsPath)\Microsoft.Common.targets + $(MSBuildAllProjects);$(MsBuildThisFileFullPath) + + + + + + + false + + + $(CustomBeforeMicrosoftCommonTargets);$(MSBuildExtensionsPath)\Microsoft\VisualStudio\Managed\Microsoft.Managed.DesignTime.targets + + + + + + + + BuildOnlySettings; + PrepareForBuild; + PreBuildEvent; + ResolveReferences; + Compile; + GetTargetPath; + PrepareForRun; + IncrementalClean; + PostBuildEvent + + + + None + false + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj index a91c51d519f..438065e41c5 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Tools.proj @@ -1,5 +1,7 @@ - + + + @@ -101,4 +103,6 @@ + + From 85fba110828a504eb39750d19504f1b28db00a2b Mon Sep 17 00:00:00 2001 From: Sam Harwell Date: Wed, 3 Jul 2024 13:27:45 -0500 Subject: [PATCH 6/6] Add attribution notice --- ...ld.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets | 3 ++- .../tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props | 1 + .../tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets index 6be7cc07bca..86e95ca1b14 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.DisableCopyFilesMarkedCopyLocal.targets @@ -1,4 +1,5 @@ + - \ No newline at end of file + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props index e1dc717defb..945ada3e5d2 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.props @@ -4,6 +4,7 @@ Licensed under the MIT license. --> + diff --git a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets index a62a43a78f5..94ea814bf1e 100644 --- a/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets +++ b/src/Microsoft.DotNet.Arcade.Sdk/tools/Microsoft.Build.NoTargets.3.7.56.Sdk.targets @@ -1,9 +1,10 @@ - + +