Skip to content

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

Merged
merged 5 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 17 additions & 12 deletions projects/client/RabbitMQ.Client/RabbitMQ.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>6.0.0</VersionPrefix>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyTitle>RabbitMQ Client Library for .NET</AssemblyTitle>
<Authors>VMware</Authors>
<Company>VMware, Inc. or its affiliates.</Company>
<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>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>RabbitMQ</PackageTags>
<PackageIcon>icon.png</PackageIcon>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
Copy link
Collaborator

@bording bording Mar 26, 2020

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.

<PackageProjectUrl>https://www.rabbitmq.com/dotnet.html</PackageProjectUrl>
<PackageLicense>https://www.rabbitmq.com/dotnet.html</PackageLicense>
<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>
<PackageTags>rabbitmq, amqp</PackageTags>
<Product>RabbitMQ</Product>
<Copyright>Copyright © 2007-2020 VMware, Inc. or its affiliates.</Copyright>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<MinVerTagPrefix>v</MinVerTagPrefix>
<MinVerVerbosity>detailed</MinVerVerbosity>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageOutputPath>..\..\..\packages</PackageOutputPath>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\..\gensrc\autogenerated-api-0-9-1.cs" />
</ItemGroup>

<ItemGroup>
<None Remove="icon.png" />
<Content Include="icon.png" PackagePath="" />
Copy link
Collaborator

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="" />

<None Include="..\..\..\LICENSE" Pack="true" PackagePath="" />
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
Copy link
Collaborator

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

Copy link
Collaborator Author

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

<_Parameter1>Unit, PublicKey=00240000048000009400000006020000002400005253413100040000010001008d20ec856aeeb8c3153a77faa2d80e6e43b5db93224a20cc7ae384f65f142e89730e2ff0fcc5d578bbe96fa98a7196c77329efdee4579b3814c0789e5a39b51df6edd75b602a33ceabdfcf19a3feb832f31d8254168cd7ba5700dfbca301fbf8db614ba41ba18474de0a5f4c2d51c995bc3636c641c8cbe76f45717bfcb943b5</_Parameter1>
</AssemblyAttribute>
</ItemGroup>

<ItemGroup>
Copy link
Collaborator

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.

Copy link
Collaborator Author

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 😄

Copy link
Collaborator

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!

<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" PrivateAssets="All" />
<PackageReference Include="System.Memory" Version="4.5.3" />
</ItemGroup>

Expand Down
Binary file modified projects/client/RabbitMQ.Client/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

2 changes: 0 additions & 2 deletions projects/client/RabbitMQ.Client/src/util/BlockingCell.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class BlockingCell<T>
{
private readonly ManualResetEventSlim _manualResetEventSlim = new ManualResetEventSlim(false);
private T _value = default;
public EventHandler<T> ContinueUsingValue;
Copy link
Collaborator Author

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]

Copy link
Collaborator

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.


public void ContinueWithValue(T value)
{
Expand All @@ -84,7 +83,6 @@ public T WaitForValue(TimeSpan timeout)
{
if (_manualResetEventSlim.Wait(timeout))
{
ContinueUsingValue?.Invoke(this, _value);
return _value;
}
throw new TimeoutException();
Expand Down