2015-12-29 11:06:10 -08:00
. \" Automatically generated by Pandoc 1.15.1
. \"
.hy
2016-01-06 19:21:36 -08:00
.TH "dotnet-compiler" "1" "January 2016" "" ""
2015-12-29 11:06:10 -08:00
.SH NAME
.PP
dotnet\- compile \- \- Compiles source files for a single project to a
binary format and saves to a target file.
.SH SYNOPSIS
.PP
2016-01-04 18:25:15 -08:00
dotnet compile [\- \- native] [\- \- output] [\- \- temp\- output]
[\- \- framework] [\- \- configuration] [\- \- output] [\- \- arch] [\- \- cpp]
[\- ilc\- args] [\- \- verbose]
2015-12-29 11:06:10 -08:00
.SH DESCRIPTION
.PP
The compile command compiles source files from a single project to a
2016-01-04 18:25:15 -08:00
binary file, either intermmediate language (IL) byte code or native
machine code, depending on the options provided.
2015-12-29 11:06:10 -08:00
The default option is compilation to IL byte code, but may change in the
future.
Users who want to benefit from incremental builds and who want to
2016-01-04 18:25:15 -08:00
compile both the project and its dependencies should use the
dotnet\- build(1) command.
.PP
The result of compilation is by default an executable file that can be
ran.
Output files, are written to the child \f[C]bin\f[] folder, which will
be created if it doesn\[ aq]t exist.
Files will be overwritten as needed.
The temporary files that are created during compilation are placed in
the child \f[C]obj\f[] folder.
.PP
2015-12-29 11:06:10 -08:00
The executables also require a special configuration section in
project.json:
.IP
.nf
\f[C]
{\
\ \ \ \ "compilerOptions":\ {
\ \ \ \ \ \ "emitEntryPoints":\ true
\ \ \ \ }
}
\f[]
.fi
.PP
The default native [\- \- native] output is a native exe that conforms to
the architecture of the underlying operating system (i.e.
running on 64\- bit OS will produce a native 64\- bit exe).
This can be overriden via the \- \- arch switch and specifying the wanted
architecture.
The executable has a default extension of "" on Linux and OS X and
".exe" on Windows.
The source must include a static void main entry point, or it is an
error, unless otherwise specified in the project.json.
The dynamic library [dylib] output option has the default extension of
".so" on Linux/UNIX, ".dynlib" on OS X and ".dll" on Windows.
The static library [staticlib] option has the default extension of ".a"
on Linux, UNIX and OS X and ".lib" on Windows.
.PP
This command relies on the following artifacts: source files,
2016-01-04 18:25:15 -08:00
project.json project file and the "lock" file (project.lock.json).
Prior to invoking dotnet\- compile, dotnet\- restore(1) should be run to
restore any dependencies that are needed for the application.
.SH OPTIONS
2015-12-29 11:06:10 -08:00
.PP
2016-01-04 18:25:15 -08:00
\f[C]\-n,\ \-\-native\f[]
.IP
.nf
\f[C]
Compiles\ source\ to\ native\ machine\ code,\ for\ the\ local\ machine.\ The\ default\ is\ a\ native\ executable.\ The\ default\ executable\ extension\ is\ no\ extension\ and\ ".exe"\ on\ Windows.
\f[]
.fi
.PP
\f[C]\-t,\ \-\-temp\-output\ <PATH>\f[]
.IP
.nf
\f[C]
Path\ where\ to\ drop\ the\ temporary\ binaries\ that\ are\ produced\ during\ compile.\ By\ default,\ the\ temporary\ binaries\ are\ dropped\ in\ the\ `obj`\ directory\ in\ the\ directory\ where\ `project.json`\ files\ lives,\ that\ is,\ where\ the\ application\ lives.\ \
\f[]
.fi
.PP
\f[C]\-f,\ \-\-framework\ <FID>\f[]
.IP
.nf
\f[C]
Compile\ the\ application\ for\ the\ specified\ framework.\ If\ the\ framework\ is\ not\ specified,\ one\ specified\ in\ `project.json`\ will\ be\ used.\
\f[]
.fi
.PP
\f[C]\-c,\ \-\-configuration\ <CONFIGURATION>\f[]
.IP
.nf
\f[C]
Compile\ the\ application\ under\ the\ specified\ configuration.\ If\ not\ specified,\ the\ configuration\ will\ default\ to\ "Debug".\ \
\f[]
.fi
.PP
\f[C]\-o,\ \-\-output\ filename\f[]
.IP
.nf
\f[C]
Specifies\ the\ filename\ to\ be\ used.\ By\ default,\ the\ resulting\ filename\ will\ be\ the\ same\ as\ the\ project\ name\ specified\ in\ `project.json`,\ if\ one\ exists,\ or\ the\ directory\ in\ which\ the\ source\ files\ reside.\
\f[]
.fi
.PP
\f[C]\-\-no\-project\-dependencies\f[]
.IP
.nf
\f[C]
Skips\ building\ cross\- project\ references.\ The\ effect\ of\ this\ is\ that\ only\ the\ current\ project\ will\ be\ built.\
\f[]
.fi
.PP
\f[C]\-a,\ \-\-arch\f[]
.IP
.nf
\f[C]
The\ architecture\ for\ which\ to\ compile.\ x64\ only\ currently\ supported.
\f[]
.fi
.PP
\f[C]\-\-ilc\-args\ <ARGS>\f[]
.IP
.nf
\f[C]
Specified\ parameters\ are\ passed\ through\ to\ ILC\ and\ are\ used\ by\ the\ engine\ when\ doing\ native\ compilation.\
\f[]
.fi
.PP
\f[C]\-\-cpp\f[]
.IP
.nf
\f[C]
Specify\ the\ C++\ code\ generator\ to\ do\ native\ compilation\ of\ code\ instead\ of\ the\ default\ RyuJIT.\ \ \ \ \ \ \
\f[]
.fi
.PP
\f[C]\-v,\ \-\-verbose\f[]
.IP
.nf
\f[C]
Prints\ verbose\ logging\ information,\ to\ follow\ the\ flow\ of\ execution\ of\ the\ command.
\f[]
.fi
.PP
\f[C]\-h,\ \-\-help\f[]
.IP
.nf
\f[C]
Show\ short\ help.\
\f[]
.fi
.SH ENVIRONMENT
.PP
\f[C]DOTNET_HOME\f[]
.IP
.nf
\f[C]
2016-01-06 19:21:36 -08:00
Points\ to\ the\ base\ directory\ that\ contains\ the\ runtime\ and\ the\ binaries\ directories.\ The\ runtime\ will\ be\ used\ to\ run\ the\ executable\ file\ that\ is\ dropped\ after\ compiling.\ Not\ needed\ for\ native\ compilation.\ \
2016-01-04 18:25:15 -08:00
\f[]
.fi
.SH SEE ALSO
.PP
dotnet\- restore(1), dotnet\- publish(1), dotnet(1)
.SH AUTHORS
2016-01-06 19:21:36 -08:00
Zlatko Knezevic zlakne\@ microsoft.com.