blob: e0601b82be467fdf5e6351840c4884d5c7555efc [file] [log] [blame]
<?xml version="1.0"?>
<project name="project" default="default">
<description>
Webapp Builder
</description>
<!-- =================================
target: default
================================= -->
<target name="init">
<property name="proj.dir" value="${basedir}/.."/>
<!--
On windows be cautious about long file names for ${build.dir}
These long path problems were resolved in JRE 1.5.0_08
-->
<property name="build.dir" value="${proj.dir}/build"/>
<property name="templates.dir" value="${proj.dir}/templates"/>
<property name="webapp.name" value="bridge"/>
<!--
the servletbridge feature can be found in the eclipse depot
Repository Path: /cvsroot/eclipse
Module: equinox-incubator/org.eclipse.equinox.servletbridge.feature
-->
<property name="features" value="org.eclipse.equinox.servletbridge.feature"/>
<available file="${proj.dir}/servletbridge.jar" property="servletbridge.jar-present"/>
<!--
If you are using this script in a head-less build define the following properties:
"ignore.pdeExportFeatures" (available only in the IDE - do the feature export with PDE Build)
"ignore.servletbridge.jar" (if you're compiling or extracting the jar yourself)
-->
</target>
<!-- =================================
target: prepare
================================= -->
<target name="prepare" depends="init">
<delete dir="${build.dir}/${webapp.name}"/>
<mkdir dir="${build.dir}/${webapp.name}/WEB-INF/lib"/>
</target>
<!-- =================================
target: default
================================= -->
<target name="default" depends="copyResources, servletbridge.jar, pdeExportFeatures"/>
<!-- =================================
target: copyResources
================================= -->
<target name="copyResources" depends="prepare">
<copy todir="${build.dir}/${webapp.name}">
<fileset dir="${templates.dir}"/>
</copy>
</target>
<!-- =================================
target: servletbridge.jar
================================= -->
<target name="servletbridge.jar" depends="prepare" unless="ignore.servletbridge.jar">
<antcall target="jar-servletbridge.jar" />
<antcall target="copy-servletbridge.jar"/>
</target>
<!-- =================================
target: copy-servletbridge.jar
================================= -->
<target name="copy-servletbridge.jar" if="servletbridge.jar-present">
<copy todir="${build.dir}/${webapp.name}/WEB-INF/lib">
<fileset file="${proj.dir}/servletbridge.jar"/>
</copy>
</target>
<!-- =================================
target: jar-servletbridge.jar
================================= -->
<target name="jar-servletbridge.jar" unless="servletbridge.jar-present">
<jar destfile="${build.dir}/${webapp.name}/WEB-INF/lib/servletbridge.jar">
<fileset dir="${proj.dir}/bin">
<include name="**/*.class"/>
</fileset>
</jar>
</target>
<!-- =================================
target: pdeExportFeatures
================================= -->
<target name="pdeExportFeatures" depends="prepare" unless="ignore.pdeExportFeatures">
<!--
Features get built asynchronously but this approach is sometimes convenient.
So that the pde.exportFeatures task is available in the IDE select
"Run in the same JRE as the workspace" from the JRE tab from "Run Ant.."
-->
<pde.exportFeatures
features="${features}"
destination="${build.dir}/${webapp.name}/WEB-INF/eclipse"
exportType="directory"
useJARFormat="false"
exportSource="false"
/>
</target>
</project>