Update dotnet manpages for Unix
This commit is contained in:
parent
2e9c0b7b06
commit
b828418021
24 changed files with 3294 additions and 537 deletions
|
@ -1,96 +1,195 @@
|
|||
.\" Automatically generated by Pandoc 1.15.1
|
||||
.\" Automatically generated by Pandoc 2.1.3
|
||||
.\"
|
||||
.TH "dotnet build command \- .NET Core CLI" "1" "" "" ".NET Core"
|
||||
.hy
|
||||
.TH "DOTNET\-BUILD" "1" "April 2016" "" ""
|
||||
.SS NAME
|
||||
.SH dotnet\-build
|
||||
.PP
|
||||
dotnet\-build \-\- Builds a project and all of its dependencies
|
||||
.SS SYNOPSIS
|
||||
.SH NAME
|
||||
.PP
|
||||
\f[C]dotnet\ build\ [\-\-output]\ \ \ \ \ \ \ [\-\-build\-base\-path]\ [\-\-framework]\ \ \ \ \ \ \ [\-\-configuration]\ \ [\-\-runtime]\ [\-\-version\-suffix]\ \ \ \ \ [\-\-build\-profile]\ \ [\-\-no\-incremental]\ [\-\-no\-dependencies]\ \ \ \ \ [<project>]\f[]
|
||||
.SS DESCRIPTION
|
||||
.PP
|
||||
The \f[C]dotnet\ build\f[] command builds multiple source file from a
|
||||
source project and its dependencies into a binary.
|
||||
The binary will be in Intermediate Language (IL) by default and will
|
||||
have a DLL extension.
|
||||
\f[C]dotnet\ build\f[] will also drop a \f[C]\\*.deps\f[] file which
|
||||
outlines what the host needs to run the application.
|
||||
.PP
|
||||
Building requires the existence of a lock file, which means that you
|
||||
have to run \f[C]dotnet\ restore\f[] (dotnet-restore.md) prior to
|
||||
building your code.
|
||||
.PP
|
||||
Before any compilation begins, the build verb analyzes the project and
|
||||
its dependencies for incremental safety checks.
|
||||
If all checks pass, then build proceeds with incremental compilation of
|
||||
the project and its dependencies; otherwise, it falls back to
|
||||
non\-incremental compilation.
|
||||
Via a profile flag, users can choose to receive additional information
|
||||
on how they can improve their build times.
|
||||
.PP
|
||||
All projects in the dependency graph that need compilation must pass the
|
||||
following safety checks in order for the compilation process to be
|
||||
incremental: \- not use pre/post compile scripts \- not load compilation
|
||||
tools from PATH (for example, resgen, compilers) \- use only known
|
||||
compilers (csc, vbc, fsc)
|
||||
.PP
|
||||
In order to build an executable application, you need a special
|
||||
configuration section in your project.json file:
|
||||
\f[C]dotnet\ build\f[] \- Builds a project and all of its dependencies.
|
||||
.SH SYNOPSIS
|
||||
.SS .NET Core 2.x
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
{\
|
||||
\ \ \ \ "compilerOptions":\ {
|
||||
\ \ \ \ \ \ "emitEntryPoint":\ true
|
||||
\ \ \ \ }
|
||||
}
|
||||
dotnet\ build\ [<PROJECT>]\ [\-c|\-\-configuration]\ [\-f|\-\-framework]\ [\-\-force]\ [\-\-no\-dependencies]\ [\-\-no\-incremental]
|
||||
\ \ \ \ [\-\-no\-restore]\ [\-o|\-\-output]\ [\-r|\-\-runtime]\ [\-v|\-\-verbosity]\ [\-\-version\-suffix]
|
||||
dotnet\ build\ [\-h|\-\-help]
|
||||
\f[]
|
||||
.fi
|
||||
.SS .NET Core 1.x
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
dotnet\ build\ [<PROJECT>]\ [\-c|\-\-configuration]\ [\-f|\-\-framework]\ [\-\-no\-dependencies]\ [\-\-no\-incremental]\ [\-o|\-\-output]
|
||||
\ \ \ \ [\-r|\-\-runtime]\ [\-v|\-\-verbosity]\ [\-\-version\-suffix]
|
||||
dotnet\ build\ [\-h|\-\-help]
|
||||
\f[]
|
||||
.fi
|
||||
.SS OPTIONS
|
||||
.PP
|
||||
\f[C]\-o\f[], \f[C]\-\-output\f[] [DIR]
|
||||
* * * * *
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
Directory in which to place the built binaries.
|
||||
The \f[C]dotnet\ build\f[] command builds the project and its dependencies into a set of binaries.
|
||||
The binaries include the project's code in Intermediate Language (IL) files with a \f[I].dll\f[] extension and symbol files used for debugging with a \f[I].pdb\f[] extension.
|
||||
A dependencies JSON file (\f[I]*.deps.json\f[]) is produced that lists the dependencies of the application.
|
||||
A \f[I]*.runtimeconfig.json\f[] file is produced, which specifies the shared runtime and its version for the application.
|
||||
.PP
|
||||
\f[C]\-b\f[], \f[C]\-\-build\-base\-path\f[] [DIR]
|
||||
If the project has third\-party dependencies, such as libraries from NuGet, they're resolved from the NuGet cache and aren't available with the project's built output.
|
||||
With that in mind, the product of \f[C]dotnet\ build\f[] isn't ready to be transferred to another machine to run.
|
||||
This is in contrast to the behavior of the .NET Framework in which building an executable project (an application) produces output that's runnable on any machine where the .NET Framework is installed.
|
||||
To have a similar experience with .NET Core, you need to use the dotnet publish command.
|
||||
For more information, see .NET Core Application Deployment.
|
||||
.PP
|
||||
Directory in which to place temporary outputs.
|
||||
Building requires the \f[I]project.assets.json\f[] file, which lists the dependencies of your application.
|
||||
The file is created when \f[C]dotnet\ restore\f[] is executed.
|
||||
Without the assets file in place, the tooling cannot resolve reference assemblies, which results in errors.
|
||||
With .NET Core 1.x SDK, you needed to explicitily run the \f[C]dotnet\ restore\f[] before running \f[C]dotnet\ build\f[].
|
||||
Starting with .NET Core 2.0 SDK, \f[C]dotnet\ restore\f[] runs implicitily when you run \f[C]dotnet\ build\f[].
|
||||
If you want to disable implicit restore when running the build command, you can pass the \f[C]\-\-no\-restore\f[] option.
|
||||
.PP
|
||||
\f[C]\-f\f[], \f[C]\-\-framework\f[] [FRAMEWORK]
|
||||
.PP
|
||||
\f[C]dotnet\ build\f[] uses MSBuild to build the project; thus, it supports both parallel and incremental builds.
|
||||
Refer to Incremental Builds for more information.
|
||||
.PP
|
||||
In addition to its options, the \f[C]dotnet\ build\f[] command accepts MSBuild options, such as \f[C]/p\f[] for setting properties or \f[C]/l\f[] to define a logger.
|
||||
Learn more about these options in the MSBuild Command\-Line Reference.
|
||||
.PP
|
||||
Whether the project is executable or not is determined by the \f[C]<OutputType>\f[] property in the project file.
|
||||
The following example shows a project that will produce executable code:
|
||||
.IP
|
||||
.nf
|
||||
\f[C]
|
||||
<PropertyGroup>
|
||||
\ \ <OutputType>Exe</OutputType>
|
||||
</PropertyGroup>
|
||||
\f[]
|
||||
.fi
|
||||
.PP
|
||||
In order to produce a library, omit the \f[C]<OutputType>\f[] property.
|
||||
The main difference in built output is that the IL DLL for a library doesn't contain entry points and can't be executed.
|
||||
.SS Arguments
|
||||
.PP
|
||||
\f[C]PROJECT\f[]
|
||||
.PP
|
||||
The project file to build.
|
||||
If a project file is not specified, MSBuild searches the current working directory for a file that has a file extension that ends in \f[I]proj\f[] and uses that file.
|
||||
.SH OPTIONS
|
||||
.SS .NET Core 2.x
|
||||
.PP
|
||||
\f[C]\-c|\-\-configuration\ {Debug|Release}\f[]
|
||||
.PP
|
||||
Defines the build configuration.
|
||||
The default value is \f[C]Debug\f[].
|
||||
.PP
|
||||
\f[C]\-f|\-\-framework\ <FRAMEWORK>\f[]
|
||||
.PP
|
||||
Compiles for a specific framework.
|
||||
The framework needs to be defined in the project.json file.
|
||||
The framework must be defined in the project file.
|
||||
.PP
|
||||
\f[C]\-c\f[], \f[C]\-\-configuration\f[] [Debug|Release]
|
||||
\f[C]\-\-force\f[]
|
||||
.PP
|
||||
Defines a configuration under which to build.
|
||||
If omitted, it defaults to Debug.
|
||||
Forces all dependencies to be resolved even if the last restore was successful.
|
||||
This is equivalent to deleting the \f[I]project.assets.json\f[] file.
|
||||
.PP
|
||||
\f[C]\-r\f[], \f[C]\-\-runtime\f[] [RUNTIME_IDENTIFIER]
|
||||
\f[C]\-h|\-\-help\f[]
|
||||
.PP
|
||||
Target runtime to build for.
|
||||
Prints out a short help for the command.
|
||||
.PP
|
||||
\-\-version\-suffix [VERSION_SUFFIX]
|
||||
\f[C]\-\-no\-dependencies\f[]
|
||||
.PP
|
||||
Defines what \f[C]*\f[] should be replaced with in the version field in
|
||||
the project.json file.
|
||||
The format follows NuGet\[aq]s version guidelines.
|
||||
.PP
|
||||
\f[C]\-\-build\-profile\f[]
|
||||
.PP
|
||||
Prints out the incremental safety checks that users need to address in
|
||||
order for incremental compilation to be automatically turned on.
|
||||
Ignores project\-to\-project (P2P) references and only builds the root project specified to build.
|
||||
.PP
|
||||
\f[C]\-\-no\-incremental\f[]
|
||||
.PP
|
||||
Marks the build as unsafe for incremental build.
|
||||
This turns off incremental compilation and forces a clean rebuild of the
|
||||
project dependency graph.
|
||||
This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.
|
||||
.PP
|
||||
\f[C]\-\-no\-restore\f[]
|
||||
.PP
|
||||
Doesn't perform an implicit restore during build.
|
||||
.PP
|
||||
\f[C]\-o|\-\-output\ <OUTPUT_DIRECTORY>\f[]
|
||||
.PP
|
||||
Directory in which to place the built binaries.
|
||||
You also need to define \f[C]\-\-framework\f[] when you specify this option.
|
||||
.PP
|
||||
\f[C]\-r|\-\-runtime\ <RUNTIME_IDENTIFIER>\f[]
|
||||
.PP
|
||||
Specifies the target runtime.
|
||||
For a list of Runtime Identifiers (RIDs), see the RID catalog.
|
||||
.PP
|
||||
\f[C]\-v|\-\-verbosity\ <LEVEL>\f[]
|
||||
.PP
|
||||
Sets the verbosity level of the command.
|
||||
Allowed values are \f[C]q[uiet]\f[], \f[C]m[inimal]\f[], \f[C]n[ormal]\f[], \f[C]d[etailed]\f[], and \f[C]diag[nostic]\f[].
|
||||
.PP
|
||||
\f[C]\-\-version\-suffix\ <VERSION_SUFFIX>\f[]
|
||||
.PP
|
||||
Defines the version suffix for an asterisk (\f[C]*\f[]) in the version field of the project file.
|
||||
The format follows NuGet's version guidelines.
|
||||
.SS .NET Core 1.x
|
||||
.PP
|
||||
\f[C]\-c|\-\-configuration\ {Debug|Release}\f[]
|
||||
.PP
|
||||
Defines the build configuration.
|
||||
The default value is \f[C]Debug\f[].
|
||||
.PP
|
||||
\f[C]\-f|\-\-framework\ <FRAMEWORK>\f[]
|
||||
.PP
|
||||
Compiles for a specific framework.
|
||||
The framework must be defined in the project file.
|
||||
.PP
|
||||
\f[C]\-h|\-\-help\f[]
|
||||
.PP
|
||||
Prints out a short help for the command.
|
||||
.PP
|
||||
\f[C]\-\-no\-dependencies\f[]
|
||||
.PP
|
||||
Ignores project\-to\-project references and only builds the root project
|
||||
specified to build.
|
||||
Ignores project\-to\-project (P2P) references and only builds the root project specified to build.
|
||||
.PP
|
||||
\f[C]\-\-no\-incremental\f[]
|
||||
.PP
|
||||
Marks the build as unsafe for incremental build.
|
||||
This turns off incremental compilation and forces a clean rebuild of the project's dependency graph.
|
||||
.PP
|
||||
\f[C]\-o|\-\-output\ <OUTPUT_DIRECTORY>\f[]
|
||||
.PP
|
||||
Directory in which to place the built binaries.
|
||||
You also need to define \f[C]\-\-framework\f[] when you specify this option.
|
||||
.PP
|
||||
\f[C]\-r|\-\-runtime\ <RUNTIME_IDENTIFIER>\f[]
|
||||
.PP
|
||||
Specifies the target runtime.
|
||||
For a list of Runtime Identifiers (RIDs), see the RID catalog.
|
||||
.PP
|
||||
\f[C]\-v|\-\-verbosity\ <LEVEL>\f[]
|
||||
.PP
|
||||
Sets the verbosity level of the command.
|
||||
Allowed values are \f[C]q[uiet]\f[], \f[C]m[inimal]\f[], \f[C]n[ormal]\f[], \f[C]d[etailed]\f[], and \f[C]diag[nostic]\f[].
|
||||
.PP
|
||||
\f[C]\-\-version\-suffix\ <VERSION_SUFFIX>\f[]
|
||||
.PP
|
||||
Defines the version suffix for an asterisk (\f[C]*\f[]) in the version field of the project file.
|
||||
The format follows NuGet's version guidelines.
|
||||
.PP
|
||||
* * * * *
|
||||
.SH EXAMPLES
|
||||
.PP
|
||||
Build a project and its dependencies:
|
||||
.PP
|
||||
\f[C]dotnet\ build\f[]
|
||||
.PP
|
||||
Build a project and its dependencies using Release configuration:
|
||||
.PP
|
||||
\f[C]dotnet\ build\ \-\-configuration\ Release\f[]
|
||||
.PP
|
||||
Build a project and its dependencies for a specific runtime (in this example, Ubuntu 16.04):
|
||||
.PP
|
||||
\f[C]dotnet\ build\ \-\-runtime\ ubuntu.16.04\-x64\f[]
|
||||
.PP
|
||||
Build the project and use the specified NuGet package source during the restore operation (.NET Core SDK 2.0 and later versions):
|
||||
.PP
|
||||
\f[C]dotnet\ build\ \-\-source\ c:\\packages\\mypackages\f[]
|
||||
.SH AUTHORS
|
||||
Microsoft Corporation dotnetclifeedback\@microsoft.com.
|
||||
mairaw.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue