| <html> |
| <head> |
| <meta http-equiv="Content-Language" content="en-us"></meta> |
| <title>MSBuild Task</title> |
| </head> |
| |
| <body> |
| <h2><a name="dotnetexec">MSBuild</a></h2> |
| |
| <h3>Description</h3> |
| |
| <p>Runs the MSBuild build tool of Microsoft's .NET framework |
| 2.0.</p> |
| |
| <p>You can either use an existing build file or nest a build file |
| (snippet) as a child into the task. If you don't specify either, |
| MSBuild's default build file search algorithm will apply.</p> |
| |
| <h3>Parameters</h3> |
| <table border="1" cellpadding="2" cellspacing="0"> |
| <tr> |
| <td valign="top"><b>Attribute</b></td> |
| <td valign="top"><b>Description</b></td> |
| <td align="center" valign="top"><b>Required</b></td> |
| </tr> |
| <tr> |
| <td valign="top">buildfile</td> |
| <td valign="top">External build file to invoke MSBuild on.</td> |
| <td align="center">No.</td> |
| </tr> |
| <tr> |
| <td valign="top">vm</td> |
| <td valign="top">Same as <a |
| href="dotnetexec.html">dotnetexec</a>'s vm attribute. |
| Specify the framework to use.</td> |
| <td align="center">No.</td> |
| </tr> |
| </table> |
| |
| <h3>Parameters specified as nested elements</h3> |
| <h4>target</h4> |
| |
| <p><code>target</code> has a single required attribute name - |
| specifies a target to be run.</p> |
| |
| <h4>property</h4> |
| |
| <p><code>property</code> has two required attributes. name and |
| value that specify name and value of a property that is to be |
| defined in the MSBuild invocation.</p> |
| |
| <h4>build</h4> |
| |
| <p>This element allows no attributes. You can nest a MSBuild build |
| file into it and MSBuild will be executed on that. You can also nest |
| a build file snippet instead and Ant will wrap the necessary MSBuild |
| <code><Project> around it.</code></p> |
| |
| <h3>Examples</h3> |
| |
| <p>Let MSBuild search for a *.proj file in the (Ant) project's base |
| directory and execute the default target in it:</p> |
| |
| <pre><msbuild/></pre> |
| |
| <p>Let MSBuild execute the targets named foo and bar in the build |
| file msbuild.proj in Ant's basedir and pass the property |
| <code>/property:test=testvalue</code> to it:</p> |
| |
| <pre> |
| <msbuild buildfile="msbuild.proj"> |
| <target name="foo"/> |
| <target name="bar"/> |
| <property name="test" value="testvalue"/> |
| </msbuild> |
| </pre> |
| |
| <p>Define a build file embeded into the task, let MSBuild execute the |
| echo target of that build file.</p> |
| |
| <pre> |
| <msbuild> |
| <target name="echo"> |
| <build> |
| <Project DefaultTargets="empty" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| <Target Name="empty"/> |
| <Target Name="echo"> |
| <Message Text="This is MSBuild"/> |
| </Target> |
| </Project> |
| </build> |
| </msbuild> |
| </pre> |
| |
| <p>Run MSBuild's Message task:</p> |
| |
| <pre> |
| <msbuild> |
| <build> |
| <Message Text="This is MSBuild" |
| xmlns="http://schemas.microsoft.com/developer/msbuild/2003"/> |
| </build> |
| </msbuild> |
| </pre> |
| |
| <hr/> |
| <p align="center">Copyright © 2003-2005 The Apache Software Foundation. All rights Reserved.</p> |
| </body> |
| </html> |