gecko-dev/js/rhino/build.xml

181 lines
5.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Build file for Rhino using Ant (see http://jakarta.apache.org/ant/index.html)
Requires Ant version 1.2 or later
-->
<project name="Rhino" default="help" basedir=".">
<target name="properties">
<property name="name" value="rhino"/>
<property name="Name" value="Rhino"/>
<property name="version" value="1_5R5.1pre"/>
<property name="rhino.jar" value="js.jar"/>
<property name="small-rhino.jar" value="smalljs.jar"/>
<property name="jar-compression" value="true"/>
<property name="debug" value="on"/>
<property name="build.dir" value="./build"/>
<property name="classes" value="${build.dir}/classes"/>
<property name="dist.name" value="rhino${version}"/>
<property name="dist.dir" value="${build.dir}/${dist.name}"/>
<property name="dist.src" value="${dist.dir}/src"/>
<property name="dist.toolsrc" value="${dist.dir}/toolsrc"/>
<property name="dist.examples" value="${dist.dir}/examples"/>
<property name="dist.docs" value="${dist.dir}/docs"/>
<property name="dist.apidocs" value="${dist.docs}/apidocs"/>
<property name="dist.file" value="rhino${version}.zip"/>
<property name="dist.source-only-zip" value="rhino${version}-sources.zip"/>
<property file="apiClasses.properties"/>
<property name="docsrc.dir" value="docs"/>
<property name="dist.docsrc.dir" value="src/docs"/>
</target>
<target name="init" depends="properties">
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes}"/>
<mkdir dir="${dist.dir}"/>
<mkdir dir="${dist.src}"/>
<mkdir dir="${dist.toolsrc}"/>
<mkdir dir="${dist.examples}"/>
<mkdir dir="${dist.docs}"/>
<mkdir dir="${dist.apidocs}"/>
</target>
<target name="compile" depends="init">
<ant dir="src" target="compile"/>
<ant dir="toolsrc" target="compile"/>
</target>
<target name="copy-source" depends="init">
<ant dir="src" target="copy-source"/>
<ant dir="toolsrc" target="copy-source"/>
<copy todir="${dist.dir}" file="build.xml"/>
<copy todir="${dist.dir}" file="apiClasses.properties"/>
</target>
<target name="jar" depends="compile">
<jar jarfile="${dist.dir}/${rhino.jar}"
basedir="${classes}"
manifest="src/manifest"
compress="${jar-compression}"
/>
</target>
<target name="smalljar" depends="compile">
<jar basedir="${classes}" destfile="${dist.dir}/${small-rhino.jar}"
compress="${jar-compression}">
<include name="org/mozilla/javascript/*.class"/>
<exclude name="org/mozilla/javascript/JavaAdapter*.class"/>
<exclude name="org/mozilla/javascript/Token.class"/>
<include name="org/mozilla/javascript/debug/*.class"/>
<include name="org/mozilla/javascript/resources/*.properties"/>
<include name="org/mozilla/javascript/regexp/*.class"
unless="no-regexp"/>
</jar>
</target>
<target name="copy-examples" depends="init">
<copy todir="${dist.examples}">
<fileset dir="examples" includes="*.java,*.js,*.html" />
</copy>
</target>
<target name="copy-misc" depends="init">
<tstamp/>
<filter token="datestamp" value="${TODAY}"/>
<copy todir="${dist.dir}" filtering="yes">
<fileset dir=".">
<patternset>
<include name="build-date"/>
</patternset>
</fileset>
</copy>
</target>
<target name="copy-all" depends="copy-source,copy-examples,copy-misc">
</target>
<target name="copy-docs" depends="init">
<echo message="copy from ${docsrc.dir}"/>
<copy todir="${dist.docs}">
<fileset dir="${docsrc.dir}"
includes="**/*.html,**/*.jpg,**/*.gif" />
</copy>
</target>
<target name="javadoc" depends="compile,copy-docs">
<javadoc sourcefiles="${apiClasses}"
sourcepath="src"
destdir="${dist.apidocs}"
overview="${dist.docs}/api.html"
version="true"
author="true"
public="true"
windowtitle="${Name}" />
</target>
<target name="dist" depends="deepclean,jar,copy-all,javadoc">
<delete file="${dist.file}" />
<zip zipfile="${dist.file}"
basedir="${build.dir}"
includes="**"
excludes="classes/**" />
</target>
<target name="source-zip" depends="copy-source">
<delete file="${dist.source-only-zip}" />
<zip zipfile="${dist.source-only-zip}" basedir="${build.dir}"
includes="${dist.name}/src/**,${dist.name}/toolsrc/**,${dist.name}/build.xml,${dist.name}/apiClasses.properties"/>
</target>
<target name="clean" depends="properties">
<delete quiet="true" file="${dist.dir}/${rhino.jar}"/>
<delete quiet="true" file="${dist.dir}/${small-rhino.jar}"/>
<delete quiet="true" dir="${classes}"/>
</target>
<target name="deepclean" depends="properties">
<delete quiet="true" dir="${build.dir}"/>
<delete quiet="true" file="${dist.file}"/>
<delete quiet="true" file="${dist.source-only-zip}"/>
</target>
<target name="help" depends="properties">
<echo>The following targets are available with this build file:
clean remove all compiled classes and copied property files
compile compile all classes and copy all property files
into ${classes} directory
deepclean remove all generated files and directories
dist create ${dist.file} with full Rhino distribution
help print this help
jar create ${rhino.jar} in ${dist.dir}
smalljar create ${small-rhino.jar} in ${dist.dir} with
minimalist set of Rhino classes. See footprint.html
from the doc directory for details.
javadoc generate generate Rhino API documentation
in ${dist.apidocs}
source-zip create ${dist.source-only-zip} with all Rhino
source files necessary to recreate ${rhino.jar}
</echo>
</target>
</project>