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.

nant.html 3.1 KiB

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