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

Replace nuspec and AssemblyInfo with csproj #892

Merged
merged 1 commit into from
Jun 28, 2019
Merged

Replace nuspec and AssemblyInfo with csproj #892

merged 1 commit into from
Jun 28, 2019

Conversation

jnyrup
Copy link
Contributor

@jnyrup jnyrup commented Jun 17, 2019

Fixes #742
Replaces #743

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the [Contribution Guide] and my PR follows them.
  • I updated my branch with the development branch. there is no development branch, only master
  • I have added tests that prove my fix is effective or that my feature works I've added screenshots in this PR
  • I have added necessary documentation about the functionality in the appropriate .md file
  • I have added in line documentation to the code I modified

Short description of what this PR does:

This PR:

  • Replaces the use of the .nuspec file by moving the metadata to the .csproj file
  • Moves metadata from AssemblyInfo.cs to csproj.

The nuspec is then be generated and included when packing the nupkg.
The purpose of this change is to prevent discrepancies between the csproj and the nuspec file, as the dependencies are now defined a single place.
Also the version number is now defined a single places, instead of spread out across three files.

Here's a copy of the generated nuspec, which is almost identical to the current nuspec

<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>SendGrid</id>
    <version>9.11.0</version>
    <authors>Elmer Thomas,Twilio DX Team</authors>
    <owners>Elmer Thomas,Twilio DX Team</owners>
    <requireLicenseAcceptance>false</requireLicenseAcceptance>
    <license type="expression">MIT</license>
    <licenseUrl>https://licenses.nuget.org/MIT</licenseUrl>
    <projectUrl>https://sendgrid.com/</projectUrl>
    <iconUrl>https://sendgrid.com/wp-content/themes/sgdotcom/pages/resource/brand//2016/SendGrid-Logomark.png</iconUrl>
    <description>C# client library and examples for using Twilio SendGrid API's to send mail and access Web API v3 endpoints with .NET Standard 1.3 and .NET Core support.</description>
    <releaseNotes>Please see: https://github.com/sendgrid/sendgrid-csharp/releases</releaseNotes>
    <copyright>Twilio SendGrid, Inc. 2019</copyright>
    <tags>Twilio SendGrid Email Mail Microsoft Azure Transactional .NET Core</tags>
    <repository type="git" url="https://github.com/sendgrid/sendgrid-csharp.git" />
    <dependencies>
      <group targetFramework=".NETFramework4.5.2">
        <dependency id="Newtonsoft.Json" version="9.0.1" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard1.3">
        <dependency id="NETStandard.Library" version="1.6.1" exclude="Build,Analyzers" />
        <dependency id="Newtonsoft.Json" version="9.0.1" exclude="Build,Analyzers" />
      </group>
      <group targetFramework=".NETStandard2.0">
        <dependency id="Newtonsoft.Json" version="9.0.1" exclude="Build,Analyzers" />
      </group>
    </dependencies>
    <frameworkAssemblies>
      <frameworkAssembly assemblyName="Microsoft.CSharp" targetFramework=".NETFramework4.5.2" />
      <frameworkAssembly assemblyName="System" targetFramework=".NETFramework4.5.2" />
      <frameworkAssembly assemblyName="System.Net.Http" targetFramework=".NETFramework4.5.2" />
      <frameworkAssembly assemblyName="System.Runtime.Serialization" targetFramework=".NETFramework4.5.2" />
    </frameworkAssemblies>
  </metadata>
</package>

Some notes:

For comparison here are screenshots from NuGet Package Explorer of the content.

9.11.0 from nuget.org
nuspec-old

The nupkg generated from this PR
nuspec-new

@thinkingserious thinkingserious added the status: code review request requesting a community code review or review from Twilio label Jun 17, 2019
@thinkingserious thinkingserious added difficulty: medium fix is medium in difficulty type: community enhancement feature request not on Twilio's roadmap labels Jun 28, 2019
@thinkingserious thinkingserious merged commit 56da7a9 into sendgrid:master Jun 28, 2019
@thinkingserious
Copy link
Contributor

Hello @jnyrup,

Thanks again for the PR!

We want to show our appreciation by sending you some swag. Could you please fill out this form so we can send it to you? Thanks!

Team SendGrid DX

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: medium fix is medium in difficulty status: code review request requesting a community code review or review from Twilio type: community enhancement feature request not on Twilio's roadmap
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mismatching dependencies between csproj and nuspec
2 participants