Introduction
Plugins are how you can extend the functionality of GetSetUp either for yourself, others, or your company.
What is a Plugin?
Functionally
From a functionality perspective, a plugin is a collection of "checks" that are related in some way.
In the open-source world, where plugins are created for other developers to consume, these checks should be focused around a specific piece of technology; for example, the GetSetUp team maintain opensource plugins for tools like .Net and Node.js.
In enterprise environments, plugins are often focused on the specificities of products or services; for example a company might make a plugin dedicated to their own internal infrastructure.
Practically
From a practical standpoint, a plugin is a NuGet package containing .NET code that provides implementations to the interfaces
exposed from the GetSetUp.Plugin.Abstractions NuGet package.
The GetSetUp CLI then consumes these NuGet packages, based on a project's configuration file, and runs the appropriate checks
to ensure that the user has everything they need in order to work with the project as hand.
Getting Started
Create a new .NET Class Library project and add the GetSetUp.Plugin.Abstractions
NuGet package.
dotnet new classlib -o MyPlugin
dotnet add package GetSetUp.Plugin.Abstractions
Create your plugin class
The GetSetUp CLI will discover your plugin by looking for classes that implement the IGetSetUpPlugin interface.
using GetSetUp.Plugin.Abstractions;
namespace MyGetSetUpPlugin;
public class MyPlugin : IGetSetUpPlugin
{
public string Name => "My Plugin";
public string ConfigurationSectionName => "MyPlugin";
public void ConfigureServices(IConfiguration configuration, IServiceCollection services)
{
}
}
- The
Nameproperty is a friendly name for your plugin that will be displayed in the GetSetUp CLI. - The
ConfigurationSectionNameproperty is the name of the GetSetUp config file that is dedicated to your plugin. - The
ConfigureServicesmethod is where you can register any services that your plugin needs to function as well as the checks themselves.
See the next page on the creation of checks and how to implement functionality in your plugin.