blob: 6838a5f70c5d743c87713de149fab0b902292df5 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<project name="org.eclipse.help.webapp" default="build.jars" basedir=".">
<property name="basews" value="${ws}"/>
<property name="baseos" value="${os}"/>
<property name="basearch" value="${arch}"/>
<property name="basenl" value="${nl}"/>
<!-- Compiler settings. -->
<property name="javacFailOnError" value="false"/>
<property name="javacDebugInfo" value="on"/>
<property name="javacVerbose" value="false"/>
<property name="javacSource" value="1.3"/>
<property name="javacTarget" value="1.2"/>
<property name="compilerArg" value=""/>
<property name="logExtension" value=".log"/>
<path id="path_bootclasspath">
<fileset dir="${java.home}/lib">
<include name="*.jar"/>
</fileset>
</path>
<property name="bootclasspath" refid="path_bootclasspath"/>
<property name="fragment" value="org.eclipse.help.webapp"/>
<property name="version.suffix" value="3.2.0"/>
<property name="full.name" value="${fragment}_${version.suffix}"/>
<target name="init" depends="properties">
<condition property="pluginTemp" value="${buildTempFolder}/plugins">
<isset property="buildTempFolder"/>
</condition>
<property name="pluginTemp" value="${basedir}"/>
<condition property="build.result.folder" value="${pluginTemp}/org.eclipse.help.webapp">
<isset property="buildTempFolder"/>
</condition>
<property name="build.result.folder" value="${basedir}"/>
<property name="temp.folder" value="${basedir}/temp.folder"/>
<property name="plugin.destination" 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" description="Build the plug-in: org.eclipse.help.webapp for an update site.">
<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 destfile="${plugin.destination}/${full.name}.jar" basedir="${temp.folder}/${full.name}" filesonly="false" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
<target name="webapp.jar" depends="init" unless="webapp.jar" description="Create jar: webapp.jar.">
<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="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" source="${javacSource}" target="${javacTarget}" >
<compilerarg line="${compilerArg}"/>
<classpath>
<pathelement path="../org.eclipse.help.base/bin"/>
<pathelement path="../org.eclipse.help.base/@dot"/>
<pathelement path="../org.apache.lucene/bin"/>
<pathelement path="../org.apache.lucene/lucene-1.4.3.jar"/>
<pathelement path="../org.apache.lucene/parser.jar"/>
<pathelement path="../org.eclipse.help/bin"/>
<pathelement path="../org.eclipse.help/@dot"/>
<pathelement path="../org.eclipse.core.runtime"/>
<pathelement path="../org.eclipse.core.runtime/@dot"/>
<pathelement path="../org.eclipse.equinox.common"/>
<pathelement path="../org.eclipse.equinox.common/@dot"/>
<pathelement path="../org.eclipse.equinox.preferences"/>
<pathelement path="../org.eclipse.equinox.preferences/@dot"/>
<pathelement path="../org.eclipse.osgi"/>
<pathelement path="../org.eclipse.osgi/@dot"/>
<pathelement path="../org.eclipse.help.appserver/bin"/>
<pathelement path="../org.eclipse.help.appserver/@dot"/>
<pathelement path="../org.eclipse.osgi/bin"/>
<pathelement path="../org.eclipse.core.runtime/bin"/>
<pathelement path="../org.eclipse.help"/>
<pathelement path="../org.eclipse.help.base"/>
<pathelement path="../org.eclipse.help.appserver"/>
<pathelement path="../org.eclipse.tomcat/servlet.jar"/>
<pathelement path="../org.eclipse.tomcat/jasper-runtime.jar"/>
</classpath>
<src path="src/" />
<compilerarg line="-log ${temp.folder}/webapp.jar.bin${logExtension}" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</javac>
<!-- Copy necessary resources -->
<copy todir="${temp.folder}/webapp.jar.bin" failonerror="true">
<fileset dir="src/" excludes="**/*.java, **/package.htm*" />
</copy>
<!-- custom begin -->
<copy file="${temp.folder}/webapp.jar.bin/org/eclipse/help/internal/webapp/WebappResources.properties" tofile="${temp.folder}/webapp.jar.bin/org/eclipse/help/internal/webapp/WebappResources_en.properties" />
<!-- custom end -->
<mkdir dir="${build.result.folder}"/>
<jar destfile="${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 destfile="${build.result.folder}/webappsrc.zip" filesonly="false" whenempty="skip" update="false">
<fileset dir="src/" includes="**/*.java" />
</zip>
</target>
<target name="WEB-INF/lib/servlets.jar" depends="init" unless="WEB-INF/lib/servlets.jar" description="Create jar: WEB-INF/lib/servlets.jar.">
<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="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" source="${javacSource}" target="${javacTarget}" >
<compilerarg line="${compilerArg}"/>
<classpath>
<pathelement path="../org.eclipse.help.base/bin"/>
<pathelement path="../org.eclipse.help.base/@dot"/>
<pathelement path="../org.apache.lucene/bin"/>
<pathelement path="../org.apache.lucene/lucene-1.4.3.jar"/>
<pathelement path="../org.apache.lucene/parser.jar"/>
<pathelement path="../org.eclipse.help/bin"/>
<pathelement path="../org.eclipse.help/@dot"/>
<pathelement path="../org.eclipse.core.runtime"/>
<pathelement path="../org.eclipse.core.runtime/@dot"/>
<pathelement path="../org.eclipse.equinox.common"/>
<pathelement path="../org.eclipse.equinox.common/@dot"/>
<pathelement path="../org.eclipse.equinox.preferences"/>
<pathelement path="../org.eclipse.equinox.preferences/@dot"/>
<pathelement path="../org.eclipse.osgi"/>
<pathelement path="../org.eclipse.osgi/@dot"/>
<pathelement path="../org.eclipse.help.appserver/bin"/>
<pathelement path="../org.eclipse.help.appserver/@dot"/>
<pathelement path="${build.result.folder}/bin"/>
<pathelement path="${build.result.folder}/WEB-INF/classes"/>
<pathelement path="${build.result.folder}/webapp.jar"/>
<pathelement path="../org.eclipse.osgi/bin"/>
<pathelement path="../org.eclipse.core.runtime/bin"/>
<pathelement path="../org.eclipse.help"/>
<pathelement path="../org.eclipse.help.base"/>
<pathelement path="../org.eclipse.help.appserver"/>
<pathelement path="../org.eclipse.tomcat/servlet.jar"/>
<pathelement path="../org.eclipse.tomcat/jasper-runtime.jar"/>
</classpath>
<src path="src_servlets/" />
<compilerarg line="-log ${temp.folder}/WEB-INF/lib/servlets.jar.bin${logExtension}" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
</javac>
<!-- Copy necessary resources -->
<copy todir="${temp.folder}/WEB-INF/lib/servlets.jar.bin" failonerror="true">
<fileset dir="src_servlets/" excludes="**/*.java, **/package.htm*" />
</copy>
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<jar destfile="${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 destfile="${build.result.folder}/WEB-INF/lib/servletssrc.zip" filesonly="false" whenempty="skip" update="false">
<fileset dir="src_servlets/" includes="**/*.java" />
</zip>
</target>
<target name="WEB-INF/lib/jsp.jar" depends="init" unless="WEB-INF/lib/jsp.jar" description="Create jar: WEB-INF/lib/jsp.jar.">
<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.ant/lib/ant.jar"/>
<pathelement location="../org.apache.ant/lib/optional.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}/WEB-INF/lib/jsp.jar.bin${logExtension}">
<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="${javacFailOnError}" verbose="${javacVerbose}" debug="${javacDebugInfo}" includeAntRuntime="no" bootclasspath="${bootclasspath}" source="${javacSource}" target="${javacTarget}" >
<compilerarg line="${compilerArg}"/>
<classpath>
<pathelement path="../org.eclipse.help.base/bin"/>
<pathelement path="../org.eclipse.help.base/@dot"/>
<pathelement path="../org.apache.lucene/bin"/>
<pathelement path="../org.apache.lucene/lucene-1.4.3.jar"/>
<pathelement path="../org.apache.lucene/parser.jar"/>
<pathelement path="../org.eclipse.help/bin"/>
<pathelement path="../org.eclipse.help/@dot"/>
<pathelement path="../org.eclipse.core.runtime"/>
<pathelement path="../org.eclipse.core.runtime/@dot"/>
<pathelement path="../org.eclipse.equinox.common"/>
<pathelement path="../org.eclipse.equinox.common/@dot"/>
<pathelement path="../org.eclipse.equinox.preferences"/>
<pathelement path="../org.eclipse.equinox.preferences/@dot"/>
<pathelement path="../org.eclipse.osgi"/>
<pathelement path="../org.eclipse.osgi/@dot"/>
<pathelement path="../org.eclipse.help.appserver/bin"/>
<pathelement path="../org.eclipse.help.appserver/@dot"/>
<pathelement path="${build.result.folder}/bin"/>
<pathelement path="${build.result.folder}/WEB-INF/classes"/>
<pathelement path="${build.result.folder}/webapp.jar"/>
<pathelement path="${build.result.folder}/WEB-INF/lib/servlets.jar"/>
<pathelement path="../org.eclipse.osgi/bin"/>
<pathelement path="../org.eclipse.core.runtime/bin"/>
<pathelement path="../org.eclipse.help"/>
<pathelement path="../org.eclipse.help.base"/>
<pathelement path="../org.eclipse.help.appserver"/>
<pathelement path="../org.eclipse.tomcat/servlet.jar"/>
<pathelement path="../org.eclipse.tomcat/jasper-runtime.jar"/>
</classpath>
<src path="${temp.folder}/jsp.jar.src/" />
<compilerarg line="-log ${temp.folder}/WEB-INF/lib/jsp.jar.bin${logExtension}" compiler="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<!-- custom begin -->
<compilerarg value="-warn:-serial" />
<!-- custom end -->
</javac>
<!-- Copy necessary resources -->
<copy todir="${temp.folder}/WEB-INF/lib/jsp.jar.bin" failonerror="true">
<fileset dir="${temp.folder}/jsp.jar.src/" excludes="**/*.java, **/package.htm*" />
</copy>
<mkdir dir="${build.result.folder}/WEB-INF/lib"/>
<jar destfile="${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"/>
</target>
<target name="build.jars" depends="init" description="Build all the jars for the plug-in: org.eclipse.help.webapp.">
<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="gather.bin.parts" depends="init" if="destination.temp.folder">
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy todir="${destination.temp.folder}/${full.name}" failonerror="true">
<fileset dir="${build.result.folder}" includes="webapp.jar,WEB-INF/lib/servlets.jar,WEB-INF/lib/jsp.jar" excludes="WEB-INF/classes/" />
</copy>
<copy todir="${destination.temp.folder}/${full.name}" failonerror="true">
<fileset dir="${basedir}" includes="META-INF/,advanced/,basic/,WEB-INF/,*.html,*.jar,*.jsp,plugin.properties,plugin.xml,.options" 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" />
<eclipse.versionReplacer path="${destination.temp.folder}/${full.name}" version="${version.suffix}"/>
<!-- 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" failonerror="false"/>
<!-- custom begin -->
<!--
<copy file="${build.result.folder}/WEB-INF/lib/jspsrc.zip" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib" failonerror="false"/>
-->
<!-- custom end -->
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${build.result.folder}/webappsrc.zip" todir="${destination.temp.folder}/${full.name}" failonerror="false"/>
<copy todir="${destination.temp.folder}/${full.name}" failonerror="false">
<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${logExtension}" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib" failonerror="false"/>
<copy file="${temp.folder}/WEB-INF/lib/jsp.jar.bin${logExtension}" todir="${destination.temp.folder}/${full.name}/WEB-INF/lib" failonerror="false"/>
<mkdir dir="${destination.temp.folder}/${full.name}"/>
<copy file="${temp.folder}/webapp.jar.bin${logExtension}" todir="${destination.temp.folder}/${full.name}" failonerror="false"/>
</target>
<target name="clean" depends="init" description="Clean the plug-in: org.eclipse.help.webapp of all the zips, jars and logs created.">
<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" description="Refresh this folder.">
<eclipse.convertPath fileSystemPath="d:/runtime-workspacePDE/org.eclipse.help.webapp" property="resourcePath"/>
<eclipse.refreshLocal resource="${resourcePath}" depth="infinite"/>
</target>
<target name="zip.plugin" depends="init" description="Create a zip containing all the elements for the plug-in: org.eclipse.help.webapp.">
<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${logExtension}" />
</delete>
<zip destfile="${plugin.destination}/${full.name}.zip" basedir="${temp.folder}" filesonly="true" whenempty="skip" update="false"/>
<delete dir="${temp.folder}"/>
</target>
</project>