Incrementalist 1.0.0-rc1

This is a prerelease version of Incrementalist.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Incrementalist --version 1.0.0-rc1
                    
NuGet\Install-Package Incrementalist -Version 1.0.0-rc1
                    
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="Incrementalist" Version="1.0.0-rc1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Incrementalist" Version="1.0.0-rc1" />
                    
Directory.Packages.props
<PackageReference Include="Incrementalist" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Incrementalist --version 1.0.0-rc1
                    
#r "nuget: Incrementalist, 1.0.0-rc1"
                    
#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.
#:package Incrementalist@1.0.0-rc1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Incrementalist&version=1.0.0-rc1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Incrementalist&version=1.0.0-rc1&prerelease
                    
Install as a Cake Tool

🔄 Incrementalist

<img src="https://raw.githubusercontent.com/petabridge/Incrementalist/refs/heads/dev/docs/incrementalist-logo-dark.svg" width="90" alt="Incrementalist Logo" />

Incrementalist is a .NET tool that leverages libgit2sharp and Roslyn to compute incremental build steps for large .NET solutions. It helps optimize your CI/CD pipeline by building and testing only the projects affected by your changes.

🎯 When to Use Incrementalist

Incrementalist is particularly valuable for:

  • 🏗️ Large Solutions: If your solution contains dozens or hundreds of projects, Incrementalist can significantly reduce build times by only building what's necessary.
  • 📦 Monorepos: When managing multiple applications or services in a single repository, Incrementalist helps identify and build only the affected components.
  • 🌐 Microservice Architectures: In repositories containing multiple microservices, build only the services impacted by your changes.
  • 🔗 Complex Dependencies: When projects have intricate dependencies, Incrementalist automatically determines the complete build graph.
  • CI/CD Optimization: Reduce CI/CD pipeline execution time by skipping unnecessary builds and tests.

⚙️ Requirements

  • .NET 8.0 SDK or later
  • Git installed and available in the system PATH

📥 Installation

Incrementalist is available in two forms:

  1. Incrementalist Library - a .NET 8 library for programmatic use
  2. Incrementalist.Cmd - a dotnet tool for command-line use (recommended)

Install the command-line tool globally:

dotnet tool install --global Incrementalist.Cmd

Or install locally in your project:

# From your repository root
dotnet new tool-manifest # if you haven't already created a .config/dotnet-tools.json
dotnet tool install Incrementalist.Cmd

Running as a Global Tool

When installed globally, run commands directly using the incrementalist command:

# Get list of affected projects
incrementalist -b dev -f ./affected-projects.txt

# Run tests for affected projects
incrementalist -b dev -r -- test -c Release --no-build --nologo

# Run tests for affected projects those matching a glob
incrementalist -b dev -r --target-glob "src/*.Tests.csproj" -- test -c Release

Running as a Local Tool

When using Incrementalist as a local tool, you need to use dotnet tool run with an additional -- before the Incrementalist commands:

# Get list of affected projects
dotnet tool run incrementalist -- -b dev -f ./affected-projects.txt

# Build affected projects
dotnet tool run incrementalist -- -b dev -r -- build -c Release --nologo

# Run tests with coverage
dotnet tool run incrementalist -- -b dev -r -- test -c Release --no-build --logger:trx --collect:"XPlat Code Coverage" --results-directory ./testresults

# Run in parallel mode
dotnet tool run incrementalist -- -b dev -r --parallel -- build -c Release --nologo

# Save affected projects AND run commands
dotnet tool run incrementalist -- -b dev -f ./affected-projects.txt -r -- build -c Release --nologo

Note the command structure when using as a local tool:

  • First -- after dotnet tool run incrementalist is for Incrementalist options
  • Second -- (if using -r) is for the dotnet command to run on affected projects

📄 Configuration Files

Incrementalist supports JSON configuration files to store commonly used settings. This eliminates the need to specify the same command-line arguments repeatedly.

# Use default configuration file (.incrementalist/incrementalist.json)
incrementalist -r -- build

# Specify a custom configuration file
incrementalist -c my-config.json -r -- build

Create a configuration file in your repository:

{
  "gitBranch": "master",
  "solutionFilePath": "src/MySolution.sln",
  "verbose": true,
  "runInParallel": true
}

Command-line arguments take precedence over configuration file settings. See Configuration Documentation for complete details.

🚀 Quick Start Examples

# Get list of affected projects and save to file
incrementalist -b dev -f ./affected-projects.txt

# Specify solution explicitly
incrementalist -s ./src/MySolution.sln -b dev -f ./affected-projects.txt

# Get list of affected folders
incrementalist -b dev -l -f ./affected-folders.txt

# Build only affected projects
incrementalist -b dev -r -- build -c Release --nologo

# Run tests for affected projects
incrementalist -b dev -r -- test -c Release --no-build --nologo

# Only include test projects in the final list
incrementalist -b dev --target-glob "**/*.Tests.csproj" -f ./affected-test-projects.txt

# Exclude test projects from the final list
incrementalist -b dev --skip-glob "**/*.Tests.csproj" -f ./affected-non-test-projects.txt

# Run tests with code coverage
incrementalist -b dev -r -- test -c Release --no-build --nologo /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=./coverage/

# Save affected projects AND run commands
incrementalist -b dev -f ./affected-projects.txt -r -- build -c Release --nologo

# Create configuration file with current settings (default path: .incrementalist/incrementalist.json)
incrementalist -b dev --verbose --parallel --create-config

# Create configuration file with current settings and custom file name
incrementalist -b dev --verbose --parallel --create-config -c ./my-incrementalist-config.json

# Run incrementalist with a custom configuration file
incrementalist -c ./my-incrementalist-config.json -r -- build -c Release

📄 Output Files

Incrementalist can generate two types of output files using -f, --file:

  1. Project Lists (default):

    D:\src\Project1\Project1.csproj,D:\src\Project2\Project2.csproj
    
  2. Folder Lists (with -l, --folders-only):

    D:\src\Project1,D:\src\Project2\SubFolder
    

These files can be used in build scripts, CI/CD pipelines, or other automation tools.

🛠️ Command-Line Options

  -s, --sln             Optional. Solution file to analyze. Uses first .sln in
                        current directory if not specified.

  -f, --file            Optional. Write output to the specified file.

  -l, --folders-only    Optional. List affected folders instead of projects.

  -b, --branch          Optional. (Default: dev) Git branch to compare against
                        (e.g., 'dev' or 'master').

  -d, --dir             Optional. Working directory. Defaults to current directory.

  --verbose             Optional. (Default: false) Enable debug logging.

  -t, --timeout         Optional. (Default: 2) Solution load timeout in minutes.

  -r, --run             Optional. Run dotnet CLI command against affected projects.
                        All arguments after -- are passed to dotnet.

  --continue-on-error   Optional. (Default: true) Continue executing commands even
                        if some fail.

  --parallel            Optional. (Default: false) Execute commands in parallel.

  --fail-on-no-projects Optional. (Default: false) Fail if no projects are affected.

  --no-cache            Optional. (Default: false) Ignore any existing cache file
                        and perform a full Roslyn analysis.
                        
  -c, --config          Optional. Path to the configuration file. Defaults to 
                        .incrementalist/incrementalist.json in the current directory.

  --skip-glob           Optional. Glob pattern to exclude projects from the final
                        list. Applied after analyzing dependencies. Can be used
                        multiple times.
                        
  --target-glob         Optional. Glob pattern to include only matching projects in
                        the final list. Applied after analyzing dependencies. Can
                        be used multiple times.

  --create-config       Optional. Create a new configuration file with current 
                        options. See docs/config.md for details.

  --help                Display help screen.

  --version             Display version information.

⚡ Running Commands

Execute dotnet CLI commands against affected projects:

# Build affected projects
incrementalist -b dev -r -- build -c Release --nologo

# Run tests
incrementalist -b dev -r -- test -c Release --no-build --nologo

# Run in parallel
incrementalist -b dev -r --parallel -- build -c Release --nologo

# Stop on first error
incrementalist -b dev -r --continue-on-error=false -- build -c Release --nologo

🌐 Filtering Projects with Glob Patterns

After Incrementalist determines the initial set of affected projects based on Git changes and project dependencies, you can further refine this list using glob patterns.

  • --target-glob "<pattern>": Only includes projects whose paths match the specified glob pattern(s). If multiple patterns are provided, a project matching any of them will be included. This filter is applied first.
  • --skip-glob "<pattern>": Excludes projects whose paths match the specified glob pattern(s) from the list remaining after any --target-glob filters have been applied. If multiple patterns are provided, a project matching any of them will be excluded.

Both options can be specified multiple times on the command line.

Example: Find all affected projects, but only run the build command on non-test projects within the src directory.

incrementalist -b dev --target-glob "src/**/*.csproj" --skip-glob "**/*.Tests.csproj" -r -- build -c Release --nologo

📚 Documentation

📜 License

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0

Copyright 2015-2025 Petabridge

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0-beta1 237 5/12/2025
1.0.0 160 4/18/2025
1.0.0-rc5 196 4/17/2025
1.0.0-rc4 191 4/17/2025
1.0.0-rc3 175 4/16/2025
1.0.0-rc2 211 4/14/2025
1.0.0-rc1 194 4/13/2025
1.0.0-beta4 96 2/25/2025
1.0.0-beta3 96 2/25/2025
1.0.0-beta2 98 2/24/2025
1.0.0-beta1 102 2/21/2025
0.9.0 310 11/22/2023
0.8.0 529 11/24/2022
0.7.0 548 5/24/2022
0.6.0 460 11/10/2021
0.5.0 472 6/16/2021
0.4.0 467 12/23/2020
0.3.0 661 9/26/2020
0.2.2 598 2/14/2020
0.2.1 600 11/18/2019
0.2.0 596 10/29/2019
0.1.7 635 9/9/2019
0.1.6 589 8/30/2019
0.1.5 646 8/30/2019
0.1.4 660 5/17/2019
0.1.3 671 5/15/2019
0.1.2 656 5/8/2019
0.1.1 647 5/8/2019

Added major new features to enhance usability and extend capabilities:

* **File-based Configuration**: Added support for `.incrementalist.yml` configuration files. Store common settings and project filters in a single file rather than passing command-line arguments. Example: `incrementalist -c .incrementalist.yml` loads all settings from the file.

* **File Globbing Support**: Added file globbing pattern support for command execution. Target files using glob patterns for selective builds or testing. Example: `incrementalist -b dev -r --glob "**/*.Tests.csproj" -- test` runs tests only on affected test projects.

* **`.slnx` Support**: Added support for [modern Visual Studio solution files](https://devblogs.microsoft.com/dotnet/introducing-slnx-support-dotnet-cli/) (`.slnx`). Incrementalist now properly processes these files alongside standard `.sln` files, enabling better integration with Visual Studio's "Open Folder" feature.

All changes:

* [Enable `Nullability` and `TreatWarningsAsErrors`](https://github.com/petabridge/Incrementalist/pull/372)
* [Added support for file globbing commands](https://github.com/petabridge/Incrementalist/pull/371)
* [Added `.slnx` support](https://github.com/petabridge/Incrementalist/pull/370)
* [Solution cleanup](https://github.com/petabridge/Incrementalist/pull/369)
* [Disable caching](https://github.com/petabridge/Incrementalist/pull/367)
* [File-based configuration format](https://github.com/petabridge/Incrementalist/pull/357)
* [Bump Microsoft.Extensions.Logging.Console from 9.0.3 to 9.0.4](https://github.com/petabridge/Incrementalist/pull/364)
* [Bump Microsoft.Build.Locator from 1.7.8 to 1.9.1](https://github.com/petabridge/Incrementalist/pull/362)
* [Bump Microsoft.Extensions.Logging from 9.0.2 to 9.0.3](https://github.com/petabridge/Incrementalist/pull/361)
* [Bump Microsoft.Extensions.Logging.Console from 9.0.2 to 9.0.3](https://github.com/petabridge/Incrementalist/pull/360)
* [Bump NuGet.ProjectModel from 6.13.1 to 6.13.2](https://github.com/petabridge/Incrementalist/pull/359)