Modules Overview
A module is a NuGet package that adds reusable functionality to an Atom build — targets, parameters, service registrations, or workflow options.
How Modules Work
Modules are typically distributed as interfaces. Your build definition implements the interface, and the source
generator + [ConfigureHostBuilder] attribute wire everything up automatically:
[BuildDefinition]
[GenerateEntryPoint]
internal partial class Build : WorkflowBuildDefinition, IGitVersion, IAzureKeyVault
{
// All targets and parameters from IGitVersion and IAzureKeyVault
// are automatically available.
}
Adding a Module
Install the NuGet package:
dotnet add package DecSm.Atom.Module.GitVersionImplement the module's interface on your build class:
internal partial class Build : BuildDefinition, IGitVersion { }That's it. The module's services are registered, its targets are discoverable, and its parameters appear in help output.
First-Party Modules
| Package | Interface | Description |
|---|---|---|
DecSm.Atom.Module.Dotnet |
(various) | .NET CLI helpers (build, test, pack, publish) |
DecSm.Atom.Module.GithubWorkflows |
IGithubWorkflows |
GitHub Actions workflow writer and helpers |
DecSm.Atom.Module.DevopsWorkflows |
IDevopsWorkflows |
Azure DevOps Pipelines workflow writer and helpers |
DecSm.Atom.Module.AzureKeyVault |
IAzureKeyVault |
Azure Key Vault secrets provider |
DecSm.Atom.Module.AzureStorage |
IAzureArtifactStorage |
Azure Blob Storage artifact provider |
DecSm.Atom.Module.GitVersion |
IGitVersion |
GitVersion-based build ID and version providers |
Module Conventions
- Modules expose their functionality through interfaces that extend
IBuildAccessor. - Targets are defined as
Targetproperties on the interface with default implementations. - Parameters are declared with
[ParamDefinition]or[SecretDefinition]. - Service registration uses the
[ConfigureHostBuilder]attribute with a static partialConfigureBuildermethod. - Build options are extended via the static
BuildOptionsclass using extension-like patterns.
Next Steps
→ Individual module pages: .NET · GitHub Workflows · DevOps Workflows · Azure Key Vault · Azure Storage · GitVersion