ant script to assemble an extension
From MDC
This ant script helps to package an extension
<?xml version="1.0"?>
<project name="blogmark" default="createxpi">
<property name="VERSION" value="1.3-rc1"/>
<property name="DESCRIPTION" value="New context-menu item to add
the current page in your Blogmarks"/>
<target name="createxpi" depends="createjar"
description="Assemble the final build blogmark.xpi">
<zip destfile="blogmark-${VERSION}.xpi">
<zipfileset dir="." includes="chrome/blogmark.jar" />
<zipfileset dir="." includes="install.rdf" />
</zip>
</target>
<target name="createjar" depends="templates" description="Assemble the jar">
<jar destfile="chrome/blogmark.jar">
<fileset dir="chrome/">
<include name="**/*"/>
<exclude name="**/*~"/>
<exclude name="**/*.tpl.*"/>
<exclude name="blogmark.jar"/>
</fileset>
</jar>
</target>
<target name="templates" description="Generate files from templates.">
<copy file="chrome/content/blogmark/contents.rdf.tpl.xml"
tofile="chrome/content/blogmark/contents.rdf"
overwrite="true">
<filterchain>
<replacetokens>
<token key="VERSION" value="${VERSION}"/>
<token key="DESCRIPTION" value="${DESCRIPTION}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="chrome/content/blogmark/about.xul.tpl.xml"
tofile="chrome/content/blogmark/about.xul"
overwrite="true">
<filterchain>
<replacetokens>
<token key="VERSION" value="${VERSION}"/>
</replacetokens>
</filterchain>
</copy>
<copy file="install.rdf.tpl.xml"
tofile="install.rdf"
overwrite="true">
<filterchain>
<replacetokens>
<token key="VERSION" value="${VERSION}"/>
<token key="DESCRIPTION" value="${DESCRIPTION}"/>
</replacetokens>
</filterchain>
</copy>
</target>
</project>