build-support files

The files listed here are in the build-support module in the CVS repository — see here to obtain them. They are explained in some detail on the plugin build files page.

On this page:

See explanation here.

# Default properties for plugin-build.xml
# Uncomment properties and set to desired values.
# Save to a file named in one of these locations:
# - The plugin's main directory (e.g., "plugins/XML/")
# - The plugin's parent directory (e.g., "plugins/")
# - Your home directory (with or without a leading dot)

# jEdit & plugins directory settings

# Location of build-support directory

# jEdit install directory

# User settings directory

# Top-level of the plugins source tree

# Where to place the built jar files

# Generic plugin build options

# Where to put temporary build files

# Where to put compiled classes

# Where to put generated documentation${build.dir}/docs

# Where to put generated javadoc

# Where to put other files

# Default compiler flags

# Generate debugging code

# Gererate optimized code

# Deprecation warnings.

# Verbose compiler messages

# Disable compiler warnings

# Target JVM version

# Java version of the source files

# List files being compiled

# Fork the javac compiler

# Documentation build options

# What target to use for the docs

# Location of the docbook DTD

# Stylesheet file to use

# Documentation docbook source

# Documentation output file

# Title for javadoc documentation
#javadoc.title=${} API

# Where to find the dockbook stylesheet

# The name of the xsl stylesheet (without the path info)

# The path to the style sheet to use.${docbook.xsl}/${docbook.xsl.sheet}

# CVS options

# CVS user name

# CVS_RSH value


# JUnit options

# Where to find jUnit

# Whether to print a summary

# Whether to halt if an error occurs

# Ant Contrib

# Where to find the ant-contrib jar.


See explanation here.

<project name="jEditPlugin" default="build">

    <!-- {{{ Top-Level build file for jEdit plugins. ====== -->
        Requires Jakarta Ant 1.6 to be used.

        To use this file, use the "import" task from ant
        on your plugin's build file, like this:

        <property name="" value="../build-support" />
        <import file="${}/plugin-build.xml" />

        The use of the property is to ease the work of the plugin

        General tips:
        - To override properties, either use the several
          options for files, or declare
          them in you plugin's build file *before* the
          import statement.
        - To override paths and selectors, declare them in
          your build file *after* the import statement.

        Some tasks require the ant-contrib library available from If you have the
        library, specify a property named "ant-contrib.jar" with
        the location of the library. The tasks that need ant-contrib
        are the tasks related to plugin dependencies.

        For JUnit support, make sure you have the ant-junit.jar
        library in Ant's lib directory. Specify the location of
        the junit jar file using the property "junit.jar".
    <!-- ===============================================}}} -->

    <!-- {{{ Property definitions ========================= -->
    <!-- First loads options from the user's optional files in the following order:
         current dir, parent dir, $HOME/
         and finally $HOME/ . The defines
         several default properties used by the different
         targets.                                           -->
    <!-- ================================================== -->
    <property file="" />
    <property file="../" />
    <property file="${user.home}/" />
    <property file="${user.home}/" />

    <!-- where to find jEdit and plugins    -->
    <property name="jedit.install.dir"  value="../../jEdit" />
    <property name="jedit.user.home"    value="${user.home}/.jedit" />
    <property name="plugins.srcdir" value=".." />
    <property name="install.dir"    value=".." />

    <!-- some info about the plugin and where to put it -->
    <property name="src.dir"        value="." />
    <property name="jar.file"       value="${}.jar" />
    <property name=""   value="${}.zip" />
    <property name=""    value="dist.nojavadoc" />

    <!-- where files will go    -->
    <property name="build.dir"      value="build" />
    <property name="build.classes"  value="${build.dir}/classes" />
    <property name=""     value="${build.dir}/docs" />
    <property name="build.javadoc"  value="${}/javadoc" />
    <property name="build.extras"   value="${build.dir}/extras" />

    <!-- default compiler flags -->
    <property name="compiler.debug"         value="off" />
    <property name="compiler.optimize"      value="off" />
    <property name="compiler.deprecation"   value="off" />
    <property name="compiler.verbose"       value="off" />
    <property name="compiler.nowarn"        value="off" />
    <property name=""        value="1.4" />
    <property name="compiler.source"        value="1.4" />
    <property name="compiler.listfiles"     value="no" />
    <property name="compiler.fork"          value="no" />

    <!-- default documentation options  -->
    <property name=""   value="xsltproc" />
    <property name="docbookx.dtd"       value="../XML/xml/dtds/docbookx.dtd" />
    <property name="user-doc.xsl"       value="${}/users-guide.xsl" />
    <property name="user-doc.xml"       value="docs/users-guide.xml" />
    <property name="user-doc.out"       value="${}/users-guide.html" />
    <property name="javadoc.title"      value="${} API" />
    <property name="docbook.xsl.sheet"  value="html/onechunk.xsl" />
    <property name=""   value="${docbook.xsl}/${docbook.xsl.sheet}" />

    <!-- default cvs options -->
    <property name="jedit.cvs.user" value="${}" />
    <property name="cvs.rsh"        value="ssh" />
    <property name="cvs.root"      
value=":ext:${jedit.cvs.user}" />

    <!-- default junit options -->
    <property name="junit.jar"              value="junit.jar" />
    <property name="junit.testcase"         value="${}TestSuite" />
    <property name="junit.printsummary"     value="on" />
    <property name="junit.haltonfailure"    value="off" />

    <!-- default class path; try not to override this,
         since the intention is to add here anything that
         might be needed by all the plugins (such as the
         jedit.jar file and any other jar files that
         jEdit might use in the future.                     -->
    <path id="default.class.path">
        <pathelement location="${jedit.install.dir}/jedit.jar" />
        <pathelement location="${junit.jar}" />

    <!-- this is the classpath used by the "compile"
         target. Override this one if you need to. You don't
         need to reference "default.class.path" here - it's added
         automatically to the javac command.                -->
    <path id="project.class.path" />

    <!-- {{{ Load ant-contrib library ===================== -->
    <taskdef resource="net/sf/antcontrib/" onerror="ignore">
            <pathelement location="${ant-contrib.jar}"/>
    <!-- ===============================================}}} -->

    <!-- ===============================================}}} -->

    <!-- {{{ Custom javac task ============================ -->
    <presetdef name="jp.javac">
        <javac destdir="${build.classes}"
            <src location="${src.dir}" />
            <classpath refid="default.class.path" />
            <classpath refid="project.class.path" />
    <!-- }}} ============================================== -->

    <!-- {{{ Compilation and building ===================== -->

    <!-- This selector defines the files that will be
         compiled by the "compile" target. Define here which
         files under ${src.dir} will be compiled when the
         "compile" task is called.                          -->
    <selector id="compileFiles">
        <filename name="**/*.java" />

    <!-- This selector defines extra files to be included
         in the plugin's JAR file. The context of the
         selector is the plugin's directory (${basedir}),
         so it will not work for files outside the plugin
         directory. For those cases, use the "build.prepare"
         target. By default, it's empty.                    -->
    <selector id="packageFiles">
        <size value="0" when="less" />

    <!-- This selector defines other files that should be packaged
         in the plugin's jar file; by default it contains actions.xml,
         dockables.xml, services.xml, any files ending in ".props",
         "LICENSE" and "README". The context is "${basedir}". Override
         it if your plugin needs special treatment for these files. -->
    <selector id="extraFiles">
                <filename name="**/actions.xml" />
                <filename name="**/dockables.xml" />
                <filename name="**/services.xml" />
                <filename name="**/*.props" />
                <filename name="**/LICENSE" />
                <filename name="**/README" />
                <filename name="${build.dir}/*" />

    <!-- {{{ Target: compile ============================== -->
    <!-- Compiles all the ".java" files present in the
         directory pointed by the "src.dir" property
         defined above. Classes are put in the directory
         designated in the "build.classes" property.
         The following properties control the behavior of
         the compiler (relates to options to the javac
         ant task, defaults in parethesis):
         compiler.debug: the debug option (off)
         compiler.optimize: the optimize option (off)
         compiler.deprecation: deprecation option (off)
         compiler.verbose: the verbose option (off)
         compiler.nowarn: the nowarn option (off) the target option (1.3)
         compiler.source: the source option (1.3)
         compiler.listfiles: the listfiles option (no)      -->
    <target name="compile"
            description="Compile the plugin's classes">

        <mkdir dir="${build.classes}" />
            <selector refid="compileFiles" />

    <!-- ===============================================}}} -->

    <!-- {{{ Target: clean ================================ -->
    <!-- Removes the directory defined in the "build"
         property, the "docbook-wrapper.xsl" file and the
         file defined by the property "jar.file" in the
         directory defined by "install.dir".                -->
    <target name="clean" description="Cleans project directories">
        <delete dir="${build.dir}" quiet="true" />
        <delete file="docbook-wrapper.xsl" quiet="true" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: build ================================ -->
    <!-- This target build the plugin JAR file. It
         depends on two other targets: "compile", defined
         above, and "build.prepare", which is empty in
         this file but can be overriden by the plugin's
         build file.
         This target does the following after that:
         * Copies all files defined by the extraFiles selector
           to the staging area.
         * Copies all files defined by the packageFiles selector
           to the staging area.
         * Creates a JAR with the name defined in
           "jar.file" in the directory defined by
           "install.dir". This JAR will contain the
           contents of the directories defined by
           "build.classes", "" and "build.extras"
         If you need to have any other files added to the
         JAR, override the "build.prepare" target and use
         it to copy files to one of those three
         directories, or redefine the "extraFiles"
         selector.                                          -->
    <target name="build"
          description="Builds the plugin JAR file">

        <mkdir dir="${build.classes}" />
        <mkdir dir="${}" />
        <mkdir dir="${build.extras}" />

        <copy todir="${build.extras}" includeEmptyDirs="false">
            <fileset dir="${basedir}">
                <selector refid="extraFiles" />
                <filename name="${build.dir}/**" />

        <copy todir="${build.extras}" includeEmptyDirs="false">
            <fileset dir="${basedir}">
                <selector refid="packageFiles" />

        <jar jarfile="${install.dir}/${jar.file}">
            <fileset dir="${build.classes}" />
            <fileset dir="${}" />
            <fileset dir="${build.extras}" />

        <antcall target="" />

    <!-- ===============================================}}} -->

    <!-- {{{ Target: build.prepare ======================== -->
    <!-- This implementation does nothing. See the
         "build" target for details.                        -->
    <target name="build.prepare" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: =========================== -->
    <!-- Called after the build process is finished.
         Plugins can use this to copy extra jar files the
         plugin needs to ${install.dir}.
         By default does nothing.                           -->
    <target name="" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: dist.nojavadoc ======================= -->
    <!-- Meta-task that builds the user documentation and
         builds the plugin JAR file, but not the javadoc.   -->
    <target name="dist.nojavadoc"  depends="userdocs,build" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: dist.complete ======================== -->
    <!-- Meta-task that builds the user documentation,
         javadoc documentation and builds the plugin JAR
         file.                                              -->
    <target name="dist.complete" depends="docs,build" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: dist ================================= -->
    <!-- This task calls the target defined in the
         property "" to build the plugin and
         package it for distribution. Before proceeding,
         it cleans the build directory.                     -->
    <target name="dist" depends="clean">
        <runtarget target="${}" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: dist.source ========================== -->
    <!-- Creates a ZIP file of the plugin's source. The
         name of the file is defined in the property
         "" and will be created in the
         directory defined by "install.dir".                -->
    <target name="dist.source">
        <delete file="${install.dir}/${}" quiet="true" />
        <zip destfile="${install.dir}/${}">
            <fileset dir="${src.dir}">
                <include name="**/*.*" />
                <exclude name="${build.dir}/**" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: package ============================== -->
    <!-- Convenience target that calls both "docs" and
         "build" to create the plugin jar file.             -->
    <target name="package" depends="docs,build" />
    <!-- ===============================================}}} -->

    <!-- ===============================================}}} -->

    <!-- {{{ Documentation ================================ -->

    <!-- {{{ Target: docs ================================= -->
    <!-- Meta-task that calls javadoc and userdocs.         -->
    <target name="docs"
            description="Build the User's Guide and Javadoc documentation" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: userdocs ============================= -->
    <!-- This tasks accomplishes the following:
         * it creates a file called "docbook-wrapper.xsl"
           in the current directory, containing a
           reference to the style sheet in the property
           "docbook.xsl" defined above.
         * builds the plugin documentation by calling a
           target called "docs-${}",
           where "" is a property defined
           above (default: xsltproc).                       -->
    <target name="userdocs"
            description="Builds the user documentation.">
        <mkdir dir="${}" />
        <echo file="docbook-wrapper.xsl"
                message="&lt;xsl:stylesheet" />
        <echo file="docbook-wrapper.xsl"
                message=" xmlns:xsl=''" />
        <echo file="docbook-wrapper.xsl"
                message=" version='1.0'&gt;" />
        <echo file="docbook-wrapper.xsl"
                message="&lt;xsl:import href='${}' /&gt;" />
        <echo file="docbook-wrapper.xsl"
                message="&lt;/xsl:stylesheet&gt;" />

        <antcall target="docs-${}" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: javadoc ============================== -->
    <!-- Builds the javadoc documentation for the plugin,
         placing it under "build.javadoc". Your plugin
         build file *must* define a property called
         named "javadoc.packagenames" to be used as the
         "packagenames" option of ant's javadoc task.
         This property is not defined in this file and
         execition will probably fail if it's not defined.
         The title of the documentation is defined in the
         "javadoc.title" property.                          -->
    <target name="javadoc"
            description="Generates javadoc sourcecode documentation"
        <mkdir dir="${build.javadoc}" />
        <javadoc sourcepath="${src.dir}"
            <classpath refid="default.class.path" />
            <classpath refid="project.class.path" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: docs-xsltproc ======================== -->
    <!-- Generate docs with xsltproc tool from This task creates a temporary
         file called "docbook.catalog" containing a
         reference to the Docbook DTD defined in the
         property "docbookx.dtd" above. The style sheet
         used is defined by the property "user-doc.xsl",
         and defaults to "docbook-wrapper.xsl". The XML
         document to be processed is defined by the
         "user-doc.xml" property, and defaults to
         "docs/users-guide.xml". The output is defined in
         the "user-doc.out" property.                       -->
    <target name="docs-xsltproc" description="Generate user documentation in hmtl format with
        <echo file="docbook.catalog"
                message="PUBLIC '-//OASIS//DTD DocBook XML V4.1.2//EN' '${docbookx.dtd}'" />

        <exec executable="xsltproc">
            <env key="SGML_CATALOG_FILES" value="docbook.catalog" />
            <arg value="-o" />
            <arg value="${user-doc.out}" />
            <arg value="--catalogs" />
            <arg value="--path" />
            <arg value="${basedir}" />
            <arg value="${user-doc.xsl}" />
            <arg value="${user-doc.xml}" />

        <delete file="docbook.catalog" quiet="true" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: docs-xalan =========================== -->
    <!-- Generate docs with Xalan tool from . Same properties as the
         "docs-xsltproc" target apply here.                 -->
    <target name="docs-xalan"
            description="Generate user documentation in hmtl format with xalan">
        <style style="${user-doc.xsl}"
                out="${user-doc.out}" >
                <dtd publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
                         location="${docbookx.dtd}" />
    <!-- ===============================================}}} -->

    <!-- ===============================================}}} -->

    <!-- {{{ Unit testing ================================= -->

    <!-- {{{ Target: test ================================= -->
    <!-- Meta-task that calls the defined test target.      -->
    <target name="test"
            description="Runs the plugin's unit tests.">
        <antcall target="${}" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: test-junit============================ -->
    <!-- Executes a jUnit test case defined by the plugin's
         build file. The classpath for the test will be the
         ${build.class} directory, the ${junit.jar} file and
         the default.class.path and project.class.path path
    <target name="test-junit"
            description="Runs the plugin's jUnit tests."

        <junit printsummary="${junit.printsummary}"

                <pathelement location="${junit.jar}" />
                <pathelement location="${build.classes}" />
                <path refid="default.class.path" />
                <path refid="project.class.path" />

            <test name="${junit.testcase}" />

    <!-- ===============================================}}} -->

    <!-- ===============================================}}} -->

    <!--{{{  Dependencies ================================= -->

    <!-- {{{ Target: cvs.update =========================== -->
    <!-- Updates a plugin's source code from CVS. This
         target expects one parameter, "",
         containing the name of the plugin's directory in
         CVS (don't include the leading "plugins"; for
         example, use "XML" for the XML Plugin.             -->
    <target name="cvs.update">
        <mkdir dir="${plugins.srcdir}" />
        <cvs command="update -dP"
                package="${}" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: update.dependencies ================== -->
    <!-- This task iterates through the dependency list
         defined in the property "plugin.dependencies"
         as a comma-separated list of plugin names, calling
         the "cvs.update" target for each dependency.       -->
    <target name="update.dependencies"
            description="Download the most recent source of the
                         needed plugins from CVS"
        <foreach list="${plugin.dependencies}"
                    trim="true" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: build.dependencies =================== -->
    <target name="build.dependencies"
            description="Builds the needed plugins from the
                            available source code."
        <foreach list="${plugin.dependencies}"
                    trim="true" />
    <!-- ===============================================}}} -->

    <!-- {{{ Target: build.other=========================== -->
    <!-- Builds a plugin from the code available in its
         directory under "plugins.srcdir". This will call
         the "build" target of that plugin's build file.
         Expects the "" parameter with the name
         of the plugin's directory.                         -->
    <target name="build.other">
        <fail message="Can't find plugin: ${}">
                    <available file="${plugins.srcdir}/${}/build.xml" />
        <ant antfile="${plugins.srcdir}/${}/build.xml"
                inheritRefs="false" />
    <!-- ===============================================}}} -->

    <!-- ================================================== }}}-->



<?xml version='1.0'?>

<!-- You should use this XSL stylesheet to create plugin documentation.

     If you want all output in a single HTML file, specify the path to
     your DocBook-XSL "html/docbook.xsl" file in the <xsl:import>
     statement below. If you want each chapter to have its own file,
     specify the path to your "html/chunk.xsl".

	 This stylesheet assumes the user's guide XML source is in a
	 subdirectory of the plugin's main dir (e.g., "docs/userguide.xml").

<xsl:stylesheet xmlns:xsl=""

<xsl:import href="docbook-wrapper.xsl"/>

<!-- Swing HTML control doesn't support &ldquo; and &rdquo; -->
<xsl:template match="quote">&quot;<xsl:apply-templates/>&quot;</xsl:template>

<xsl:template match="guibutton">
  <xsl:call-template name="inline.boldseq"/>

<xsl:template match="guiicon">
  <xsl:call-template name="inline.boldseq"/>

<xsl:template match="guilabel">
  <xsl:call-template name="inline.boldseq"/>

<xsl:template match="guimenu">
  <xsl:call-template name="inline.boldseq"/>

<xsl:template match="guimenuitem">
  <xsl:call-template name="inline.boldseq"/>

<xsl:template match="guisubmenu">
  <xsl:call-template name="inline.boldseq"/>

<xsl:variable name="toc.list.type">ul</xsl:variable>

<xsl:variable name="shade.verbatim">1</xsl:variable>

<xsl:variable name="">ansi</xsl:variable>
<xsl:template match="void"><xsl:apply-templates/></xsl:template>