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 build.properties in one of these locations:
# - The plugin's main directory (e.g., "plugins/XML/build.properties")
# - The plugin's parent directory (e.g., "plugins/build.properties")
# - Your home directory (with or without a leading dot)
# jEdit & plugins directory settings
# Location of build-support directory
# build.support=../
# build.support=/absolute/path/to/plugins/build-support
# jEdit install directory
#jedit.install.dir=../../jEdit
# User settings directory
#jedit.user.home=${user.home}/.jedit
# Top-level of the plugins source tree
#plugins.srcdir=..
# Where to place the built jar files
#install.dir=..
# Generic plugin build options
# Where to put temporary build files
#build.dir=build
# Where to put compiled classes
#build.classes=${build.dir}/classes
# Where to put generated documentation
#build.docs=${build.dir}/docs
# Where to put generated javadoc
#build.javadoc=${build.docs}/javadoc
# Where to put other files
#build.extras=${build.dir}/extras
# Default compiler flags
# Generate debugging code
#compiler.debug=off
# Gererate optimized code
#compiler.optimize=off
# Deprecation warnings.
#compiler.deprecation=off
# Verbose compiler messages
#compiler.verbose=off
# Disable compiler warnings
#compiler.nowarn=off
# Target JVM version
#compiler.target=1.3
# Java version of the source files
#compiler.source=1.3
# List files being compiled
#compiler.listfiles=no
# Fork the javac compiler
#compiler.fork=no
# Documentation build options
# What target to use for the docs
#docs-proc.target=xsltproc
# Location of the docbook DTD
#docbookx.dtd=../XML/xml/dtds/docbookx.dtd
# Stylesheet file to use
#user-doc.xsl=docbook-wrapper.xsl
# Documentation docbook source
#user-doc.xml=docs/users-guide.xml
# Documentation output file
#user-doc.out=${build.docs}/index.html
# Title for javadoc documentation
#javadoc.title=${ant.project.name} API
# Where to find the dockbook stylesheet
#docbook.xsl=/usr/share/xsl/docbook-xsl
# The name of the xsl stylesheet (without the path info)
#docbook.xsl.sheet=html/onechunk.xsl
# The path to the style sheet to use.
#docs.style.sheet=${docbook.xsl}/${docbook.xsl.sheet}
# CVS options
# CVS user name
#jedit.cvs.user=${user.name}
# CVS_RSH value
#cvs.rsh=ssh
# CVSROOT
#cvs.root=:ext:${jedit.cvs.user}@cvs.sourceforge.net:/cvsroot/jedit
# JUnit options
# Where to find jUnit
#junit.jar=junit.jar
# Whether to print a summary
#junit.printsummary=on
# Whether to halt if an error occurs
#junit.haltonfailure=off
# Ant Contrib
# Where to find the ant-contrib jar.
#ant-contrib.jar=ant-contrib-1.0b1.jar
See explanation here.
<project name="jEditPlugin" default="build">
<!-- {{{ Top-Level build file for jEdit plugins. ====== -->
<!--
Requires Jakarta Ant 1.6 to be used.
:tabSize=4:indentSize=4:noTabs=true:
:folding=explicit:collapseFolds=1:
To use this file, use the "import" task from ant
on your plugin's build file, like this:
<property name="build.support" value="../build-support" />
<import file="${build.support}/plugin-build.xml" />
The use of the property is to ease the work of the plugin
packagers.
General tips:
- To override properties, either use the several
options for build.properties 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
http://ant-contrib.sourceforge.net. 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
build.properties files in the following order:
current dir, parent dir, $HOME/.build.properties
and finally $HOME/build.properties . The defines
several default properties used by the different
targets. -->
<!-- ================================================== -->
<property file="build.properties" />
<property file="../build.properties" />
<echo>${java.home}</echo>
<property file="${user.home}/.build.properties" />
<property file="${user.home}/build.properties" />
<!-- 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="${ant.project.name}.jar" />
<property name="src.zip.file" value="${ant.project.name}.zip" />
<property name="dist.target" value="dist.nojavadoc" />
<!-- where files will go -->
<property name="build.dir" value="build" />
<property name="build.classes" value="${build.dir}/classes" />
<property name="build.docs" value="${build.dir}/docs" />
<property name="build.javadoc" value="${build.docs}/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="compiler.target" 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="docs-proc.target" value="xsltproc" />
<property name="docbookx.dtd" value="../XML/xml/dtds/docbookx.dtd" />
<property name="user-doc.xsl" value="${build.support}/users-guide.xsl" />
<property name="user-doc.xml" value="docs/users-guide.xml" />
<property name="user-doc.out" value="${build.docs}/users-guide.html" />
<property name="javadoc.title" value="${ant.project.name} API" />
<property name="docbook.xsl.sheet" value="html/onechunk.xsl" />
<property name="docs.style.sheet" value="${docbook.xsl}/${docbook.xsl.sheet}" />
<!-- default cvs options -->
<property name="jedit.cvs.user" value="${user.name}" />
<property name="cvs.rsh" value="ssh" />
<property name="cvs.root"
value=":ext:${jedit.cvs.user}@cvs.sourceforge.net:/cvsroot/jedit" />
<!-- default junit options -->
<property name="junit.jar" value="junit.jar" />
<property name="junit.testcase" value="${ant.project.name}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}" />
</path>
<!-- 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/antcontrib.properties" onerror="ignore">
<classpath>
<pathelement location="${ant-contrib.jar}"/>
</classpath>
</taskdef>
<!-- ===============================================}}} -->
<!-- ===============================================}}} -->
<!-- {{{ Custom javac task ============================ -->
<presetdef name="jp.javac">
<javac destdir="${build.classes}"
debug="${compiler.debug}"
optimize="${compiler.optimize}"
deprecation="${compiler.deprecation}"
verbose="${compiler.verbose}"
nowarn="${compiler.nowarn}"
target="${compiler.target}"
source="${compiler.source}"
listfiles="${compiler.listfiles}"
fork="${compiler.fork}"
>
<src location="${src.dir}" />
<classpath refid="default.class.path" />
<classpath refid="project.class.path" />
</javac>
</presetdef>
<!-- }}} ============================================== -->
<!-- {{{ 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" />
</selector>
<!-- 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" />
</selector>
<!-- 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">
<and>
<or>
<filename name="**/actions.xml" />
<filename name="**/dockables.xml" />
<filename name="**/services.xml" />
<filename name="**/*.props" />
<filename name="**/LICENSE" />
<filename name="**/README" />
</or>
<not>
<filename name="${build.dir}/*" />
</not>
</and>
</selector>
<!-- {{{ 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)
compiler.target: 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}" />
<jp.javac>
<selector refid="compileFiles" />
</jp.javac>
</target>
<!-- ===============================================}}} -->
<!-- {{{ 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>
<!-- ===============================================}}} -->
<!-- {{{ 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", "build.docs" 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"
depends="compile,build.prepare"
description="Builds the plugin JAR file">
<mkdir dir="${build.classes}" />
<mkdir dir="${build.docs}" />
<mkdir dir="${build.extras}" />
<copy todir="${build.extras}" includeEmptyDirs="false">
<fileset dir="${basedir}">
<and>
<selector refid="extraFiles" />
<not>
<filename name="${build.dir}/**" />
</not>
</and>
</fileset>
</copy>
<copy todir="${build.extras}" includeEmptyDirs="false">
<fileset dir="${basedir}">
<selector refid="packageFiles" />
</fileset>
</copy>
<jar jarfile="${install.dir}/${jar.file}">
<fileset dir="${build.classes}" />
<fileset dir="${build.docs}" />
<fileset dir="${build.extras}" />
</jar>
<antcall target="build.post" />
</target>
<!-- ===============================================}}} -->
<!-- {{{ Target: build.prepare ======================== -->
<!-- This implementation does nothing. See the
"build" target for details. -->
<target name="build.prepare" />
<!-- ===============================================}}} -->
<!-- {{{ Target: build.post =========================== -->
<!-- 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="build.post" />
<!-- ===============================================}}} -->
<!-- {{{ 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 "dist.target" to build the plugin and
package it for distribution. Before proceeding,
it cleans the build directory. -->
<target name="dist" depends="clean">
<runtarget target="${dist.target}" />
</target>
<!-- ===============================================}}} -->
<!-- {{{ Target: dist.source ========================== -->
<!-- Creates a ZIP file of the plugin's source. The
name of the file is defined in the property
"src.zip.file" and will be created in the
directory defined by "install.dir". -->
<target name="dist.source">
<delete file="${install.dir}/${src.zip.file}" quiet="true" />
<zip destfile="${install.dir}/${src.zip.file}">
<fileset dir="${src.dir}">
<include name="**/*.*" />
<exclude name="${build.dir}/**" />
</fileset>
</zip>
</target>
<!-- ===============================================}}} -->
<!-- {{{ 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"
depends="javadoc,userdocs"
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-${docs-proc.target}",
where "docs-proc.target" is a property defined
above (default: xsltproc). -->
<target name="userdocs"
description="Builds the user documentation.">
<mkdir dir="${build.docs}" />
<echo file="docbook-wrapper.xsl"
message="<xsl:stylesheet" />
<echo file="docbook-wrapper.xsl"
append="true"
message=" xmlns:xsl='http://www.w3.org/1999/XSL/Transform'" />
<echo file="docbook-wrapper.xsl"
append="true"
message=" version='1.0'>" />
<echo file="docbook-wrapper.xsl"
append="true"
message="<xsl:import href='${docs.style.sheet}' />" />
<echo file="docbook-wrapper.xsl"
append="true"
message="</xsl:stylesheet>" />
<antcall target="docs-${docs-proc.target}" />
</target>
<!-- ===============================================}}} -->
<!-- {{{ 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"
if="javadoc.packagenames">
<mkdir dir="${build.javadoc}" />
<javadoc sourcepath="${src.dir}"
destdir="${build.javadoc}"
packagenames="${javadoc.packagenames}"
windowtitle="${javadoc.title}">
<classpath refid="default.class.path" />
<classpath refid="project.class.path" />
</javadoc>
</target>
<!-- ===============================================}}} -->
<!-- {{{ Target: docs-xsltproc ======================== -->
<!-- Generate docs with xsltproc tool from
www.xmlsoft.org. 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
xsltproc">
<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}" />
</exec>
<delete file="docbook.catalog" quiet="true" />
</target>
<!-- ===============================================}}} -->
<!-- {{{ Target: docs-xalan =========================== -->
<!-- Generate docs with Xalan tool from
xml.apache.org . 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}"
in="${user-doc.xml}"
out="${user-doc.out}" >
<xmlcatalog>
<dtd publicId="-//OASIS//DTD DocBook XML V4.1.2//EN"
location="${docbookx.dtd}" />
</xmlcatalog>
</style>
</target>
<!-- ===============================================}}} -->
<!-- ===============================================}}} -->
<!-- {{{ Unit testing ================================= -->
<!-- {{{ Target: test ================================= -->
<!-- Meta-task that calls the defined test target. -->
<target name="test"
description="Runs the plugin's unit tests.">
<antcall target="${unit.test.target}" />
</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
structures.
-->
<target name="test-junit"
description="Runs the plugin's jUnit tests."
if="junit.testcase,junit.jar">
<junit printsummary="${junit.printsummary}"
haltonfailure="${junit.haltonfailure}">
<classpath>
<pathelement location="${junit.jar}" />
<pathelement location="${build.classes}" />
<path refid="default.class.path" />
<path refid="project.class.path" />
</classpath>
<test name="${junit.testcase}" />
</junit>
</target>
<!-- ===============================================}}} -->
<!-- ===============================================}}} -->
<!--{{{ Dependencies ================================= -->
<!-- {{{ Target: cvs.update =========================== -->
<!-- Updates a plugin's source code from CVS. This
target expects one parameter, "plugin.name",
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"
compression="true"
cvsRsh="${cvs.rsh}"
cvsRoot="${cvs.root}"
dest="${plugins.srcdir}"
package="${plugin.name}" />
</target>
<!-- ===============================================}}} -->
<!-- {{{ 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"
if="plugin.dependencies,ant-contrib.jar">
<foreach list="${plugin.dependencies}"
target="cvs.update"
param="plugin.name"
delimiter=","
trim="true" />
</target>
<!-- ===============================================}}} -->
<!-- {{{ Target: build.dependencies =================== -->
<target name="build.dependencies"
description="Builds the needed plugins from the
available source code."
if="plugin.dependencies,ant-contrib.jar">
<foreach list="${plugin.dependencies}"
target="build.other"
param="plugin.name"
delimiter=","
trim="true" />
</target>
<!-- ===============================================}}} -->
<!-- {{{ 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 "plugin.name" parameter with the name
of the plugin's directory. -->
<target name="build.other">
<fail message="Can't find plugin: ${plugin.name}">
<condition>
<not>
<available file="${plugins.srcdir}/${plugin.name}/build.xml" />
</not>
</condition>
</fail>
<ant antfile="${plugins.srcdir}/${plugin.name}/build.xml"
target="build"
inheritAll="false"
inheritRefs="false" />
</target>
<!-- ===============================================}}} -->
<!-- ================================================== }}}-->
</project>
<?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="http://www.w3.org/1999/XSL/Transform"
version='1.0'
xmlns="http://www.w3.org/TR/xhtml1/transitional"
exclude-result-prefixes="#default">
<xsl:import href="docbook-wrapper.xsl"/>
<!-- Swing HTML control doesn't support “ and ” -->
<xsl:template match="quote">"<xsl:apply-templates/>"</xsl:template>
<xsl:template match="guibutton">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guiicon">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guilabel">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guimenu">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guimenuitem">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:template match="guisubmenu">
<xsl:call-template name="inline.boldseq"/>
</xsl:template>
<xsl:variable name="toc.list.type">ul</xsl:variable>
<xsl:variable name="shade.verbatim">1</xsl:variable>
<xsl:variable name="funcsynopsis.style">ansi</xsl:variable>
<xsl:template match="void"><xsl:apply-templates/></xsl:template>
</xsl:stylesheet>