blob: 8d010815e11a9d6bf742f2e542e76fc6b6f1a536 [file] [log] [blame]
<?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.1.0"/>
<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}"/>
<mkdir dir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy file="${build.result.folder}/WEB-INF/lib/servlets.jar" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy file="${build.result.folder}/WEB-INF/lib/jsp.jar" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy file="${build.result.folder}/webapp.jar" todir="${destination.temp.folder}/${full.name}"/>
<copy todir="${destination.temp.folder}/${full.name}">
<fileset dir="${basedir}" includes="advanced/,basic/,WEB-INF/,*.html,*.jsp,plugin.properties,plugin.xml" excludes="WEB-INF/classes/"/>
</copy>
<!-- custom begin -->
<loadfile
property="web.xml.fragment"
srcFile="${temp.folder}/jsp.jar.src/web.xml.fragment"/>
<replace
file="${destination.temp.folder}/${full.name}/WEB-INF/web.xml"
token="&lt;!-- placeholder for JSPs web.xml --&gt;"
value="${web.xml.fragment}"
encoding="ISO-8859-1" />
<!-- custom end -->
</target>
<target name="webapp.jar" depends="init" unless="webapp.jar">
<property name="destdir" value="${temp.folder}/webapp.jar.bin"/>
<delete dir="${temp.folder}/webapp.jar.bin"/>
<mkdir dir="${temp.folder}/webapp.jar.bin"/>
<!-- compile the source code -->
<javac destdir="${temp.folder}/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.eclipse.tomcat/jasper-runtime.jar;../org.apache.xerces/xmlParserAPIs.jar;../org.eclipse.core.boot/bin">
<src path="src/"/>
</javac>
<!-- copy necessary resources -->
<copy todir="${temp.folder}/webapp.jar.bin">
<fileset dir="src/" excludes="**/*.java"/>
</copy>
<mkdir dir="${build.result.folder}"/>
<jar jarfile="${build.result.folder}/webapp.jar" basedir="${temp.folder}/webapp.jar.bin"/>
<delete dir="${temp.folder}/webapp.jar.bin"/>
</target>
<target name="webappsrc.zip" depends="init" unless="webappsrc.zip">
<mkdir dir="${build.result.folder}"/>
<zip zipfile="${build.result.folder}/webappsrc.zip" filesonly="false">
<fileset dir="src/" includes="**/*.java"/>
</zip>
</target>
<target name="WEB-INF/lib/servlets.jar" depends="init" unless="WEB-INF/lib/servlets.jar">
<property name="destdir" value="${temp.folder}/WEB-INF/lib/servlets.jar.bin"/>
<delete dir="${temp.folder}/WEB-INF/lib/servlets.jar.bin"/>
<mkdir dir="${temp.folder}/WEB-INF/lib/servlets.jar.bin"/>
<!-- compile the source code -->
<javac destdir="${temp.folder}/WEB-INF/lib/servlets.jar.bin" failonerror="false" verbose="true" debug="on" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../org.eclipse.core.runtime/runtime.jar;../org.eclipse.help/help.jar;webapp.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.eclipse.tomcat/jasper-runtime.jar;../org.apache.xerces/xmlParserAPIs.jar;../org.eclipse.core.boot/bin">
<src path="src_servlets/"/>
</javac>
<!-- copy necessary resources -->
<copy todir="${temp.folder}/WEB-INF/lib/servlets.jar.bin">
<fileset dir="src_servlets/" excludes="**/*.java"/>
</copy>
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<jar jarfile="${build.result.folder}/WEB-INF/lib/servlets.jar" basedir="${temp.folder}/WEB-INF/lib/servlets.jar.bin"/>
<delete dir="${temp.folder}/WEB-INF/lib/servlets.jar.bin"/>
</target>
<target name="WEB-INF/lib/servletssrc.zip" depends="init" unless="WEB-INF/lib/servletssrc.zip">
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<zip zipfile="${build.result.folder}/WEB-INF/lib/servletssrc.zip" filesonly="false">
<fileset dir="src_servlets/" includes="**/*.java"/>
</zip>
</target>
<target name="WEB-INF/lib/jsp.jar" depends="init" unless="WEB-INF/lib/jsp.jar">
<property name="destdir" value="${temp.folder}/WEB-INF/lib/jsp.jar.bin"/>
<delete dir="${temp.folder}/WEB-INF/lib/jsp.jar.bin"/>
<mkdir dir="${temp.folder}/WEB-INF/lib/jsp.jar.bin"/>
<!-- custom begin -->
<!-- generate java code from JSPs -->
<path id="jasper.classpath" >
<pathelement location="../org.apache.xerces/xmlParserAPIs.jar"/>
<pathelement location="../org.apache.xerces/xercesImpl.jar"/>
<pathelement location="../org.eclipse.tomcat/jasper-compiler.jar" />
<pathelement location="../org.eclipse.tomcat/jasper-runtime.jar" />
<pathelement location="../org.eclipse.tomcat/servlet.jar" />
<pathelement location="../org.eclipse.tomcat/tomcat_util.jar" />
</path>
<delete dir="${temp.folder}/jsp.jar.src"/>
<mkdir dir="${temp.folder}/jsp.jar.src"/>
<java
classname="org.apache.jasper.JspC"
fork="true"
failonerror="false"
classpathref="jasper.classpath"
output="${temp.folder}/jsp.jar.bin.log">
<arg value="-v3" />
<arg value="-d" /><arg value="${temp.folder}/jsp.jar.src" />
<arg value="-die" />
<arg value="-p" /><arg value="org.eclipse.help.internal.webapp.jsp"/>
<arg value="-webinc" /><arg value="${temp.folder}/jsp.jar.src/web.xml.fragment" />
<arg value="-webapp" /><arg value="${basedir}" />
</java>
<!-- custom end -->
<!-- compile the source code -->
<javac destdir="${temp.folder}/WEB-INF/lib/jsp.jar.bin" failonerror="false" verbose="true" debug="on" includeAntRuntime="no" bootclasspath="${bootclasspath}" classpath="../org.eclipse.core.runtime/runtime.jar;../org.eclipse.help/help.jar;webapp.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/servlets.jar;../org.eclipse.tomcat/servlet.jar;../org.eclipse.tomcat/jasper-runtime.jar;../org.apache.xerces/xmlParserAPIs.jar;../org.eclipse.core.boot/bin">
<src path="${temp.folder}/jsp.jar.src/"/>
</javac>
<!-- copy necessary resources -->
<copy todir="${temp.folder}/WEB-INF/lib/jsp.jar.bin">
<fileset dir="${temp.folder}/jsp.jar.src/" excludes="**/*.java"/>
</copy>
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<jar jarfile="${build.result.folder}/WEB-INF/lib/jsp.jar" basedir="${temp.folder}/WEB-INF/lib/jsp.jar.bin"/>
<delete dir="${temp.folder}/WEB-INF/lib/jsp.jar.bin"/>
</target>
<target name="WEB-INF/lib/jspsrc.zip" depends="init" unless="WEB-INF/lib/jspsrc.zip">
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<zip zipfile="${build.result.folder}/WEB-INF/lib/jspsrc.zip" filesonly="false">
<fileset dir="${temp.folder}/jsp.jar.src/" includes="**/*.java"/>
</zip>
</target>
<target name="build.jars" depends="init">
<available property="webapp.jar" file="${build.result.folder}/webapp.jar"/>
<antcall target="webapp.jar"/>
<available property="WEB-INF/lib/servlets.jar" file="${build.result.folder}/WEB-INF/lib/servlets.jar"/>
<antcall target="WEB-INF/lib/servlets.jar"/>
<available property="WEB-INF/lib/jsp.jar" file="${build.result.folder}/WEB-INF/lib/jsp.jar"/>
<antcall target="WEB-INF/lib/jsp.jar"/>
</target>
<target name="build.sources" depends="init">
<available property="webappsrc.zip" file="${build.result.folder}/webappsrc.zip"/>
<antcall target="webappsrc.zip"/>
<available property="WEB-INF/lib/servletssrc.zip" file="${build.result.folder}/WEB-INF/lib/servletssrc.zip"/>
<antcall target="WEB-INF/lib/servletssrc.zip"/>
<!-- custom begin -->
<!--
<available property="WEB-INF/lib/jspsrc.zip" file="${build.result.folder}/WEB-INF/lib/jspsrc.zip"/>
<antcall target="WEB-INF/lib/jspsrc.zip"/>
-->
<!-- custom end -->
</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}/WEB-INF/lib"/>
<copy file="${build.result.folder}/WEB-INF/lib/servletssrc.zip" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<!-- custom begin -->
<!--
<copy file="${build.result.folder}/WEB-INF/lib/jspsrc.zip" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
-->
<!-- custom end -->
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${build.result.folder}/webappsrc.zip" todir="${destination.temp.folder}/${full.name}"/>
<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}/WEB-INF/lib"/>
<copy file="${temp.folder}/WEB-INF/lib/servlets.jar.bin.log" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<copy file="${temp.folder}/WEB-INF/lib/jsp.jar.bin.log" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib"/>
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${temp.folder}/webapp.jar.bin.log" todir="${destination.temp.folder}/${full.name}"/>
</target>
<target name="clean" depends="init">
<delete file="${build.result.folder}/WEB-INF/lib/servlets.jar"/>
<delete file="${build.result.folder}/WEB-INF/lib/servletssrc.zip"/>
<delete file="${build.result.folder}/WEB-INF/lib/jsp.jar"/>
<delete file="${build.result.folder}/WEB-INF/lib/jspsrc.zip"/>
<delete file="${build.result.folder}/webapp.jar"/>
<delete file="${build.result.folder}/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>
</project>