dotnet-installer/src/dotnet/commands/dotnet-build
Zlatko Knezevic c83a2fb6f9 Add and modify commands' README files (#2338)
* Add and modify commands' README files

Update those READMEs that are outdated. Add READMEs for dotnet pack
and dotnet restore as well.

* Removing private info, adding feedback alias
2016-04-15 10:36:31 -07:00
..
BuilderCommandApp.cs Add --no-dependency flag to build 2016-02-10 15:35:27 -08:00
CompileContext.cs re-restore test projects at their destination 2016-04-13 17:56:51 -07:00
IncrementalPreconditions.cs Add --no-dependency flag to build 2016-02-10 15:35:27 -08:00
Program.cs Remove DOTNET_HOME from the CoreCLR probe path 2016-02-12 17:03:09 -08:00
ProjectDependenciesFacade.cs ensure dotnet-build can see projects under packages 2016-04-13 17:56:50 -07:00
README.md Add and modify commands' README files (#2338) 2016-04-15 10:36:31 -07:00

% DOTNET-BUILD(1) % Microsoft Corporation dotnetclifeedback@microsoft.com % April 2016

NAME

dotnet-build -- builds a project and all of its' dependencies

SYNOPSIS

dotnet-build [--output]
[--build-base-path] [--framework]
[--configuration] [--runtime] [--version-suffix] [--build-profile] [--no-incremental] [--no-dependencies] [< project >]

DESCRIPTION

dotnet-build builds multiple source file from a source project and its dependencies into a binary. The binary will be in Intermmidiate Language (IL) by default and will have a DLL extension. dotnet-build will also drop a *.deps file which outlines what the runner needs to run the application.

Building requires an existence of a lock file which means that a dotnet-restore call needs to happen previous to building.

Before any compilation begins, the build verb analyzes the project and its dependencies for incremental safety checks. If all checks clear out, 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.

All the 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 (e.g., resgen, compilers)
  • use only known compilers (csc, vbc, fsc)

In order to build an executable application (console application), you need a special configuration section in project.json:

{ 
    "compilerOptions": {
      "emitEntryPoint": true
    }
}

Class libraries do not need this special piece of configuration.

OPTIONS

-o, --output [DIR]

Directory in which to place the built binaries.

-b, --build-base-path [DIR]

Directory in which to place temporary outputs

-f, --framework [FRAMEWORK]

Compile for a specific framework. The framework needs to be defined in the project.json file.

-c, --configuration [CONFIGURATION]

Configuration under which to build. If omitted defaults to "Debug". Possible configuration options are:

* Debug
* Release 

-r, --runtime [RUNTIME_IDENTIFIER]

Target runtime to build for.

--version-suffix [VERSION_SUFFIX]

Defines what * should be replaced with in the version field in project.json.

--build-profile

Prints out the incremental safety checks that users need to address in order for incremental compilation to be automatically turned on.

--no-incremental

Marks the build as unsafe for incremental build. This turns off incremental compilation and forces a clean rebuild of the project dependency graph.

--no-dependencies

Ignore project-to-project references and only build the root project specified to build.