Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use MsBuild for packing .nupkg files #1404

Merged
merged 1 commit into from
Oct 25, 2017

Conversation

ngbrown
Copy link
Contributor

@ngbrown ngbrown commented Oct 25, 2017

Use dotnet msbuild tasks to pack NuGet .nupkg files. Done as part of the primary build in the current NAnt scripts.

  • The README.md file isn't transformed to .html for the .nupkg file, but is copied as is. I doubt many people need it there when they should refer to the most recent version on github.
  • Removed the unused and broken NHibernate.Setup WiX project.

@ngbrown ngbrown mentioned this pull request Oct 25, 2017
29 tasks
<PropertyGroup>
<Description>An object persistence library for relational databases.</Description>
<Description>NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed, fully featured and used in thousands of successful projects.</Description>
<PackageTags>ORM; O/RM; DataBase; DAL; ObjectRelationalMapping; NHibernate; ADO.Net; Core</PackageTags>
Copy link
Member

Choose a reason for hiding this comment

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

Tags are space separated

Copy link
Contributor Author

@ngbrown ngbrown Oct 25, 2017

Choose a reason for hiding this comment

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

https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#packagetags In the resulting .nuspec file, they are space separated.

<PackageReference Include="iesi.collections" Version="4.0.2" />
<PackageReference Include="Remotion.Linq" Version="2.1.2" />
<PackageReference Include="Remotion.Linq.EagerFetching" Version="2.1.0" />
<PackageReference Include="Antlr3.Runtime" Version="[3.5.1, 4.0)" />
Copy link
Member

Choose a reason for hiding this comment

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

I doubt there will be v4 of Antlr3

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Excluding v4 was how the previous .nuspec had it. It doesn't hurt to keep it.

@hazzik
Copy link
Member

hazzik commented Oct 25, 2017

Can you please drop d55ffdf out of this PR?

@hazzik hazzik added this to the 5.0.1 milestone Oct 25, 2017
@ngbrown
Copy link
Contributor Author

ngbrown commented Oct 25, 2017

Can you please drop d55ffdf out of this PR?

Do you want it as a separate pull request? Is there a reason for leaving it?

@ngbrown ngbrown force-pushed the feature/msbuild-pack branch from c66adc2 to 8e49199 Compare October 25, 2017 09:04
<PropertyGroup>
<Description>An object persistence library for relational databases.</Description>
<Description>NHibernate is a mature, open source object-relational mapper for the .NET framework. It is actively developed, fully featured and used in thousands of successful projects.</Description>
Copy link
Member

Choose a reason for hiding this comment

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

Please put this into <PackageDescription>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hazzik what are you referencing? <Description> is what Visual Studio fills out based on the project package property page, and what is documented here: https://docs.microsoft.com/en-us/dotnet/core/tools/csproj#description

Copy link
Member

@hazzik hazzik Oct 25, 2017

Choose a reason for hiding this comment

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

I don't care about this documentation. I'm talking about this one: https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Core/NuGet.Build.Tasks.Pack/Pack.targets#L28 (it was hard to find this file)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree that the naming of properties intended to be set in .csproj for generating .nuget packages are not altogether consistent, but they do work as documented.

If you set the description in <PackageDescription>, it may override that pack.targets property, but it no longer shows up in Visual Studio's project property page for the Package description, so <PackageDescription> clearly is not the property that is intended to be set in the .csproj file. The line you reference is by default set by $(Description), which we were already setting in the .csproj. I just adjusted the text so the output .nuspec matches the old templated one.

If you compile and compare the extracted .nuget packages, it all works fine.

Copy link
Member

Choose a reason for hiding this comment

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

The problem that Description also meant to set AssemblyDescriptionAttribute. The PackageDescription is what transferred into the PackTask (L211). So, it is a correct way to set the separate descriptions for a package and an assembly.

Copy link
Contributor Author

@ngbrown ngbrown Oct 25, 2017

Choose a reason for hiding this comment

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

ok... but where does that ever show up in normal use? It doesn't show up in the NHibernate.dll file Properties dialog (from File Explorer).

Is there a problem if the text on AssemblyDescriptionAttribute does match the NuGet package description?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@ngbrown ngbrown Oct 25, 2017

Choose a reason for hiding this comment

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

I'm not saying that they don't collide; obviously they do. I was asking why it matters? Also, the NuGet/NuGet.Client#1648 pull request was only 2 months ago, so it wasn't included in the .net core sdk 2.0.0 release. On my computer, the file at: C:\Program Files\dotnet\sdk\2.0.0\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets doesn't have <PackageDescription> and instead relies on <Description>:

    <Description Condition="'$(Description)'==''">Package Description</Description>

Copy link
Member

@hazzik hazzik Oct 25, 2017

Choose a reason for hiding this comment

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

It's in 2.0.2 / VS 2017.4

@hazzik
Copy link
Member

hazzik commented Oct 25, 2017

Is there a reason for leaving it?

There are a lot of changes not related to the topic of the PR

@@ -12,5 +12,17 @@
<Product>NHibernate</Product>
<Company>NHibernate.info</Company>
<Copyright>Licensed under LGPL.</Copyright>
<Authors>NHibernate community, Hibernate community</Authors>
<Company>NHibernate.info</Company>
Copy link
Member

Choose a reason for hiding this comment

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

Already here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed duplicate property.

@ngbrown ngbrown force-pushed the feature/msbuild-pack branch from 8e49199 to 9233b60 Compare October 25, 2017 09:43
@ngbrown
Copy link
Contributor Author

ngbrown commented Oct 25, 2017

I've separated out the d55ffdf commit into #1405 and fixed the errors and pushed a replacement commit.

@hazzik hazzik force-pushed the feature/msbuild-pack branch 2 times, most recently from b68ecf7 to a18c2e5 Compare October 25, 2017 11:05
@hazzik
Copy link
Member

hazzik commented Oct 25, 2017

I've removed unrelated changes

hazzik
hazzik previously approved these changes Oct 25, 2017
@ngbrown
Copy link
Contributor Author

ngbrown commented Oct 25, 2017

I think my changes were better. Now with the <GeneratePackageOnBuild>true</GeneratePackageOnBuild> in the project instead set at build time, the NHibernate.5.0.0.nupkg and NHibernate.5.0.0.symbols.nupkg are going to be built every time you build in Visual Studio. That means zipping up some 2,000 source files every time.

@hazzik
Copy link
Member

hazzik commented Oct 25, 2017

But this is only in release configuration. Do you often build that?

@ngbrown
Copy link
Contributor Author

ngbrown commented Oct 25, 2017

No, I suppose I don't build release in visual studio often.

Too many common items such as PackageProjectUrl, PackageIconUrl, PackageRequireLicenseAcceptance, and PackageLicenseUrl moved out of the common NHibernate.props and into the .csproj. There's no reason they would change between packages released from this repository.

@hazzik hazzik force-pushed the feature/msbuild-pack branch from 25642d3 to e7a5979 Compare October 25, 2017 11:54
@ngbrown
Copy link
Contributor Author

ngbrown commented Oct 25, 2017

After force pushing on top of each other... the current version (e7a5979) is probably the best it's been. Thanks for the feedback.

@hazzik hazzik merged commit 0157daf into nhibernate:master Oct 25, 2017
@hazzik
Copy link
Member

hazzik commented Oct 25, 2017

Thanks

@ngbrown ngbrown deleted the feature/msbuild-pack branch October 26, 2017 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants