ProjectDiff.Tool 0.0.11-preview.0.2

Suggested Alternatives

dotnet-proj-diff

This is a prerelease version of ProjectDiff.Tool.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet tool install --global ProjectDiff.Tool --version 0.0.11-preview.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local ProjectDiff.Tool --version 0.0.11-preview.0.2
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=ProjectDiff.Tool&version=0.0.11-preview.0.2&prerelease
                    
nuke :add-package ProjectDiff.Tool --version 0.0.11-preview.0.2
                    

dotnet-proj-diff

NuGet Version GitHub License

Documentation

dotnet-proj-diff identifies added, modified, and deleted projects between Git references, making it particularly useful for CI/CD pipelines to determine which projects need to be rebuilt or tested.

Heavily inspired by dotnet-affected

Installation

# Install globally
dotnet tool install --global ProjectDiff.Tool

# Or install locally
dotnet new tool-manifest # if you don't have one
dotnet tool install ProjectDiff.Tool

Usage

Description:
  Calculate which projects in a solution has changed since a specific commit

Usage:
  ProjectDiff.Tool [<solution>] [options]

Arguments:
  <solution>  Path to solution file to derive projects from

Options:
  -?, -h, --help                                                     Show help and usage information
  --version                                                          Show version information
  --base, --base-ref (REQUIRED)                                      Base git reference to compare against, if not specified 'HEAD' will be used [default: HEAD]
  --head, --head-ref                                                 Head git reference to compare against. If not specified current working tree will be used
  --merge-base                                                       If true instead of using --base use the merge base of --base and --head as the --base reference, if --head is not specified 'HEAD' will be used [default: True]
  --include-deleted                                                  If true deleted projects will be included in output [default: False]
  --include-modified                                                 If true modified projects will be included in output [default: True]
  --include-added                                                    If true added projects will be included in output [default: True]
  --include-referencing                                              if true  projects referencing modified/deleted/added projects will be included in output [default: True]
  --absolute-paths                                                   Output absolute paths, if not specified paths will be relative to the working directory. Or relative to --output if specified. This option will not affect slnf format as this requires relative paths [default: False]
  -f, --format <Json|Plain|Slnf|Traversal>                           Output format, if --output is specified format will be derived from file extension. Otherwise this defaults to 'plain'
  -o, --out, --output                                                Output file, if not set stdout will be used
  --ignore-changed-file                                              Ignore changes in specific files. If these files are a part of the build evaluation process they will still be evaluated, however these files will be considered unchanged by the diff process []
  --log-level <Critical|Debug|Error|Information|None|Trace|Warning>  Set the log level for the command. [default: Information]

The cli should have some sensible defaults, so you can run it without any arguments and get a list of projects that have changed in the working tree and are available to build.

Examples

# Get all projects in a solution that have changed since the last commit in 'main'
dotnet-proj-diff MySolution.sln --base main
# Get all projects that have changed in working tree, including deleted projects
dotnet-proj-diff --base HEAD --include-deleted
# Get all changed projects between two branches
dotnet-proj-diff --base main --head feature/new-feature

# Test all projects that have changed in working tree
dotnet-proj-diff --base HEAD | dotnet test

# Test all changed test projects in test/ directory
dotnet-proj-diff | grep 'test/' | dotnet test

CI/CD Integration examples

GitHub Actions

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 is compatible.  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.

This package has no dependencies.