Devlooped.SponsorLink 1.1.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Devlooped.SponsorLink --version 1.1.0
NuGet\Install-Package Devlooped.SponsorLink -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Devlooped.SponsorLink" Version="1.1.0">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Devlooped.SponsorLink --version 1.1.0
#r "nuget: Devlooped.SponsorLink, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Devlooped.SponsorLink as a Cake Addin
#addin nuget:?package=Devlooped.SponsorLink&version=1.1.0

// Install Devlooped.SponsorLink as a Cake Tool
#tool nuget:?package=Devlooped.SponsorLink&version=1.1.0

Integrate GitHub Sponsors into your libraries so that users can be properly linked to their sponsorship to unlock features or simply get the recognition they deserve for supporting your project.

SponsorLink for .NET allows you to integrate sponsorship checks in the build process itself, without affecting IDE/Editor performance or command line/CI builds. Learn more about SponsorLink for open source developers and the onboarding process.

NOTE: this package is intended for package authors. Downstream package consumers should get it transitively automatically to support the SponsorLink checks.

Usage

Add the following analyzer to an analyzer project you include in your package:

using Devlooped;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;

namespace SponsorableLib;

[DiagnosticAnalyzer(LanguageNames.CSharp, LanguageNames.VisualBasic)]
class SponsorLinker : SponsorLink
{
    public SponsorLinker() : base("[SPONSORABLE]", "[PROJECT]") 
    { }
}

Replace SPONSORABLE with your sponsor account login and PROJECT with a recognizable name of your project or library (i.e. ThisAssembly or Moq). Optionally, use the base constructor overload receiving a SponsorLinkSettings which offers many options to customize the behavior of the analyzer.

Make sure you have installed the GitHub SponsorLink Admin app and have followed the onboarding steps.

We recommend using NuGetizer for packing your libraries, which provides the easiest integration with SponsorLink too. Simply add a project reference from your main library to the analyzer project and all packaging should Just Work. An example analyzer project referenced by your main library is typically just:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <PackFolder>analyzers/dotnet</PackFolder>
    <TargetFramework>netstandard2.0</TargetFramework>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="NuGetizer" Version="0.9.1" />
    <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" Pack="false" />
    <PackageReference Include="Devlooped.SponsorLink" Version="[VERSION]" />
  </ItemGroup>

</Project>

To only run the SponsorLink check when a consumer directly references you package, include a buildTransitive targets file with your package that surfaces the relevant package id to the analyzer:

<Project>
  <ItemGroup>
    <SponsorablePackageId Include="[YOUR_PACKAGE_ID]" />
  </ItemGroup>
</Project>

Learn more about SponsorLink NuGet integration.

How it works

When you ship a new version of your library including the above analyzer, the first build in an IDE/editor session will result in one of these three messages:

  1. User does not have the GitHub SponsorLink (user) app installed in his personal account. Warning SL02:

    Screenshot of build warning SL02 stating app is not installed

  2. User installed the app, but is not sponsoring the sponsorable account. Warning SL03:

    Screenshot of build warning SL04 stating user is not a sponsor

  3. User installed the app and is sponsoring:

    Screenshot of build info SL04 thanking the user user for sponsoring

NOTE: you can provide your own actions for the above scenarios, or simply configure the default behavior by tweaking the min/max amount of random waits introduced during builds. By default, the waits will range from 0 to 4000ms. Use to relevant constructor overload in combination with SponsorLinkSettings.Create() factory method to access all configurable options.

The goal of SponsorLink is to help make your project more sustainable, support your ongoing development and ensure your customers can depend on it in the long run!

Learn more about SponsorLink NuGet integration, in particular the section on properly packing to workaround the issue of forced transitiveness of analyzers in the .NET SDK.

Sponsors

Clarius Org C. Augusto Proiete Kirill Osenkov MFB Technologies, Inc. Stephen Shaw Torutek DRIVE.NET, Inc. David Kean alternate text is missing from this package README image Daniel Gnägi Ashley Medway Keith Pickford bitbonk Thomas Bolon Yurii Rashkovskii Kori Francis Zdenek Havlin Sean Killeen Toni Wenzel Giorgi Dalakishvili Kelly White Allan Ritchie Mike James Uno Platform Dan Siegel Reuben Swartz Jeremy Simmons Jacob Foshee alternate text is missing from this package README image Eric Johnson Norman Mackay Certify The Web Taylor Mansfield Mårten Rånge David Petric Rich Lee Danilo Dantas alternate text is missing from this package README image Gary Woodfine alternate text is missing from this package README image alternate text is missing from this package README image Steve Bilogan Ix Technologies B.V. New Relic

Sponsor this project  

Learn more about GitHub Sponsors

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Devlooped.SponsorLink:

Repository Stars
devlooped/nugetizer
A simple to understand packing model for authoring NuGet packages
Version Downloads Last updated