blob: 63d96b9d0b060b30f6a3c7a21ce8ff383102efd0 [file]
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.eclipse.help.webapp" default="build.jars" basedir=".">
<property name="bootclasspath" value=""/>
<property name="ws" value="win32"/>
<property name="os" value="win32"/>
<property name="arch" value="x86"/>
<target name="init" depends="properties">
<property name="plugin" value="org.eclipse.help.webapp"/>
<property name="version.suffix" value="_2.0.1"/>
<property name="full.name" value="${plugin}${version.suffix}"/>
<property name="temp.folder" value="${basedir}/temp.folder"/>
<property name="plugin.destination" value="${basedir}"/>
<property name="build.result.folder" value="${basedir}"/>
</target>
<target name="properties" if="eclipse.running">
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</target>
<target name="build.update.jar" depends="init">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<zip zipfile="${plugin.destination}/${full.name}.jar" basedir="${temp.folder}/${full.name}" filesonly="false"/>
<delete dir="${temp.folder}"/>
</target>
<target name="gather.bin.parts" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${build.result.folder}/eclipseurl.jar" todir="${destination.temp.folder}/${full.name}"/>
<mkdir dir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy file="${build.result.folder}/WEB-INF/lib/webapp.jar" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy todir="${destination.temp.folder}/${full.name}">
<fileset dir="${basedir}" includes="images/,ns4/,WEB-INF/,*.css,*.html,*.js,*.jsp,plugin.properties,plugin.xml,webapp.properties" excludes="cpl-v10.html,notice.html,WEB-INF/classes/"/>
</copy>
<!-- custom addition begin -->
<copy file="${basedir}/web.xml" todir="${destination.temp.folder}/${full.name}/WEB-INF" overwrite="true"/>
<copy file="${basedir}/jsp.jar" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<!-- custom end -->
</target>
<target name="WEB-INF/lib/webapp.jar" depends="init" unless="WEB-INF/lib/webapp.jar">
<property name="destdir" value="${temp.folder}/WEB-INF/lib/webapp.jar.bin"/>
<delete dir="${temp.folder}/WEB-INF/lib/webapp.jar.bin"/>
<mkdir dir="${temp.folder}/WEB-INF/lib/webapp.jar.bin"/>
<!-- compile the source code -->
<javac destdir="${temp.folder}/WEB-INF/lib/webapp.jar.bin" failonerror="false" verbose="true" debug="on" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../org.eclipse.core.runtime/runtime.jar;../org.eclipse.help/help.jar;../org.apache.xerces/xercesImpl.jar;../org.eclipse.help/bin;../org.apache.xerces/bin;../org.eclipse.core.runtime/bin;../org.eclipse.core.boot/boot.jar;../org.eclipse.tomcat/servlet.jar;../org.apache.xerces/xmlParserAPIs.jar;../org.eclipse.core.boot/bin">
<src path="src/"/>
</javac>
<!-- copy necessary resources -->
<copy todir="${temp.folder}/WEB-INF/lib/webapp.jar.bin">
<fileset dir="src/" excludes="**/*.java"/>
</copy>
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<jar jarfile="${build.result.folder}/WEB-INF/lib/webapp.jar" basedir="${temp.folder}/WEB-INF/lib/webapp.jar.bin"/>
<delete dir="${temp.folder}/WEB-INF/lib/webapp.jar.bin"/>
</target>
<target name="WEB-INF/lib/webappsrc.zip" depends="init" unless="WEB-INF/lib/webappsrc.zip">
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<zip zipfile="${build.result.folder}/WEB-INF/lib/webappsrc.zip" filesonly="false">
<fileset dir="src/" includes="**/*.java"/>
</zip>
</target>
<target name="eclipseurl.jar" depends="init" unless="eclipseurl.jar">
<property name="destdir" value="${temp.folder}/eclipseurl.jar.bin"/>
<delete dir="${temp.folder}/eclipseurl.jar.bin"/>
<mkdir dir="${temp.folder}/eclipseurl.jar.bin"/>
<!-- compile the source code -->
<javac destdir="${temp.folder}/eclipseurl.jar.bin" failonerror="false" verbose="true" debug="on" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../org.eclipse.core.runtime/runtime.jar;../org.eclipse.help/help.jar;../org.apache.xerces/xercesImpl.jar;../org.eclipse.help/bin;../org.apache.xerces/bin;../org.eclipse.core.runtime/bin;../org.eclipse.core.boot/boot.jar;WEB-INF/lib/webapp.jar;../org.eclipse.tomcat/servlet.jar;../org.apache.xerces/xmlParserAPIs.jar;../org.eclipse.core.boot/bin">
<src path="srcurl/"/>
</javac>
<!-- copy necessary resources -->
<copy todir="${temp.folder}/eclipseurl.jar.bin">
<fileset dir="srcurl/" excludes="**/*.java"/>
</copy>
<mkdir dir="${build.result.folder}"/>
<jar jarfile="${build.result.folder}/eclipseurl.jar" basedir="${temp.folder}/eclipseurl.jar.bin"/>
<delete dir="${temp.folder}/eclipseurl.jar.bin"/>
</target>
<target name="eclipseurlsrc.zip" depends="init" unless="eclipseurlsrc.zip">
<mkdir dir="${build.result.folder}"/>
<zip zipfile="${build.result.folder}/eclipseurlsrc.zip" filesonly="false">
<fileset dir="srcurl/" includes="**/*.java"/>
</zip>
</target>
<target name="build.jars" depends="init">
<available property="WEB-INF/lib/webapp.jar" file="${build.result.folder}/WEB-INF/lib/webapp.jar"/>
<antcall target="WEB-INF/lib/webapp.jar"/>
<available property="eclipseurl.jar" file="${build.result.folder}/eclipseurl.jar"/>
<antcall target="eclipseurl.jar"/>
</target>
<target name="build.sources" depends="init">
<available property="WEB-INF/lib/webappsrc.zip" file="${build.result.folder}/WEB-INF/lib/webappsrc.zip"/>
<antcall target="WEB-INF/lib/webappsrc.zip"/>
<available property="eclipseurlsrc.zip" file="${build.result.folder}/eclipseurlsrc.zip"/>
<antcall target="eclipseurlsrc.zip"/>
</target>
<target name="build.zips" depends="init">
</target>
<target name="gather.sources" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${build.result.folder}/eclipseurlsrc.zip" todir="${destination.temp.folder}/${full.name}"/>
<mkdir dir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy file="${build.result.folder}/WEB-INF/lib/webappsrc.zip" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy todir="${destination.temp.folder}/${full.name}">
<fileset dir="${basedir}" includes="about.html"/>
</copy>
</target>
<target name="gather.logs" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${temp.folder}/eclipseurl.jar.bin.log" todir="${destination.temp.folder}/${full.name}"/>
<mkdir dir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy file="${temp.folder}/WEB-INF/lib/webapp.jar.bin.log" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
</target>
<target name="clean" depends="init">
<delete file="${build.result.folder}/eclipseurl.jar"/>
<delete file="${build.result.folder}/eclipseurlsrc.zip"/>
<delete file="${build.result.folder}/WEB-INF/lib/webapp.jar"/>
<delete file="${build.result.folder}/WEB-INF/lib/webappsrc.zip"/>
<delete file="${plugin.destination}/${full.name}.jar"/>
<delete file="${plugin.destination}/${full.name}.zip"/>
<delete dir="${temp.folder}"/>
</target>
<target name="refresh" depends="init" if="eclipse.running">
<eclipse.refreshLocal resource="${plugin}" depth="infinite"/>
</target>
<target name="zip.plugin" depends="init">
<delete dir="${temp.folder}"/>
<mkdir dir="${temp.folder}"/>
<antcall target="build.jars"/>
<antcall target="build.sources"/>
<antcall target="gather.bin.parts">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<antcall target="gather.sources">
<param name="destination.temp.folder" value="${temp.folder}/"/>
</antcall>
<delete>
<fileset dir="${temp.folder}" includes="**/*.bin.log"/>
</delete>
<zip zipfile="${plugin.destination}/${full.name}.zip" basedir="${temp.folder}" filesonly="true"/>
<delete dir="${temp.folder}"/>
</target>
<!-- *** Precompilation of JSPs *** -->
<target name="precompile.init" depends="init">
<property name="precompile.result.folder" value="${build.result.folder}"/>
<property name="precompile.temp.folder" value="${temp.folder}.precompile"/>
<property name="precompile.java.folder" value="${precompile.temp.folder}/java"/>
<property name="precompile.classes.folder" value="${precompile.temp.folder}/classes"/>
<property name="tomcat.home" value="d:\jakarta-tomcat-4.0.4"/>
<path id="jasper.classpath" >
<pathelement location="${basedir}/WEB-INF/classes"/>
<pathelement location="${basedir}/WEB-INF/lib/webapp.jar" />
<pathelement location="${tomcat.home}/common/lib/xerces.jar"/>
<pathelement location="${tomcat.home}/server/lib/catalina.jar" />
<pathelement location="${tomcat.home}/common/lib/servlet.jar" />
<pathelement location="${tomcat.home}/lib/jasper-compiler.jar" />
<pathelement location="${tomcat.home}/lib/jasper-runtime.jar" />
<pathelement location="${tomcat.home}/server/lib/tomcat_util.jar" />
</path>
</target>
<target name="precompile.jar" depends="precompile.init,precompile.javac">
<jar jarfile="${precompile.result.folder}/jsp.jar"
basedir="${precompile.classes.folder}"
includes="**"/>
<delete dir="${precompile.temp.folder}"/>
</target>
<target name="precompile.javac" depends="precompile.init,precompile.jspc">
<mkdir dir="${precompile.classes.folder}"/>
<javac srcdir="${precompile.java.folder}"
destdir="${precompile.classes.folder}"
debug="false"
deprecation="false"
optimize="false"
failonerror="true"
includes="**/*.java">
<classpath refid="jasper.classpath" />
</javac>
</target>
<target name="precompile.jspc" depends="precompile.init">
<mkdir dir="${precompile.java.folder}"/>
<java
taskname="jasper"
classname="org.apache.jasper.JspC"
fork="true"
failonerror="true"
classpathref="jasper.classpath">
<arg value="-v3" />
<arg value="-d" /><arg value="${precompile.java.folder}" />
<arg value="-die" />
<arg value="-p" /><arg value="jsp"/>
<arg value="-webinc" /><arg value="${precompile.temp.folder}/temp_web.xml" />
<arg value="-webapp" /><arg value="${basedir}" />
</java>
</target>
<target name="precompile.clean" depends="precompile.init">
<delete dir="${precompile.temp.folder}"/>
<delete file="${precompile.result.folder}/jsp.jar"/>
</target>
</project>