Git Product home page Git Product logo

dnt's Introduction

DNT (DotNetTools)

Command line tools to manage .NET Core and Standard projects and solutions

NuGet Version npm

Experimental: Command and parameter names may change

Globally install via NPM (.NET 4.6.2 and .NET Core 2.1+)

npm i -g dotnettools

Install .NET Core global tool (.NET Core 2.1+ only, not working yet):

dotnet tool install -g dnt

Uninstall

npm uninstall -g dotnettools
dotnet tool uninstall -g dnt

Package Commands

By default, all commands search in the current directory for all *.csproj files and apply the command to all of them. The targeted projects or solutions can be changed with the /path:MyProject.csproj parameter.

To list all currently selected projects, call:

dnt list-projects

dnt list-projects /path:MySolution.sln

install-packages

Installs a NuGet package in the selected projects.

Command:

dnt install-packages PackageToInstall [TargetPackageVersion] [/path:ProjectDirectoryPath]

Parameters:

  • PackageToInstall
  • TargetPackageVersion
  • ProjectDirectoryPath

update-packages

Updates NuGet packages in the selected projects.

Command:

dnt update-packages PackagesToUpdate [TargetPackageVersion] [/path:ProjectDirectoryPath]

Parameters:

  • PackagesToUpdate: The package ID to update, also supports * wildcards
  • TargetPacketVersion: The targeted package version (default: latest)
  • ProjectDirectoryPath

Samples:

Update the Newtonsoft.Json packages in the selected projects to version 10.0.1:

dnt update-packages Newtonsoft.Json 10.0.1

Update all packages in the selected projects to the latest version:

dnt update-packages *

Update all packages which start with MyPackages. to version 2.1.0 in the selected projects:

dnt update-packages MyPackages.* 2.1.0

bump-version

Increases or changes the package version of the selected projects.

Command:

dnt bump-version major|minor|patch [/major:number] [/minor:number] [/patch:number] [/path:ProjectDirectoryPath]

Parameters:

TBD

Samples:

Bump the minor version of all selected projects by 1:

dnt bump-version minor

Set the patch version of all selected projects to 18:

dnt bump-version patch /patch:18

switch-to-projects

Switches from NuGet package references to local project references for refactorings, debugging, etc.

This is NuGetReferenceSwitcher for .NET Core/Standard.

Idea: https://github.com/rsuter/NuGetReferenceSwitcher/wiki/Guide

Create njs-switch.dnt file and specify the solution to look for projects, and the NuGet packages to replace with actual projects. The involved projects are only specified by the solution path in the settings file:

(here we create a switcher file for NSwag which references libraries of NJsonSchema to work on both projects in a single solution)

{
  "solution": "NSwag.sln",
  "mappings": {
    "NJsonSchema": {
      "path": "../../NJsonSchema/src/NJsonSchema/NJsonSchema.csproj"
    },
    "NJsonSchema.CodeGeneration": {
      "path": "../../NJsonSchema/src/NJsonSchema.CodeGeneration/NJsonSchema.CodeGeneration.csproj"
    },
    "NJsonSchema.CodeGeneration.CSharp": {
      "path": "../../NJsonSchema/src/NJsonSchema.CodeGeneration.CSharp/NJsonSchema.CodeGeneration.CSharp.csproj"
    },
    "NJsonSchema.CodeGeneration.TypeScript": {
      "path": "../../NJsonSchema/src/NJsonSchema.CodeGeneration.TypeScript/NJsonSchema.CodeGeneration.TypeScript.csproj"
    }
  }
}

Then switch to projects in the solution:

dnt switch-to-projects njs-switch.dnt

Now all NJsonSchema package references in the NSwag solution are now replaced by local project references and the NJsonSchema projects added to the solution.

switch-to-packages

After implementing and testing, switch back to NuGet references:

dnt switch-to-packages njs-switch.dnt

Solution Commands

create-solution

TBD

dnt's People

Contributors

ricosuter avatar

Watchers

James Cloos avatar Alexander Blair avatar Matthew Little avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.