3 xbuild \- Mono's tool to build MSBuild project files
6 [option] [project-file]
8 xbuild can be used to build MSBuild project files. Integrated Development
9 Environments like MonoDevelop and "Microsoft Visual Studio .NET" use msbuild
12 xbuild takes the path of the project or solution file to build, as the main argument.
13 If no file is specified then it tries to build any solution file or project file in
14 the current directory, that has a *proj extension.
18 List of targets to build
20 .B \//property:Name=Value
21 Set or override project properties
24 Custom logger to log build events
26 .B \//toolsversion:version , /tv:version
27 Specify the toolset version to use.
30 This would cause 4.0 version of the Microsoft.Common.targets (among others) to be used. This overrides
31 the value specified in a project file.
33 Valid values: 2.0, 3.0, 3.5 and 4.0
35 .B \//verbosity:<level>
36 Logger verbosity level : quiet, minimal, normal, detailed, diagnostic
39 Validate the project file against the schema
41 .B \//validate:<schema>
42 Validate the project file against the specified schema
44 .B \//consoleloggerparameters:<params>
45 Parameters for the console logger : PerfomanceSummary, NoSummary, NoItemAndPropertyList
48 Don't show the initial xbuild banner
54 Display xbuild version
55 .SH ENVIRONMENT VARIABLES
57 .I "XBUILD_EMIT_SOLUTION"
58 If this variable is set, then the project file generated from a solution
61 .I "XBUILD_LOG_REFERENCE_RESOLVER"
62 References are resolved by trying a list of assembly search paths ($(AssemblySearchPaths)).
63 If xbuild is unable to resolve a reference, then it logs details of why the various
64 search paths failed. If this variable is set, then it logs the same even for references
65 that were resolved successfully. These logs show up if the verbosity is set to detailed
68 .I "MSBuildExtensionsPath"
69 MSBuild extensions are usually installed in $(MSBuildExtensionsPath), which xbuild resolves
70 to $prefix/lib/mono/xbuild . When used in Import, like:
72 <Import Project="$(MSBuildExtensionsPath)\\TestTargets.targets"/>
74 xbuild tries various values for the msbuild property $(MSBuildExtensionsPath), in order:
76 1. Paths specified in the environment variable $MSBuildExtensionsPath.
77 2. /Library/Frameworks/Mono.framework/External/xbuild on Mac OSX.
78 3. $XDG_CONFIG_HOME/xbuild/tasks (or Environment.SpecialFolder.ApplicationData)
79 4. $prefix/lib/mono/xbuild (default location)
81 Anywhere else in the project files, $(MSBuildExtensionsPath) will always resolve to the default
82 location. This is a xbuild-only feature.
83 This is also applicable for the properties $(MSBuildExtensionsPath32) and $(MSBuildExtensionsPath64),
84 and the environment variables have the corresponding names - MSBuildExtensionsPath32/64 .
86 .I "XBUILD_FRAMEWORK_FOLDERS_PATH"
87 With ToolsVersion 4.0, projects can target arbitrary frameworks referenced by TargetFrameworkMoniker,
88 which is of the format:
90 Identifier,Version=<version>[,Profile=<profile>]
92 Eg. ".NETFramework,Version=v4.0"
94 The 3 parts of the moniker are given by the msbuild properties:
96 $(TargetFrameworkIdentifier), $(TargetFrameworkVersion) and $(TargetFrameworkProfile)
98 This moniker maps to a framework description file on disk:
100 <framework_root>/Identifier/Version/[Profile]/RedistList/FrameworkList.xml
102 This file is used to determine the path where to find the framework assemblies for this particular framework.
104 Framework root here is configurable and is resolved in the following order:
107 1. Paths specified in the environment variable $XBUILD_FRAMEWORK_FOLDERS_PATH
108 2. /Library/Frameworks/Mono.framework/External/xbuild-frameworks on Mac OSX.
109 3. MSBuild property $(TargetFrameworkRoot)
110 4. $prefix/lib/mono/xbuild-frameworks (default location)
113 XBuild tries the paths given above, in order, till it finds a FrameworkList.xml for the moniker.
114 Running with /v:detailed or higher verbosity will show the various paths that it tries.
116 The FrameworkList.xml itself just has a root element like:
118 <FileList Name=".NET Framework 3.5" TargetFrameworkDirectory="..\\..\\..\\..\\3.5" IncludeFramework="v3.0">
121 Here the TargetFrameworkDirectory attribute specifies the directory where the assemblies for
122 this particular framework can be found. If this is not set, then the parent of the folder
123 containing the xml file is taken as the framework directory.
125 IncludeFramework attribute specifies the version of a framework (under the *same* $(TargetFrameworkIdentifier))
126 which should be included in the final list of Target framework directories.
130 If this variable is set, it contains a string of the form
131 "type=foreground,type=.." that specifies which color to use to display
132 errors/warnings etc on some terminals. Type here can be:
135 errors, warnings, messages or events
137 events: These are project/target/task start and end event
142 The possible colors for foreground are:
143 .B black, red, brightred, green, brightgreen, yellow, brightyellow,
144 blue, brightblue, magenta, brightmagenta, cyan, brightcyan, grey,
145 white and brightwhite.
148 For example, you could set this variable from your shell:
151 XBUILD_COLORS=errors=brightred,warnings=blue
155 You can disable the built-in color scheme by setting this variable to
159 On Mac OSX, for locating pkg-config (.pc) files, xbuild additionally
160 looks in "/Library/Frameworks/Mono.framework/External/pkgconfig" .
165 Copyright (C) 2009 Novell, Inc (http://www.novell.com)
167 Visit http://lists.ximian.com/mailman/listinfo/mono-devel-list for details.
169 Visit: http://www.mono-project.com for details