| <?xml version="1.0"?> | |
| <project name="project" default="default"> | |
| <description> | |
| Example of a webapplication build script for RAP applications that use | |
| the equinox servlet bridge to run in a servlet container. | |
| </description> | |
| <!-- ================================= | |
| target: init | |
| ================================= --> | |
| <target name="init"> | |
| <property name="proj.dir" value="${basedir}/.." /> | |
| <!-- | |
| This script assumes that the servlet bridge project is available | |
| in the current workspace. Note: The location is hardcoded and must be | |
| adjusted to your needs. | |
| --> | |
| <property name="servletbridge.dir" | |
| value="${proj.dir}/../org.eclipse.equinox.servletbridge" /> | |
| <!-- | |
| 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="extintdemo" /> | |
| <property name="features" value="org.eclipse.epp.wizard.extintegration.war.feature" /> | |
| <!-- | |
| 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="${servletbridge.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="${servletbridge.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> | |