Skip to content

Add Csproj pack infra for packages with ref and runtime assemblies and symbols.#54250

Merged
Anipik merged 4 commits into
dotnet:mainfrom
Anipik:pack
Jul 2, 2021
Merged

Add Csproj pack infra for packages with ref and runtime assemblies and symbols.#54250
Anipik merged 4 commits into
dotnet:mainfrom
Anipik:pack

Conversation

@Anipik

@Anipik Anipik commented Jun 15, 2021

Copy link
Copy Markdown
Contributor
  • use nuget feed for nuget pack tasks.
  • targets for adding ref assemblies, runtime assemblies, ref symbols and runtime symbols.

@ghost

ghost commented Jun 15, 2021

Copy link
Copy Markdown

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details
  • use nuget feed for nuget pack tasks.
  • targets for adding ref assemblies, runtime assemblies, ref symbols and runtime symbols.
Author: Anipik
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

@Anipik Anipik closed this Jun 16, 2021
@Anipik Anipik reopened this Jun 16, 2021
Comment thread src/libraries/Directory.Build.targets Outdated
Comment thread src/libraries/Directory.Build.targets Outdated
Comment thread src/libraries/Directory.Build.targets Outdated
Comment thread src/libraries/Directory.Build.targets Outdated
Comment thread src/libraries/System.Windows.Extensions/src/System.Windows.Extensions.csproj Outdated

@ViktorHofer ViktorHofer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to move the packaging related infrastructure into the packaging.props/targets files instead?

@Anipik

Anipik commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

The file differences are

  • dotnet pack appends the filename to the item
  • removes empty exclude items.

@Anipik

Anipik commented Jun 25, 2021

Copy link
Copy Markdown
Contributor Author

@ericstj @ViktorHofer @safern can you take another look at this.

Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
Comment thread eng/packaging.targets Outdated
@ViktorHofer

Copy link
Copy Markdown
Member

Should this section be removed now?

<!-- TODO: Remove this after https://github.com/NuGet/NuGet.Client/pull/3980 is merged.-->
<Target Name="RemoveXmlFilesFromBuildOutput" BeforeTargets="GenerateNuspec">
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>.dll;.exe;.winmd;.json;.pri;</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>.pdb;.mdb;$(AllowedOutputExtensionsInPackageBuildOutputFolder)</AllowedOutputExtensionsInSymbolsPackageBuildOutputFolder>
</PropertyGroup>
</Target>

@Anipik

Anipik commented Jul 1, 2021

Copy link
Copy Markdown
Contributor Author
E:\>git diff temp1.nuspec Temp2.nuspec
diff --git a/temp1.nuspec b/Temp2.nuspec
index 37549f3..21cdb36 100644
--- a/temp1.nuspec
+++ b/Temp2.nuspec
@@ -1,16 +1,13 @@
 <?xml version="1.0" encoding="utf-8"?>
-<package xmlns="http://schemas.microsoft.com/packaging/2013/01/nuspec.xsd">
-  <metadata minClientVersion="2.12">
+<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
+  <metadata>
     <id>System.Windows.Extensions</id>
     <version>6.0.0-dev</version>
-    <title>System.Windows.Extensions</title>
     <authors>Microsoft</authors>
-    <owners>microsoft,dotnetframework</owners>
-    <requireLicenseAcceptance>false</requireLicenseAcceptance>
     <license type="expression">MIT</license>
+    <licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
     <icon>Icon.png</icon>
     <projectUrl>https://dot.net/</projectUrl>
-    <iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
     <description>Provides miscellaneous Windows-specific types

 Commonly Used Types:
@@ -21,42 +18,33 @@ System.Security.Cryptography.X509Certificates.X509SelectionFlag</description>
     <serviceable>true</serviceable>
     <repository type="git" url="https://github.com/dotnet/runtime" commit="0000000000000000000000000000000000000000" />
     <dependencies>
-      <group targetFramework=".NETCoreApp6.0">
-        <dependency id="System.Drawing.Common" version="6.0.0-dev" />
+      <group targetFramework="net6.0">
+        <dependency id="System.Drawing.Common" version="6.0.0-dev" exclude="Build,Analyzers" />
       </group>
       <group targetFramework=".NETCoreApp3.1">
-        <dependency id="System.Drawing.Common" version="6.0.0-dev" />
+        <dependency id="System.Drawing.Common" version="6.0.0-dev" exclude="Build,Analyzers" />
       </group>
     </dependencies>
   </metadata>
   <files>
