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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.</p>
  15. <h3>Parameters</h3>
  16. <table border="1" cellpadding="2" cellspacing="0">
  17. <tr>
  18. <td valign="top"><b>Attribute</b></td>
  19. <td valign="top"><b>Description</b></td>
  20. <td align="center" valign="top"><b>Required</b></td>
  21. </tr>
  22. <tr>
  23. <td valign="top">buildfile</td>
  24. <td valign="top">External build file to invoke MSBuild on.</td>
  25. <td align="center">No.</td>
  26. </tr>
  27. <tr>
  28. <td valign="top">vm</td>
  29. <td valign="top">Same as <a
  30. href="dotnetexec.html">dotnetexec</a>'s vm attribute.
  31. Specify the framework to use.</td>
  32. <td align="center">No.</td>
  33. </tr>
  34. </table>
  35. <h3>Parameters specified as nested elements</h3>
  36. <h4>target</h4>
  37. <p><code>target</code> has a single required attribute name -
  38. specifies a target to be run.</p>
  39. <h4>property</h4>
  40. <p><code>property</code> has two required attributes. name and
  41. value that specify name and value of a property that is to be
  42. defined in the MSBuild invocation.</p>
  43. <h4>build</h4>
  44. <p>This element allows no attributes. You can nest a MSBuild build
  45. file into it and MSBuild will be executed on that. You can also nest
  46. a build file snippet instead and Ant will wrap the necessary MSBuild
  47. <code>&lt;Project&gt; around it.</code></p>
  48. <h3>Examples</h3>
  49. <p>Let MSBuild search for a *.proj file in the (Ant) project's base
  50. directory and execute the default target in it:</p>
  51. <pre>&lt;msbuild/&gt;</pre>
  52. <p>Let MSBuild execute the targets named foo and bar in the build
  53. file msbuild.proj in Ant's basedir and pass the property
  54. <code>/property:test=testvalue</code> to it:</p>
  55. <pre>
  56. &lt;msbuild buildfile="msbuild.proj"&gt;
  57. &lt;target name="foo"/&gt;
  58. &lt;target name="bar"/&gt;
  59. &lt;property name="test" value="testvalue"/&gt;
  60. &lt;/msbuild&gt;
  61. </pre>
  62. <p>Define a build file embeded into the task, let MSBuild execute the
  63. echo target of that build file.</p>
  64. <pre>
  65. &lt;msbuild&gt;
  66. &lt;target name="echo"&gt;
  67. &lt;build&gt;
  68. &lt;Project DefaultTargets="empty"&gt;
  69. &lt;Target Name="empty"/&gt;
  70. &lt;Target Name="echo"&gt;
  71. &lt;Task Name="Echo" Message="This is MSBuild"/&gt;
  72. &lt;/Target&gt;
  73. &lt;/Project&gt;
  74. &lt;/build&gt;
  75. &lt;/msbuild&gt;
  76. </pre>
  77. <p>Run MSBuild's Echo task (if there actually is one):</p>
  78. <pre>
  79. &lt;msbuild&gt;
  80. &lt;build&gt;
  81. &lt;Task Name="Echo" Message="This is MSBuild"/&gt;
  82. &lt;/build&gt;
  83. &lt;/msbuild&gt;
  84. </pre>
  85. <hr/>
  86. <p align="center">Copyright &copy; 2003-2004 The Apache Software Foundation. All rights Reserved.</p>
  87. </body>
  88. </html>