blob: 80a4ba601f60f5c94038922b85d144a3a8663721 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================
Master Build File for Bean Scriting Framework.
NOTE:
This is build file for use with Jakarta Ant build tool.
PREREQUISITES:
servlet -> http://jakarta.apache.org/tomcat/
OPTIONAL ADDITIONS:
Rhino -> http://www.mozilla.org/rhino/
BUILD INSTRUCTIONS:
Ro build run java org.apache.tools.ant.Main <target>
on the directory in which this file is located with the target you want.
MOST USEFUL TARGETS:
- compile -> creates the "bsf.jar" package in "./build/lib" (default target)
- bindist -> creates the complete binary distribution
- srcdist -> creates the complete source distribution
- dist -> creates both binary and source distributions
- javadocs -> generates the docs for the whole package in "./dist/javadocs"
AUTHORS:
Nandika Jayawardana <nandika@opensource.lk>
Sanka Samaranayake <sanka@opensource.lk>
====================================================================================
-->
<project name="BSF" default="compile" basedir=".">
<target name="init">
<tstamp/>
<property name="name" value="bsf"/>
<property name="Name" value="Bean Scripting Framework"/>
<property name="version" value="3.0"/>
<property name="debug" value="off"/>
<property name="build.file" value="build.xml"/>
<property name="build.dir" value="build"/>
<property name="build.dest" value="build/classes"/>
<property name="build.javadocs" value="build/javadocs"/>
<property name="build.lib" value="build/lib"/>
<property name="bsf.classes" value ="bsf/build/classes"/>
<property name="src.dir" value="src"/>
<property name="dist.dir" value="dist"/>
<property name="dist.dir.root" value="${dist.dir}/${name}-${version}"/>
<property name="dist.bin.file" value="${dist.dir}/${name}-bin-${version}"/>
<property name="dist.src.file" value="${dist.dir}/${name}-src-${version}"/>
<property name="packages" value="javax.script.*"/>
<available property="http.present" classname="javax.servlet.Servlet"/>
<available property="rhino.present" classname="org.mozilla.javascript.Scriptable"/>
<filter token="RELEASE_DATE_TIME" value="${TODAY}/${TSTAPM}"/>
<filter token="VERSION" value="${version}}"/>
</target>
<patternset id="java.source.files">
<exclude name="**/http/**/" unless="http.present"></exclude>
<exclude name="**/javascript/**" unless="rhino.present"></exclude>
</patternset>
<!-- ========================================================================= -->
<!-- Check dependencies for compiling aditional components -->
<!-- ========================================================================= -->
<target name="check-dependencies">
<antcall target="http-check"></antcall>
<antcall target="rhino-check"></antcall>
</target>
<!-- ========================================================================= -->
<!-- Check dependencies for http contents -->
<!-- ========================================================================= -->
<target name="http-check" unless="rhino.present">
<echo>Warning : Http dependencies was not resoleved ..</echo>
</target>
<!-- ========================================================================= -->
<!-- Check dependencies for Rhino scripts -->
<!-- ========================================================================= -->
<target name="rhino-check" unless="rhino.present">
<echo>Warning : Rhino dependencies was not resoleved ..</echo>
</target>
<!-- ========================================================================= -->
<!-- Compiles source file directories -->
<!-- ========================================================================= -->
<target name="compile" depends="init,check-dependencies">
<antcall target="bsf-compile"/>
</target>
<!-- ========================================================================= -->
<!-- Compiles the wsf source file directory -->
<!-- ========================================================================= -->
<target name="bsf-compile" depends="init">
<echo>"compiles the *.java files"</echo>
<!-- ===================================================================== -->
<!-- compiles the source directoy -->
<!-- ===================================================================== -->
<mkdir dir="${build.dest}"/>
<javac srcdir="${src.dir}" destdir="${build.dest}" debug="${debug}">
<patternset refid="java.source.files"/>
</javac>
<!-- ===================================================================== -->
<!-- copies the META-INF contents -->
<!-- ===================================================================== -->
<copy todir="${build.dest}/META-INF">
<fileset dir="${src.dir}/META-INF"/>
</copy>
<!-- ===================================================================== -->
<!-- creates the jar file -->
<!-- ===================================================================== -->
<mkdir dir="${build.lib}"/>
<jar destfile="${build.lib}/${name}.jar" basedir="${build.dest}">
<manifest>
<attribute name="Created-By:" value="${user.name}"/>
</manifest>
</jar>
</target>
<!-- ========================================================================= -->
<!-- Creates a complete binary distribution -->
<!-- ========================================================================= -->
<target name="bindist" description="creates the binary distribution" depends="init">
<copy todir="${dist.dir.root}/lib">
<fileset dir="${build.lib}"/>
</copy>
<!-- ===================================================================== -->
<!-- creates the tar/gzip file -->
<!-- ===================================================================== -->
<tar destfile="${dist.bin.file}.tar" basedir="${dist.dir}" excludes="*.tar,*.gz,*.zip">
</tar>
<gzip destfile="${dist.bin.file}.tar.gz" src="${dist.bin.file}.tar"/>
<delete file="${dist.bin.file}.tar"/>
<!-- ===================================================================== -->
<!-- creates the zip file -->
<!-- ===================================================================== -->
<zip destfile="${dist.bin.file}.zip" basedir="${dist.dir}" excludes="*.zip,*.tar,*.gz"/>
</target>
<!-- ========================================================================= -->
<!-- Creates a complete source distribution -->
<!-- ========================================================================= -->
<target name="srcdist" depends="init" description="creates the source destribution">
<copy todir="${dist.dir.root}">
<fileset dir=".">
<include name="*.xml"/>
<include name="README"/>
<include name="src/**"/>
<include name="engines/**"/>
<exclude name="**/CVS/**"/>
</fileset>
</copy>
<!-- ===================================================================== -->
<!-- creates the tar/gzip file -->
<!-- ===================================================================== -->
<tar destfile="${dist.src.file}.tar" basedir="${dist.dir}" excludes="*.tar,*.tar.gz,*.zip"/>
<gzip destfile="${dist.src.file}.tar.gz" src="${dist.src.file}.tar"/>
<delete file="${dist.src.file}.tar"/>
<!-- ===================================================================== -->
<!-- creates the zip file -->
<!-- ===================================================================== -->
<zip destfile="${dist.src.file}.zip" basedir="${dist.dir}" excludes="*.zip,*.tar,*.gz"/>
</target>
<!-- ========================================================================= -->
<!-- Creates both binary and source distributions -->
<!-- ========================================================================= -->
<target name="dist" depends="bindist,srcdist" description="creates both binary and source distributions"/>
<!-- ========================================================================= -->
<!-- Clean up everything -->
<!-- ========================================================================= -->
<target name="clean" depends="init" description="clean up build, dust ..">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
</target>
<!-- ========================================================================= -->
<!-- Generate javadocs for WSF core source directory -->
<!-- ========================================================================= -->
<target name="javadocs" description="generates the API documentation" depends="init">
<javadoc packagenames="${packages}" sourcepath="${src.dir}" destdir="${build.javadocs}"
author="ture" version="false" use="true" windowtitle="${Name} API" doctitle="${Name}"/>
</target>
</project>