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.

dotnet.html 9.3 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. <html>
  2. <head>
  3. <title>.NET Tasks</title>
  4. </head>
  5. <h1>.NET tasks</h1>
  6. <h2>Introduction</h2>
  7. Ant support for .NET goes back to before .NET was released, and
  8. continues to be expanded based on user demand. Users writing nothing but
  9. a .NET application, may want to look at the .NET-based
  10. <A href="http://nant.sourceforge.net/">NAnt</A> project, that supports
  11. both the Microsoft and the Ximian managed <A
  12. href="http://go-mono.com/">Mono</A> project's implementation of the
  13. .NET framework.
  14. <p>
  15. Over time, the .NET tasks in Ant have tended to evolve to meet a few
  16. limited needs. Firstly, developers working with complex deployment problems may
  17. want to use ant to use the fairly advanced deployment tasks Ant ships
  18. with. Secondly, anyone who has a cross-platform project can use these
  19. tasks to cover the .NET side of the problem. Here, cross-platform can
  20. mean more than just Java and .NET: the C++ tasks in the ant-contrib
  21. project on sourceforge can be used with Ant to do native C++ and .NET
  22. cross development if that is your need. Finally, Ant support for .NET
  23. lets one automate .NET development under an automated build process,
  24. such as AntHill or Cruise Control.
  25. <p>
  26. What this means is that the Ant tasks for .NET support do not get as
  27. much rigorous use as the Java tools, and are evolving more slowly -that
  28. includes the time for support calls to change. But as a consequence,
  29. developers working on .NET support have more freedom to play around with
  30. the code. It also means that the fairly unusual set of tasks supported
  31. by ant enable a few interesting operations that can not be performed any
  32. other way:
  33. <ol>
  34. <li>Integrating with a Java based SOAP Service -generating C# code from
  35. the server's WSDL and running it against the server.
  36. </li>
  37. <li>Building and deploying a C#-based Web Service, then using the Apache
  38. Axis tasks to create JUnit tests to call the endpoints.
  39. <li>Patching .NET type libraries to work with more complex IDL than the
  40. basic &lt;importtypelib&gt; wrapper around tlbimport supports. Hence the
  41. disassembler and the reassembler.
  42. </li>
  43. </ol>
  44. Needless to say, possible does not mean easy.
  45. <A href="http://www.manning.com/hatcher/chap15.pdf">Chapter 15</A> of
  46. Java Development with Ant covers the first of these, using the Ant1.5
  47. version of the tasks. Going the other way -generating Java client
  48. code and JUnit testcases is covered in
  49. <A href="http://www.iseran.com/Steve/papers/interop/">The Wondrous curse
  50. of Interop</A>. The final trick, IDL and Typelib abuse, is not
  51. documented as we do not want to encourage such an ugly practise. It,
  52. can, however, be done if absolutely necessary.
  53. <h2>Task List</h2>
  54. <table border="0" >
  55. <tr>
  56. <td><a href="csc.html">Csc</a></td>
  57. <td>Compiles C# code</td>
  58. </tr>
  59. <tr>
  60. <td><a href="vbc.html">vbc</a></td>
  61. <td>Compiles VB.Net code</td>
  62. </tr>
  63. <tr>
  64. <td><a href="jsharp.html">jsharp</a></td>
  65. <td>Compiles J# files</td>
  66. </tr>
  67. <tr>
  68. <td><a href="ildasm.html">ildasm</a></td>
  69. <td>Disassembles .NET executables and libraries</td>
  70. </tr>
  71. <tr>
  72. <td><a href="ilasm.html">ilasm</a></td>
  73. <td>Assembles .il files</td>
  74. </tr>
  75. <tr>
  76. <td><a href="wsdltodotnet.html">WsdlToDotnet</a></td>
  77. <td>Generates .NET code (C# or VB) from a WSDL file</td>
  78. </tr>
  79. <tr>
  80. <td><a href="ImportTypelib.html">ImportTypelib .html</a></td>
  81. <td>Imports a COM type library into .NET</td>
  82. </tr>
  83. </table>
  84. <hr>
  85. <h2> Change Log </h2>
  86. <h4>Ant1.6</h4>
  87. This revision goes along with NET 1.1, though there is no reason why
  88. it should not work on other versions.
  89. <p>
  90. <ol>
  91. <li>vbc task</li>
  92. <li>jsharp task</li>
  93. <li>mono support</li>
  94. <li>ilasm</li>
  95. <li>tlbimport</li>
  96. <li>Reference filesets in the compiler tasks</li>
  97. <li>definitions in the compiler tasks</li>
  98. <li>multiple source filesets in the compiler tasks. If these are used, the
  99. implicit fileset is disabled</li>
  100. </ol>
  101. The compile tasks: vbc, jsharp, and csc, all contain lots of common code
  102. in a shared base class: if you can use one you should be able to use
  103. another.
  104. <h4>Ant 1.5</h4>
  105. This revision goes along with NET 1.0 (SP1)
  106. <ol>
  107. <li>CSC: added filealign</li>
  108. <li>CSC: added reference to office.dll</li>
  109. <li>CSC: dependency checking! only if destFile is set!
  110. <li>WsdlToDotnet written
  111. </ol>
  112. <h4>Version 0.4</h4>
  113. This is the beta-2 revision of the tasks.
  114. <ol>
  115. <li>ILASM: pulled the owner attribute, added keyfile for giving binaries a strong name
  116. (MD5 hash of the checksum)</li>
  117. <li>CSC: added win32res , noConfig, utf8output, fullpaths</li>
  118. <li>CSC: </li>
  119. </ol>
  120. <h4>Version 0.3</h4>
  121. The changes here reflect Beta-1 of the dotnet SDK and experience of use in
  122. more complex projects. This build does not work with the older SDK,
  123. primarily because the automatic reference feature references libraries
  124. only found in the new SDK version.
  125. <p>
  126. External changes</p>
  127. <ul>
  128. <li>Recursive inclusion of .cs and .il files</li>
  129. <li>Documentation enhanced, includes examples and details of all parameters</li>
  130. <li>The csc task automatically includes the common dotnet assemblies, so
  131. there is no need to remember to refer to 'System.dll', 'System.Web.Services',
  132. etc. This feature can be disabled by setting the 'includeDefaultReferences'
  133. flag to false. </li>
  134. <li> References can also be referred to using the ReferenceFiles parameter, which
  135. is an ant path specification. The old 'references' string is still retained.</li>
  136. <li> An 'extraoptions' attribute enables the build file to include any CSC options
  137. which are not explicitly supported in the CSC task. </li>
  138. </ul>
  139. Internal changes
  140. <ul>
  141. <li>Some minor refactoring (move common code a method)</li>
  142. <li>Application of Jedits JavaStyle task resulted in a major reshaping of
  143. the codebase and the insertion of a blank line every second line. Significant
  144. effort was required to revert some (but not all) changes.</li>
  145. <li>Removed throws clause from methods which can't throw exception<hr>
  146. <h2> Change Log </h2>
  147. <h4>Ant1.6</h4>
  148. This revision goes along with NET 1.1, though there is no reason why
  149. it should not work on other versions.
  150. <p>
  151. <ol>
  152. <li>vbc task</li>
  153. <li>jsharp task</li>
  154. <li>mono support</li>
  155. <li>ilasm</li>
  156. <li>tlbimport</li>
  157. <li>Reference filesets in the compiler tasks</li>
  158. <li>definitions in the compiler tasks</li>
  159. <li>multiple source filesets in the compiler tasks. If these are used, the
  160. implicit fileset is disabled</li>
  161. </ol>
  162. The compile tasks: vbc, jsharp, and csc, all contain lots of common code
  163. in a shared base class: if you can use one you should be able to use
  164. another.
  165. <h4>Version 0.5</h4>
  166. This revision goes along with NET 1.0 (SP1)
  167. <ol>
  168. <li>CSC: added filealign</li>
  169. <li>CSC: added reference to office.dll</li>
  170. <li>CSC: dependency checking! only if destFile is set!
  171. <li>WsdlToDotnet written
  172. </ol>
  173. <h4>Version 0.4</h4>
  174. This is the beta-2 revision of the tasks.
  175. <ol>
  176. <li>ILASM: pulled the owner attribute, added keyfile for giving binaries a strong name
  177. (MD5 hash of the checksum)</li>
  178. <li>CSC: added win32res , noConfig, utf8output, fullpaths</li>
  179. <li>CSC: </li>
  180. </ol>
  181. <h4>Version 0.3</h4>
  182. The changes here reflect Beta-1 of the dotnet SDK and experience of use in
  183. more complex projects. This build does not work with the older SDK,
  184. primarily because the automatic reference feature references libraries
  185. only found in the new SDK version.
  186. <p>
  187. External changes</p>
  188. <ul>
  189. <li>Recursive inclusion of .cs and .il files</li>
  190. <li>Documentation enhanced, includes examples and details of all parameters</li>
  191. <li>The csc task automatically includes the common dotnet assemblies, so
  192. there is no need to remember to refer to 'System.dll', 'System.Web.Services',
  193. etc. This feature can be disabled by setting the 'includeDefaultReferences'
  194. flag to false. </li>
  195. <li> References can also be referred to using the ReferenceFiles parameter, which
  196. is an ant path specification. The old 'references' string is still retained.</li>
  197. <li> An 'extraoptions' attribute enables the build file to include any CSC options
  198. which are not explicitly supported in the CSC task. </li>
  199. </ul>
  200. Internal changes
  201. <ul>
  202. <li>Some minor refactoring (move common code a method)</li>
  203. <li>Application of Jedits JavaStyle task resulted in a major reshaping of
  204. the codebase and the insertion of a blank line every second line. Significant
  205. effort was required to revert some (but not all) changes.</li>
  206. <li>Removed throws clause from methods which can't throw exceptions </li>
  207. </ul>
  208. The test harness has been expanded to include unicode source file
  209. (the build works but the rest of the system has 'issues' with high unicode
  210. package and method names)
  211. <h4>Version 0.2</h4>
  212. First public edition, added to the ant cvs tree. Tested on the PDC build of
  213. the dotnet SDK only, and still immature. The command execution code was
  214. refactored out into a 'NetCommand' class for re-use. The Ilasm task was added
  215. at this time.
  216. <h4>Version 0.1</h4>
  217. Initial proof of concept; very rudimentary support for CSC only.
  218. s </li>
  219. </ul>
  220. The test harness has been expanded to include unicode source file
  221. (the build works but the rest of the system has 'issues' with high unicode
  222. package and method names)
  223. <h4>Version 0.2</h4>
  224. First public edition, added to the ant cvs tree. Tested on the PDC build of
  225. the dotnet SDK only, and still immature. The command execution code was
  226. refactored out into a 'NetCommand' class for re-use. The Ilasm task was added
  227. at this time.
  228. <h4>Version 0.1</h4>
  229. Initial proof of concept; very rudimentary support for CSC only.
  230. <p align="center">Copyright &copy; 2000-2003 Apache Software Foundation. All rights
  231. Reserved.</p>
  232. </body>
  233. </html>