LivingDocGen.MSBuild
1.0.3
dotnet add package LivingDocGen.MSBuild --version 1.0.3
NuGet\Install-Package LivingDocGen.MSBuild -Version 1.0.3
<PackageReference Include="LivingDocGen.MSBuild" Version="1.0.3"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="LivingDocGen.MSBuild" Version="1.0.3" />
<PackageReference Include="LivingDocGen.MSBuild"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add LivingDocGen.MSBuild --version 1.0.3
#r "nuget: LivingDocGen.MSBuild, 1.0.3"
#:package LivingDocGen.MSBuild@1.0.3
#addin nuget:?package=LivingDocGen.MSBuild&version=1.0.3
#tool nuget:?package=LivingDocGen.MSBuild&version=1.0.3
LivingDocGen.MSBuild
LivingDocGen.MSBuild is the MSBuild integration layer for LivingDocGen. It is distributed as the NuGet package LivingDocGen.MSBuild.
🎯 Purpose
This project provides the automatic integration with the .NET build and test process. When installed in a test project, it ensures that living documentation is generated automatically whenever tests are run.
📦 NuGet Package
- Package ID:
LivingDocGen.MSBuild - Description: Automatic living documentation generator for BDD test projects.
⚙️ How It Works
- Hooks into Build/Test: The package includes MSBuild
.targetsfiles (LivingDocGen.targets) that inject tasks into the build pipeline. - Executes CLI: It bundles the
LivingDocGen.CLItool and executes it against the project's output. - Zero Configuration: By default, it scans the project output for feature files and test results and generates
living-documentation.html.
🔧 Configuration
You can configure the behavior using MSBuild properties in your .csproj file or by using a livingdocgen.json file in your project root.
Option 1: Configuration File (Recommended)
Create a livingdocgen.json file in your project root:
{
"enabled": true,
"autoGenerate": "AfterTest",
"paths": {
"features": "./Features",
"testResults": "./TestResults",
"output": "./living-documentation.html"
},
"documentation": {
"title": "My Project - Living Documentation",
"theme": "purple",
"primaryColor": "#9333ea"
},
"advanced": {
"verbose": false,
"includeSkipped": true,
"includePending": true
}
}
The MSBuild integration will automatically detect and use this file if it exists.
Option 2: MSBuild Properties
If no livingdocgen.json file is found, you can configure using MSBuild properties in your .csproj:
<PropertyGroup>
<LivingDocConfigFile>$(ProjectDir)custom-config.json</LivingDocConfigFile>
<LivingDocEnabled>true</LivingDocEnabled>
<LivingDocOutput>$(OutputPath)docs/index.html</LivingDocOutput>
<LivingDocTitle>My Project Specs</LivingDocTitle>
<LivingDocTheme>blue</LivingDocTheme>
</PropertyGroup>
Priority Order:
- If
LivingDocConfigFileexists → use config file - If
livingdocgen.jsonexists in project root → use it - Otherwise → use MSBuild properties
🏗 Development
This project is responsible for:
- Packaging the
LivingDocGen.CLIbinaries into thetools/folder of the NuGet package. - Defining the MSBuild targets (
LivingDocGen.targets) that run the tool.
Build Process
The .csproj contains a custom target CopyBDDCliToTools that copies the CLI build artifacts before packing.
<Target Name="CopyBDDCliToTools" BeforeTargets="_GetPackageFiles">
</Target>
📝 Todo List
- Add conditional execution based on test run success/failure.
- Improve error reporting when CLI execution fails.
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
This package is not used by any popular GitHub repositories.