-    <file src="artifacts\bin\System.Windows.Extensions\ref\net6.0-Debug\System.Windows.Extensions.dll" target="ref\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\ref\net6.0-Debug\System.Windows.Extensions.pdb" target="ref\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\ref\netcoreapp3.1-Debug\System.Windows.Extensions.dll" target="ref\netcoreapp3.1" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\ref\netcoreapp3.1-Debug\System.Windows.Extensions.pdb" target="ref\netcoreapp3.1" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="ref\net6.0" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="ref\netcoreapp3.1" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="runtimes\win\lib\net6.0" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="runtimes\win\lib\netcoreapp3.1" exclude="" />
-
-
-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.dll" target="lib\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.pdb" target="lib\net6.0" exclude="" />
+    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.dll" target="lib\net6.0\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\net6.0-Debug\System.Windows.Extensions.pdb" target="lib\net6.0\System.Windows.Extensions.pdb" />

-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.dll" target="lib\netcoreapp3.1" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.pdb" target="lib\netcoreapp3.1" exclude="" />
+    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.dll" target="lib\netcoreapp3.1\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-Debug\System.Windows.Extensions.pdb" target="lib\netcoreapp3.1\System.Windows.Extensions.pdb" />

-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\net6.0" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.pdb" target="runtimes\win\lib\net6.0" exclude="" />
+    <file src="artifacts\obj\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\net6.0\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\net6.0-windows-Debug\System.Windows.Extensions.pdb" target="\runtimes\win\lib\net6.0\System.Windows.Extensions.pdb" />

-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\netcoreapp3.1" exclude="" />
-    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.pdb" target="runtimes\win\lib\netcoreapp3.1" exclude="" />
-
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\net6.0" exclude="" />
-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\netcoreapp3.1" exclude="" />
+    <file src="artifacts\obj\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.dll" target="runtimes\win\lib\netcoreapp3.1\System.Windows.Extensions.dll" />
+    <file src="artifacts\bin\System.Windows.Extensions\netcoreapp3.1-windows-Debug\System.Windows.Extensions.pdb" target="\runtimes\win\lib\netcoreapp3.1\System.Windows.Extensions.pdb" />
+
+    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\net6.0\System.Windows.Extensions.xml" />
+    <file src="C:\Users\anagniho\.nuget\packages\microsoft.private.intellisense\5.0.0-preview-20201009.2\IntellisenseFiles\net\1033\System.Windows.Extensions.xml" target="lib\netcoreapp3.1\System.Windows.Extensions.xml" />

-    <file src="C:\Users\anagniho\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21321.1\tools\Assets\DotNetPackageIcon.png" target="Icon.png" exclude="" />
-    <file src="LICENSE.TXT" target="LICENSE.TXT" exclude="" />
-    <file src="THIRD-PARTY-NOTICES.TXT" target="THIRD-PARTY-NOTICES.TXT" exclude="" />
+    <file src="C:\Users\anagniho\.nuget\packages\microsoft.dotnet.arcade.sdk\6.0.0-beta.21321.1\tools\Assets\DotNetPackageIcon.png" target="Icon.png" />
+    <file src="LICENSE.TXT" target="LICENSE.TXT" />
+    <file src="THIRD-PARTY-NOTICES.TXT" target="THIRD-PARTY-NOTICES.TXT" />
+    <file src="eng\useSharedDesignerContext.txt" target="useSharedDesignerContext.txt" />
   </files>
 </package>
\ No newline at end of file

updated diff of removing ref and runtime xml files,
adding useSharedDesignerContext to all the packages as well.

Anipik added 2 commits July 1, 2021 19:49
delete the project

add a comment

move the warning disable to cenral location

moving props/targets to packaging.props and packaging.targets

use intellisense package for ref and runtime xml files

add comments, flag for ref assemblies, remove xml from runtimes, use outputItem to get the reference assembly

addressing some more feedback

remove ref assemblies

add suppression file and update package validatio

@ViktorHofer ViktorHofer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great now. Feel free to merge after you updated the PackageValidation version again to the latest. Also should we set up a subscription now to keep the bits flowing?

@Anipik

Anipik commented Jul 2, 2021

Copy link
Copy Markdown
Contributor Author

created issue #55085 for failing unrelated test

@Anipik Anipik merged commit b26d811 into dotnet:main Jul 2, 2021

@safern safern left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants