PageRenderTime 59ms CodeModel.GetById 51ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms


HTML | 41 lines | 41 code | 0 blank | 0 comment | 0 complexity | e4faf8447eb37587cef2fd1569a4176e MD5 | raw file
 1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>The build.xml Ant build file</title><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="jEdit 4.3 User's Guide"><link rel="up" href="plugin-implement.html" title="Chapter 18. Implementing a Simple Plugin"><link rel="prev" href="plugin-implement-docs.html" title="Plugin Documentation"><link rel="next" href="plugin-implement-reloading.html" title="Reloading the Plugin"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">The build.xml Ant build file</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="plugin-implement-docs.html">Prev</a> </td><th width="60%" align="center">Chapter 18. Implementing a Simple Plugin</th><td width="20%" align="right"> <a accesskey="n" href="plugin-implement-reloading.html">Next</a></td></tr></table><hr></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="plugin-implement-building"></a>The build.xml Ant build file</h2></div></div></div><p>We have already outlined the contents of the user action catalog,
 2        the properties file and the documentation file in our earlier
 3        discussion. The final step is to compile the source file and build the
 4        archive file that will hold the class files and the plugin's other
 5        resources.</p><p>Publicly released plugins include with their source a makefile in
 6        XML format for the <span class="application">Ant</span> utility. The format
 7        for this file requires few changes from plugin to plugin. Here is a
 8        version of <code class="filename">build.xml</code> that could be used by
 9        QuickNotepad:</p><div class="informalexample"><pre class="programlisting">
10&lt;project name="QuickNotepad"
11         default="build"&gt;
12    &lt;description&gt;
13        This is an ant build.xml file for building the QuickNotepad plugin for jEdit.
14    &lt;/description&gt;
15    &lt;property name="user-doc.xml"
16          value="users-guide.xml" /&gt;
17    &lt;property file="" /&gt;
18    &lt;property file="../" /&gt;
19	&lt;property name=""
20			  value="../../../build-support" /&gt;    
21    &lt;import file="${}/plugin-build.xml" /&gt;
23</pre></div><p>This build file imports another modular build file,
24        <code class="literal">plugin-build.xml</code> from the <code class="literal">build-support</code>
25        project. It is available as a package you can check out from subversion, or found online in the <a class="ulink" href="" target="_top">jEdit's
26        SVN repository</a>. It contains the common build steps used to build the core jEdit plugins, and some example <code class="literal"></code> files which you can adapt for use with your development environment.</p><p>Customizing this build file for a different plugin will likely
27        only require three changes to build.xml file:</p><div class="itemizedlist"><ul type="disc"><li><p>the name of the project</p></li><li><p>the dependencies of the plugin</p></li><li><p>The extra files that need to be copied into the
28                jar.</p></li></ul></div><p>Because this build file and the one of most plugins import a
29        <code class="literal"></code> file from the current and the parent
30        directories, it is possible to build most of jEdit's plugins in a
31        uniform way by setting the common properties in a single
32        <code class="literal"></code> file, placed in the plugin source's
33        parent directory. </p><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>For a full discussion of the <code class="filename">Ant</code> file
34        format and command syntax, you should consult the <a class="ulink" href="" target="_top">Ant
35        documentation</a>, also available through jEdit's help system if you
36        installed the Ant Plugin. When editing Ant build files, the XML plugin
37        gives you completion tips for both elements <span class="emphasis"><em>and</em></span>
38        attributes. The Console plugin provides you with an ANT button which you
39        can bind to keyboard actions. In addition, there are the AntFarm and
40        Antelope plugins which also proivde you with alternate means to execute
41        Ant targets through the Console.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="plugin-implement-docs.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="plugin-implement.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="plugin-implement-reloading.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Plugin Documentation </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Reloading the Plugin</td></tr></table></div></body></html>