In order to build .NET Command Line Interface, you need the following installed on you machine.
- Visual Studio 2015 with Web Development Tools
- Beta8 is available here and should work: http://www.microsoft.com/en-us/download/details.aspx?id=49442
- Install
WebToolsExtensionsVS14.msiandDotNetVersionManager-x64.msi
- Install
- CMake (available from https://cmake.org/) on the PATH.
- git (available from http://www.git-scm.com/) on the PATH.
- CMake (available from https://cmake.org/) is required to build the native host
corehost. Make sure to add it to the PATH. - git (available from http://www.git-scm.com/) on the PATH.
- clang (available from http://clang.llvm.org) on the PATH.
- Xcode
- CMake (available from https://cmake.org/) on the PATH.
- git (available from http://www.git-scm.com/) on the PATH.
- Run
build.cmdorbuild.shfrom the root depending on your OS. - Use
artifacts/{os}-{arch}/stage2/dotnetto try out thedotnetcommand. You can also addartifacts/{os}-{arch}/stage2to the PATH if you want to rundotnetfrom anywhere.
cd test\TestAppdotnet run
##Adding a Command
The dotnet CLI considers any executable on the path named dotnet-{commandName} to be a command it can call out to. dotnet publish, for example, is added to the path as an executable called dotnet-publish. To add a new command we must create the executable and then add it to the distribution packages for installation.
- Create an issue on https://github.com/dotnet/cli and get consensus on the need for and behavior of the command.
- Add a new project for the command.
- Add the project to Microsoft.DotNet.Cli.sln
- Create a Readme.md for the command.
- Add the project to the build scripts.
- Add the project to the packaging scripts.
Start by copying an existing command, like /src/Microsoft.DotNet.Tools.Init. Change the last part of the project name, .Init in this case, to the name of your command.
Update the Name property in project.json as well, but use the dotnet-{command} syntax here.
Make sure to use the System.CommandLine parser so behavior is consistant across commands.
Each command's project root should contain a manpage-style Readme.md that describes the usage of the command. See other commands for reference.
- Add the project to
/scripts/build/build-stage.ps1
- Add the project name to the
$Projectslist
- Add the project to
/scripts/build/build-stage.sh
- Add the project name to the
PROJECTSlist
- run build from the root directory and make sure your project is producing binaries in /artifacts/
- Update the
symlinksproperty ofpackaging/debian/debian_config.jsonto include the new command - Update the
$Projectsproperty inpackaging/osx/scripts/postinstall