-
Notifications
You must be signed in to change notification settings - Fork 605
Generate assembly attributes using MinVer and csproj #779
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
Conversation
@@ -57,7 +57,6 @@ class BlockingCell<T> | |||
{ | |||
private readonly ManualResetEventSlim _manualResetEventSlim = new ManualResetEventSlim(false); | |||
private T _value = default; | |||
public EventHandler<T> ContinueUsingValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed since this is unused. Build failed with the following (no idea why it started now):
src\util\BlockingCell.cs(60,32): error CS0649: Field 'BlockingCell<T>.ContinueUsingValue' is never assigned to, and will always have its default value null [C:\Users\lbakken\development\rabbitmq\rabbitmq-dotnet-client\projects\client\RabbitMQ.Client\Ra
bbitMQ.Client.csproj]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing a failure related to this, but if it's not being used, no harm in removing it.
461dea1
to
03c4627
Compare
03c4627
to
735b010
Compare
@lukebakken Let me know if/when you'd like a review of this. Alternatively, I have a branch ready to go with MinVer added if you'd like me to push that up. |
@bording this PR appears to be working fine, but I need to edit all the internal CI stuff to work with it now and re-think how the myget / nuget packages are built (auto vs manual) |
Ok, then I'll do a review pass on it if you don't mind, because there are some things I think need to be tweaked. |
Sure, go right ahead. I just invited you as a collaborator, so feel free to push right to this branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it's a nitpick, but you removed all the blank lines I just intentionally added in my most recent PR. Having that spacing really improves the readability!
@@ -1,43 +1,49 @@ | |||
<Project Sdk="Microsoft.NET.Sdk"> | |||
|
|||
<PropertyGroup> | |||
<VersionPrefix>6.0.0</VersionPrefix> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, we're using this as part of our CI scripts but I think that's going to change quite a bit. I'll remove it.
<Copyright>Copyright © 2007-2020 VMware, Inc. or its affiliates.</Copyright> | ||
<Description>The RabbitMQ .NET client is the official client library for C# (and, implicitly, other .NET languages)</Description> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<GenerateAssemblyInfo>true</GenerateAssemblyInfo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed.
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<RepositoryUrl>https://github.com/rabbitmq/rabbitmq-dotnet-client</RepositoryUrl> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added by Visual Studio when I filled-out the project properties via the built-in properties editor. I'm assuming there's no harm in having it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's being filled in already by Source Link, so you don't want to have it in the project file.
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<EmbedUntrackedSources>true</EmbedUntrackedSources> | ||
<RepositoryUrl>https://github.com/rabbitmq/rabbitmq-dotnet-client</RepositoryUrl> | ||
<RepositoryType>Git</RepositoryType> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was added by Visual Studio when I filled-out the project properties via the built-in properties editor. I'm assuming there's no harm in having it there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same reply.
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> | ||
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder> | ||
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile> | ||
<SignAssembly>true</SignAssembly> | ||
<MinVerTagPrefix>v</MinVerTagPrefix> | ||
<MinVerVerbosity>detailed</MinVerVerbosity> | ||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think it's a good idea to generate a package all the time, so I'd set this to true. It also makes sense to set PackageOutputPath
to move the location of where they get created.
Something like <PackageOutputPath>..\..\..\packages</PackageOutputPath>
for example.
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how you have to do this now, but there is better syntax coming for this soon! I think it might arrive in the 3.1.200 SDK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep I tried the new syntax which of course failed on 2.1 builds
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" /> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" /> | ||
<PackageReference Include="MinVer" Version="2.2.0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to
<PackageReference Include="MinVer" Version="2.2.0" PrivateAssets="All" />
<AssemblyTitle>RabbitMQ Client Library for .NET</AssemblyTitle> | ||
<Description>The RabbitMQ .NET client is the official client library for C# (and, implicitly, other .NET languages)</Description> | ||
<Company>VMware, Inc. or its affiliates.</Company> | ||
<PackageLicenseFile>LICENSE</PackageLicenseFile> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving to embedding the license file is good, but this is incomplete. The PackageLicense
line above should be removed, and you need to actually include the file in the package.
<ItemGroup> | ||
<Compile Include="..\..\..\gensrc\autogenerated-api-0-9-1.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="icon.png" /> | ||
<Content Include="icon.png" PackagePath="" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right around here is where you need
<None Include="..\..\..\LICENSE" Pack="true" PackagePath="" />
@@ -57,7 +57,6 @@ class BlockingCell<T> | |||
{ | |||
private readonly ManualResetEventSlim _manualResetEventSlim = new ManualResetEventSlim(false); | |||
private T _value = default; | |||
public EventHandler<T> ContinueUsingValue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not seeing a failure related to this, but if it's not being used, no harm in removing it.
Just saw this after I submitted my review. |
This error showed up in the internal CI when packing the PR build: ``` /usr/share/dotnet/sdk/3.1.102/Sdks/NuGet.Build.Tasks.Pack/buildCrossTargeting/NuGet.Build.Tasks.Pack.targets(198,5): error NU5030: The license file 'LICENSE' does not exist in the package. [/tmp/build/db7f1294/rabbitmq_dotnet_client/projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj] ```
Thanks @bording I'm just now addressing this issue - telia-oss/github-pr-resource#136 We use that Concourse resource and it doesn't fetch tags by default 🤦♂ ...but I think this PR is looking alright, lmk. |
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo"> | ||
<_Parameter1>Unit, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d20ec856aeeb8c3153a77faa2d80e6e43b5db93224a20cc7ae384f65f142e89730e2ff0fcc5d578bbe96fa98a7196c77329efdee4579b3814c0789e5a39b51df6edd75b602a33ceabdfcf19a3feb832f31d8254168cd7ba5700dfbca301fbf8db614ba41ba18474de0a5f4c2d51c995bc3636c641c8cbe76f45717bfcb943b5</_Parameter1> | ||
</AssemblyAttribute> | ||
<None Include="..\..\..\LICENSE"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be simplified to
<None Include="..\..\..\LICENSE" Pack="true" PackagePath="" />
I'd also move it up above the AssemblyAttribute
entry.
<None Remove="icon.png" /> | ||
<Content Include="icon.png" PackagePath="" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally like seeing the package references group separately into their own ItemGroup instead of all being in one, but that's more style / readability than a technical reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to re-org however you'd like! I'll refrain from smashing things all together going forward 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to re-org however you'd like! I'll refrain from smashing things all together going forward 😄
Just wanted to make sure I was pointing out style / preference things as such, and not trying to dictate how to do things!
Ah, yeah you're going to need the tags! |
As always thank you @bording |
Generate assembly attributes using MinVer and csproj (cherry picked from commit ca93809)
Fixes #768