You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

msbuild.html 3.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us"></meta>
  4. <title>MSBuild Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="dotnetexec">MSBuild</a></h2>
  8. <h3>Description</h3>
  9. <p>Runs the MSBuild build tool presented at the 2003 PDC. This
  10. task is completely untested as the developers have no access to
  11. the tool, it has been implemented by looking at the docs only.</p>
  12. <p>You can either use an existing build file or nest a build file
  13. (snippet) as a child into the task. If you don't specify either,
  14. MSBuild's default build file search algorithm will apply. Nesting
  15. build file snippets is most probably not working correctly.</p>
  16. <h3>Parameters</h3>
  17. <table border="1" cellpadding="2" cellspacing="0">
  18. <tr>
  19. <td valign="top"><b>Attribute</b></td>
  20. <td valign="top"><b>Description</b></td>
  21. <td align="center" valign="top"><b>Required</b></td>
  22. </tr>
  23. <tr>
  24. <td valign="top">buildfile</td>
  25. <td valign="top">External build file to invoke MSBuild on.</td>
  26. <td align="center">No.</td>
  27. </tr>
  28. <tr>
  29. <td valign="top">vm</td>
  30. <td valign="top">Same as <a
  31. href="dotnetexec.html">dotnetexec</a>'s vm attribute.
  32. Specify the framework to use.</td>
  33. <td align="center">No.</td>
  34. </tr>
  35. </table>
  36. <h3>Parameters specified as nested elements</h3>
  37. <h4>target</h4>
  38. <p><code>target</code> has a single required attribute name -
  39. specifies a target to be run.</p>
  40. <h4>property</h4>
  41. <p><code>property</code> has two required attributes. name and
  42. value that specify name and value of a property that is to be
  43. defined in the MSBuild invocation.</p>
  44. <h4>build</h4>
  45. <p>This element allows no attributes. You can nest a MSBuild build
  46. file into it and MSBuild will be executed on that. You can also nest
  47. a build file snippet instead and Ant will wrap the necessary MSBuild
  48. <code>&lt;Project&gt; around it.</code></p>
  49. <h3>Examples</h3>
  50. <p>Let MSBuild search for a *.proj file in the (Ant) project's base
  51. directory and execute the default target in it:</p>
  52. <pre>&lt;msbuild/&gt</pre>
  53. <p>Let MSBuild execute the targets named foo and bar in the build
  54. file msbuild.proj in Ant's basedir and pass the property
  55. <code>/property:test=testvalue</code> to it:</p>
  56. <pre>
  57. &lt;msbuild buildfile="msbuild.proj"&gt;
  58. &lt;target name="foo"/&gt;
  59. &lt;target name="bar"/&gt;
  60. &lt;property name="test" value="testvalue"/&gt;
  61. &lt;/msbuild&gt;
  62. </pre>
  63. <p>Define a build file embeded into the task, let MSBuild execute the
  64. echo target of that build file.</p>
  65. <pre>
  66. &lt;msbuild&gt;
  67. &lt;target name="echo"&gt;
  68. &lt;build&gt;
  69. &lt;Project DefaultTargets="empty"&gt;
  70. &lt;Target Name="empty"/&gt;
  71. &lt;Target Name="echo"&gt;
  72. &lt;Task Name="Echo" Message="This is MSBuild"/&gt;
  73. &lt;/Target&gt;
  74. &lt;/Project&gt;
  75. &lt;/build&gt;
  76. &lt;/msbuild&gt;
  77. </pre>
  78. <p>Run MSBuild's Echo task (if there actually is one):</p>
  79. <pre>
  80. &lt;msbuild&gt;
  81. &lt;build&gt;
  82. &lt;Task Name="Echo" Message="This is MSBuild"/&gt;
  83. &lt;/build&gt;
  84. &lt;/msbuild&gt;
  85. </pre>
  86. <hr/>
  87. <p align="center">Copyright &copy; 2003 Apache Software Foundation. All rights Reserved.</p>
  88. </body>
  89. </html>