/plugins/AntFarm/tags/AntFarm_1_3/users-guide.xml

# · XML · 469 lines · 399 code · 66 blank · 4 comment · 0 complexity · 0de37bafea85894f2d8c0d25f2b70a57 MD5 · raw file

  1. <?xml version="1.0"?>
  2. <!-- AntFarm user's guide -->
  3. <!-- (C) 2001 Brian Knowles -->
  4. <!-- jEdit buffer-local properties: -->
  5. <!-- :tabSize=1:indentSize=1:noTabs=true: -->
  6. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
  7. "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
  8. <book>
  9. <bookinfo><title>AntFarm Plugin User's Guide</title>
  10. <othercredit><contrib>Maintainers</contrib>
  11. <firstname>Todd</firstname><surname>Papaioannou</surname>
  12. </othercredit>
  13. <othercredit><contrib>Maintainers</contrib>
  14. <firstname>James</firstname><surname>Wilson</surname>
  15. </othercredit>
  16. <othercredit><contrib>Co-authors</contrib>
  17. <firstname>Fernando</firstname><surname>Aranguiz</surname>
  18. </othercredit>
  19. <othercredit><contrib>Co-authors</contrib>
  20. <firstname>Brian</firstname><surname>Knowles</surname>
  21. </othercredit>
  22. <othercredit><contrib>Co-authors</contrib>
  23. <firstname>Todd</firstname><surname>Papaioannou</surname>
  24. </othercredit>
  25. <othercredit><contrib>Co-authors</contrib>
  26. <firstname>Chris</firstname><surname>Steinbeck</surname>
  27. </othercredit>
  28. <othercredit><contrib>Co-authors</contrib>
  29. <firstname>Richard</firstname><surname>Wan</surname>
  30. </othercredit>
  31. <othercredit><contrib>Co-authors</contrib>
  32. <firstname>James</firstname><surname>Wilson</surname>
  33. </othercredit>
  34. <othercredit><contrib>Co-authors</contrib>
  35. <firstname>Calvin</firstname><surname>Yu</surname>
  36. </othercredit>
  37. <othercredit><contrib>Initial AntFarm authors</contrib>
  38. <firstname>Rick</firstname><surname>Gibbs</surname>
  39. </othercredit>
  40. <othercredit><contrib>Initial AntFarm authors</contrib>
  41. <firstname>Chris</firstname><surname>Scott</surname>
  42. </othercredit>
  43. <legalnotice><title>Legal Notice</title>
  44. <para>
  45. Permission is granted to copy, distribute and/or modify this document
  46. under the terms of the GNU Free Documentation License, Version 1.1 or
  47. any later version published by the Free Software Foundation; with no
  48. <quote>Invariant Sections</quote>, <quote>Front-Cover Texts</quote> or
  49. <quote>Back-Cover Texts</quote>, each as defined in the license. A copy of
  50. the license can be found in the file <filename>COPYING.DOC.txt</filename>
  51. included with jEdit.
  52. </para>
  53. </legalnotice>
  54. </bookinfo>
  55. <chapter id="intro"><title>Introduction</title>
  56. <para>
  57. The <application>AntFarm</application> plugin provides quick access to Ant
  58. build files from within jEdit. It has five main features:
  59. </para>
  60. <itemizedlist>
  61. <listitem><para><link linkend="structure">View the structure of an <application>Ant</application> build
  62. file.</link></para></listitem>
  63. <listitem><para><link linkend="errors">Dynamically parse <application>Ant</application> build files
  64. and display errors.</link></para></listitem>
  65. <listitem><para><link linkend="run">Run <application>Ant</application> targets
  66. from within jEdit.</link>
  67. </para></listitem>
  68. <listitem><para><link linkend="console-integration">Integration with the <application>Console</application>
  69. plugin.</link></para></listitem>
  70. <listitem><para><link linkend="asset-access">Access to the <application>Ant</application> build
  71. file's assets.</link></para></listitem>
  72. </itemizedlist>
  73. <para>
  74. <application>Ant</application> is a Java based make tool developed by the
  75. <ulink url="http://ant.apache.org">Apache Jakarta project</ulink>.
  76. </para>
  77. <para>
  78. For help writing <application>Ant</application> build files, please refer to the
  79. <application>Ant</application> project's
  80. <ulink url="http://ant.apache.org/manual/index.html">online help</ulink>.
  81. </para>
  82. <para>
  83. AntFarm includes version 1.5.1 of <application>Ant</application>.
  84. </para>
  85. <sect1 id="configuration"><title>Configuring Ant Farm</title>
  86. <para>To configure Ant Farm, access <guimenu>Global Options</guimenu> -&gt;
  87. <guilabel>Plugin Options</guilabel> -&gt; <guilabel>Ant Farm</guilabel> -&gt;
  88. <guilabel>Build Options</guilabel>.
  89. </para>
  90. <para>
  91. Ant Farm can be configured to run builds within the current JVM or outside of
  92. the current JVM using a shell script. Using the current JVM is faster but
  93. large build tasks may not have enough memory to execute properly. Also, complex
  94. Ant scripts that require multiple external resources might not run properly
  95. from the current JVM.
  96. </para>
  97. <para>
  98. If you experience OutOfMemory exceptions when running builds in the same JVM,
  99. increase the size of the java heap when running jEdit, or use an external
  100. script. To increase the heap size, use the <command>-mx&lt;size&gt;m</command>
  101. java command line option when starting jEdit, where
  102. &lt;size&gt; indicates the amount of memory to be assigned.
  103. </para>
  104. <para>
  105. When you attempt to run an Ant build without having configured you build
  106. preferences, you will be prompted to select whether you wish to use the current
  107. JVM or an external script.
  108. </para>
  109. <para>
  110. If you choose to run Ant builds within the current JVM, additional classpath
  111. elements can be specified when needed. This allows Ant to locate classes
  112. required for execution. This is useful when using custom tasks and external
  113. libraries not loaded by JEdit.
  114. </para>
  115. <para>
  116. To run Ant builds outside of the current JVM, specify the build file you wish
  117. to use. Default build files for multiple operating systems are included with
  118. the binary distribution of the
  119. <ulink url="http://ant.apache.org">Jakarta-Ant project</ulink>.
  120. </para>
  121. <para>
  122. Additionally, you can specify global properties that will be passed to Ant.
  123. Access <guimenu>Global Options</guimenu> -&gt;
  124. <guilabel>Plugin Options</guilabel> -&gt; <guilabel>Ant Farm</guilabel> -&gt;
  125. <guilabel>Properties</guilabel>, and enter the name/value pairs for the
  126. properties you need. Ant Farm will prompt you for runtime properties each time
  127. you run a target. To turn this feature off, click <guilabel>Do not prompt for
  128. properties when running targets</guilabel>. Properties specified at target
  129. runtime are not added to the global properties list.
  130. </para>
  131. <para>
  132. Ant Farm can automatically load build.xml files from the root of any projects
  133. you manage via the <application>Project Viewer</application>. To enable this,
  134. check <guilabel>Load build files from the Project Viewer plugin</guilabel>,
  135. make sure the Project Viewer is docked so it starts immediately with jEdit and
  136. restart jEdit. Now, whenever you switch to a project that contains a file named
  137. build.xml, it will be loaded into Ant Farm.
  138. </para>
  139. <para>
  140. Ant Farm also automatically loads any file named build.xml that is opened for
  141. editing.
  142. </para>
  143. <para>
  144. When running an Ant target, the name of each task is prepended to the output
  145. text by default. To avoid this and print output in
  146. <application>emacs</application> friendly mode, check <guilabel>Produce logging
  147. information without adornments (Emacs mode)</guilabel>.
  148. </para>
  149. <para>
  150. Ant Farm can save all currently changed buffers whenever you execute a target.
  151. To turn this feature on, check <guilabel>Save all buffers before running a
  152. target</guilabel>.
  153. </para>
  154. </sect1>
  155. </chapter>
  156. <chapter id="structure"><title>View the structure of an <application>Ant</application> build
  157. file.</title>
  158. <para>
  159. <guimenu>Plugins</guimenu>&gt;<guisubmenu>AntFarm</guisubmenu>
  160. displays the AntFarm window. This window is floating by default, but can be
  161. made to dock into the view in the <guilabel>Docking</guilabel> pane of the
  162. <guimenuitem>Global Options</guimenuitem> dialog box.
  163. </para>
  164. <para>
  165. The AntFarm window consists of a toolbar which manages the different
  166. build files you work with and a tree which displays the structure of the build
  167. files you have added. The tree displays the name attribute of the <application>
  168. Ant</application> project, if provided, and all defined targets of the project.
  169. </para>
  170. <para>
  171. In addition to the toolbar buttons, different functions can be accessed by
  172. right clicking on each item in the tree.
  173. </para>
  174. <sect1 id="toolbar"><title>The AntFarm tool bar</title>
  175. <para>
  176. Each button on the toolbar shows a tooltip if the mouse pointer is held over it long enough.
  177. Here is a description of each button:
  178. </para>
  179. <itemizedlist>
  180. <listitem><para><guibutton>Add</guibutton> - provides a file chooser dialog box
  181. which allows you to chose the <application>Ant</application> build file you
  182. want to work with. Multiple build files can be added to the tree.
  183. </para>
  184. <para>
  185. The traditional name for an <application>Ant</application> build file is
  186. "build.xml". In addition to the Add button, AntFarm is setup to automatically load any file named
  187. "build.xml" into the tree.
  188. </para>
  189. <para>
  190. In addition, AntFarm contains the option to load "build.xml" files from any
  191. project you may manage using the <application>Project Viewer</application> plugin.
  192. To activate this feature, check <guimenu>Global Options</guimenu> -&gt;
  193. <guilabel>Plugin Options</guilabel> -&gt; <guilabel>Ant Farm</guilabel>
  194. -&gt; <guilabel>Load build files from the Project Viewer plugin</guilabel>.
  195. </para>
  196. </listitem>
  197. <listitem><para><guibutton>Remove</guibutton> - removes the currently selected build
  198. file from the tree. This does not affect the build file itself in any way.
  199. </para></listitem>
  200. <listitem><para><guibutton>Run</guibutton> - runs the current target that is
  201. selected in the tree. If the currently selected item is a project, AntFarm
  202. will run the default target for that build file.
  203. </para></listitem>
  204. </itemizedlist>
  205. </sect1>
  206. </chapter>
  207. <chapter id="errors"><title>Dynamically parse <application>Ant</application> build files
  208. and display errors.</title>
  209. <para>
  210. <application>Ant</application> build files are defined using XML. When a build
  211. file is added to the AntFarm, it's structure is parsed and the targets are
  212. displayed in the tree. If an error is encountered while parsing, a message will
  213. be displayed in the tree and an entry will be sent to the
  214. <application>ErrorList</application> plugin. The <application>ErrorList</application>
  215. entry provides quick access to the line that caused the problem in the
  216. build file when a line number is available.
  217. </para>
  218. <para>
  219. When changes are made and saved to a build file that is loaded in AntFarm,
  220. the tree will be reparsed and updated to display the current status of the
  221. file. Just as in loading, any errors will be caught and displayed via the tree
  222. and the <application>ErrorList</application>. This feature provides quick
  223. validation while you are writing your build files.
  224. </para>
  225. </chapter>
  226. <chapter id="run"><title>Run <application>Ant</application> targets from within jEdit.
  227. </title>
  228. <para>
  229. There are two ways to run targets from the AntFarm tree.
  230. <itemizedlist>
  231. <listitem><para>
  232. Select the target in the tree and click the <guibutton>Run</guibutton>. If a
  233. project is selected the default target will be run.
  234. </para></listitem>
  235. <listitem><para>
  236. Select the target in the tree, right click and select the
  237. <guimenu>Run</guimenu> menu item.
  238. </para></listitem>
  239. </itemizedlist></para>
  240. <para>
  241. By default, you will be prompted to enter runtime properties to send to Ant
  242. after you run a target. This can be turned off from the property dialog, or
  243. turned back on by unchecking, <guimenu>Global Options</guimenu> -&gt;
  244. <guilabel>Plugin Options</guilabel> -&gt; <guilabel>Ant Farm</guilabel> -&gt;
  245. <guilabel>Properties</guilabel>, <guilabel>Do not prompt for
  246. properties when running targets</guilabel>
  247. </para>
  248. <para>The next section explains how to run targets from the
  249. <application>Console</application> plugin.
  250. </para>
  251. </chapter>
  252. <chapter id="console-integration"><title>Integration with the <application>Console</application> plugin.</title>
  253. <para>
  254. AntFarm is closley tied to the <application>Console</application> plugin.
  255. The <application>Console</application> provides a convienent way to display
  256. streamed output within jEdit. <application>Console</application> also provides
  257. error parsing through a pattern matching scheme that is very powerful. If you
  258. would like to add custom pattern matchers to use with AntFarm, refer to the
  259. Console documentation. Additionally, <application>Console</application>
  260. provides a mechanism for adding custom command interpreters called
  261. <quote>shells</quote>. AntFarm uses the <quote>Ant</quote> shell to allow
  262. quick command line access to some of the features of AntFarm.
  263. </para>
  264. <sect1 id="build-output"><title>Displaying build output.</title>
  265. <para>
  266. When running a target from AntFarm all output will be sent to the Console's
  267. output window. Any errors that match the built-in patterns will be sent to the
  268. <application>ErrorList</application>.
  269. </para>
  270. <para>
  271. To stop a target while running, use the <guibutton>Stop</guibutton> button on
  272. the <application>Console</application> toolbar.
  273. </para>
  274. </sect1>
  275. <sect1 id="ant-shell"><title>The Ant Shell</title>
  276. <para>
  277. You can use the Ant Shell indepentently of the AntFarm tree.
  278. The Ant shell provides the following commands:
  279. </para>
  280. <itemizedlist>
  281. <listitem><para>
  282. <command>! <literal>[prop=value]*</literal></command> -- runs the default
  283. target for the current build file with specified properties.
  284. </para></listitem>
  285. <listitem><para>
  286. <command>!<literal>[target_name]</literal> <literal>[prop=value]*</literal>
  287. </command> -- runs the specified target for the current build file with
  288. specified properties.
  289. </para></listitem>
  290. <listitem><para>
  291. <command>?</command> -- lists the available build files and usage
  292. </para></listitem>
  293. <listitem><para>
  294. <command>=<literal>build_file_number</literal></command> -- changes the current build file to the number identified by "?"
  295. </para></listitem>
  296. <listitem><para>
  297. <command>+<literal>[full_path_to_file]</literal></command> -- load this build
  298. file into Ant Farm. Searches up the current buffer's directory tree for a
  299. "build.xml" file to load if a file is not specified. Re-loads the build file if it is already loaded.
  300. </para></listitem>
  301. </itemizedlist>
  302. </sect1>
  303. </chapter>
  304. <chapter id="asset-access"><title>Access to the <application>Ant</application> build
  305. file's assets.</title>
  306. <para>AntFarm provides a couple quick short cuts to the different assests
  307. associated with a build file.
  308. </para>
  309. <itemizedlist>
  310. <listitem><para>
  311. To edit the underlying build file, right click on the project in the tree and
  312. select the <guimenu>Edit build file</guimenu> item. This will open the build
  313. file in jEdit and allow you to make changes. The tree will be automatically
  314. updated when ever the file is saved.
  315. </para>
  316. </listitem>
  317. <listitem><para>
  318. To browse the base directory of the project, right click on the project in the
  319. tree and select the <guimenu>Browse project files</guimenu> item. Each
  320. <application>Ant</application> project has a base directory. This command opens
  321. that directory in the <application>File System Browser</application>.
  322. </para></listitem>
  323. </itemizedlist>
  324. </chapter>
  325. <chapter id="history"><title>History</title>
  326. <para>Version 1.3</para>
  327. <itemizedlist>
  328. <listitem>
  329. <para>JW/TP - Updated look and feel of AntFarm for new Look and Feel of jEdit 4.1.</para>
  330. </listitem>
  331. <listitem>
  332. <para>TP - Updated AntFarm integration for Project Viewer 2.0.</para>
  333. </listitem>
  334. <listitem>
  335. <para>JW - Updated to Ant 1.5.1</para>
  336. </listitem>
  337. <listitem>
  338. <para>JW - The Options menu now uses the correct GUIUtilities API for correct
  339. placement.</para>
  340. </listitem>
  341. <listitem>
  342. <para>JW - The Toolbar's buttons have been changed to RolloverButton instances.</para>
  343. </listitem>
  344. <listitem>
  345. <para>JW - The popup menu is now shown on MousePressed not MouseReleased.</para>
  346. </listitem>
  347. <listitem>
  348. <para>JW - 2x2 pixel sized Tooltips were being shown for all targets (even those
  349. without a description). This has been fixed.</para>
  350. </listitem>
  351. <listitem>
  352. <para>JW - The Console plugin is not utilized (brought to the front) until a target
  353. is "run".</para>
  354. </listitem>
  355. <listitem>
  356. <para>TP - Updated documentation in several places. (Ant hrefs, Ant versions, etc)</para>
  357. </listitem>
  358. <listitem>
  359. <para>TP - Added history section to documentation.</para>
  360. </listitem>
  361. </itemizedlist>
  362. </chapter>
  363. <chapter id="appendix"><title>Appendix</title>
  364. <para>Jakarta Ant is provided under separate license than the Ant Farm plugin.
  365. The text of that license follows:</para>
  366. <para>============================================================================</para>
  367. <para> The Apache Software License, Version 1.1</para>
  368. <para>============================================================================</para>
  369. <para> Copyright (C) 1999 The Apache Software Foundation. All rights reserved.</para>
  370. <para> Redistribution and use in source and binary forms, with or without modifica-
  371. tion, are permitted provided that the following conditions are met:</para>
  372. <para> 1. Redistributions of source code must retain the above copyright notice,
  373. this list of conditions and the following disclaimer.</para>
  374. <para> 2. Redistributions in binary form must reproduce the above copyright notice,
  375. this list of conditions and the following disclaimer in the documentation
  376. and/or other materials provided with the distribution.</para>
  377. <para> 3. The end-user documentation included with the redistribution, if any, must
  378. include the following acknowledgment: "This product includes software
  379. developed by the Apache Software Foundation (http://www.apache.org/)."
  380. Alternately, this acknowledgment may appear in the software itself, if
  381. and wherever such third-party acknowledgments normally appear.</para>
  382. <para> 4. The names "Ant" and "Apache Software Foundation" must not be used to
  383. endorse or promote products derived from this software without prior
  384. written permission. For written permission, please contact
  385. apache@apache.org.</para>
  386. <para> 5. Products derived from this software may not be called "Apache", nor may
  387. "Apache" appear in their name, without prior written permission of the
  388. Apache Software Foundation.</para>
  389. <para> THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  390. INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  391. FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  392. APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  393. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
  394. DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  395. OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  396. ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  397. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  398. THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</para>
  399. <para> This software consists of voluntary contributions made by many individuals
  400. on behalf of the Apache Software Foundation. For more information on the
  401. Apache Software Foundation, please see http://www.apache.org/</para>
  402. </chapter>
  403. </book>