dotnet-subset 0.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet tool install --global dotnet-subset --version 0.1.0                
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 dotnet-subset --version 0.1.0                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=dotnet-subset&version=0.1.0                
nuke :add-package dotnet-subset --version 0.1.0                

dotnet-subset

dotnet-subset is a .NET tool that copies a subset of files from a repository to a directory.

The tool is mainly used in Dockerfiles to optimize the docker build caching for "dotnet restore" instructions.

Motivation

To learn more about the motivation behind dotnet-subset, please read the related blog post.

Installation

From NuGet

dotnet tool install --global dotnet-subset

From source

Prerequisite: .NET SDK 6

  1. Clone this repository
  2. Open a terminal in the repository's root
  3. dotnet pack --configuration Release
  4. dotnet tool install dotnet-subset --global --add-source ./artifacts/Release/nupkg/dotnet-subset/

Usage

Description:
  Create a subset for the restore operation

Usage:
  dotnet-subset restore <project> [options]

Arguments:
  <project>  Project or solution to restore

Options:
  --root-directory <root-directory> (REQUIRED)  Directory from where the files will be copied
  --output <output> (REQUIRED)                  Directory where the subset files will be copied, preserving the
                                                original structure.

Example:

dotnet subset restore /source/complexapp/complexapp.csproj --root-directory /source/ --output /tmp/restore_subset/

dotnet-subset + docker

Please check this pull request on how to use dotnet-subset in your Dockerfile: https://github.com/othmane-kinane-nw/dotnet-docker/pull/1/files?diff=split&w=0

Roadmap

  • Add tests
  • Automate the versionning
  • Automate the deployment to NuGet
  • Refactor the codebase
  • Add "build" algorithm

License

Copyright © Nimbleways, Othmane Kinane and contributors.

dotnet-subset is provided as-is under the MIT license. For more information see LICENSE.

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

This package has no dependencies.

Version Downloads Last updated
0.3.2 707,987 1/28/2023
0.3.1 70,799 11/25/2022
0.3.0 12,152 9/11/2022
0.2.0 1,503 9/5/2022
0.1.0 1,457 8/26/2022