| <?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}/WEB-INF/lib"/> | |
| <copy file="${build.result.folder}/WEB-INF/lib/webapp.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 todir="${destination.temp.folder}/${full.name}"> | |
| <fileset dir="${basedir}" includes="advanced/,basic/,WEB-INF/,*.css,*.html,*.js,*.jsp,plugin.properties,plugin.xml,webapp.properties" excludes="cpl-v10.html,notice.html,WEB-INF/classes/"/> | |
| </copy> | |
| <!-- custom begin --> | |
| <copy file="${basedir}/web.xml" todir="${destination.temp.folder}/${full.name}/WEB-INF" overwrite="true"/> | |
| <!-- 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.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}/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="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}/WEB-INF/lib/jsp.jar.src"/> | |
| <mkdir dir="${temp.folder}/WEB-INF/lib/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.log"> | |
| <arg value="-v3" /> | |
| <arg value="-d" /><arg value="${temp.folder}/WEB-INF/lib/jsp.jar.src" /> | |
| <arg value="-die" /> | |
| <arg value="-p" /><arg value="jsp"/> | |
| <arg value="-webinc" /><arg value="${temp.folder}/WEB-INF/lib/jsp.jar.src/temp_web.xml" /> | |
| <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;../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.eclipse.tomcat/jasper-runtime.jar;../org.apache.xerces/xmlParserAPIs.jar;../org.eclipse.core.boot/bin"> | |
| <src path="${temp.folder}/WEB-INF/lib/jsp.jar.src/"/> | |
| </javac> | |
| <!-- copy necessary resources --> | |
| <copy todir="${temp.folder}/WEB-INF/lib/jsp.jar.bin"> | |
| <fileset dir="${temp.folder}/WEB-INF/lib/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}/WEB-INF/lib/jsp.jar.src/" 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="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="WEB-INF/lib/webappsrc.zip" file="${build.result.folder}/WEB-INF/lib/webappsrc.zip"/> | |
| <antcall target="WEB-INF/lib/webappsrc.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/webappsrc.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 --> | |
| <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/webapp.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"/> | |
| </target> | |
| <target name="clean" depends="init"> | |
| <delete file="${build.result.folder}/WEB-INF/lib/webapp.jar"/> | |
| <delete file="${build.result.folder}/WEB-INF/lib/webappsrc.zip"/> | |
| <delete file="${build.result.folder}/WEB-INF/lib/jsp.jar"/> | |
| <delete file="${build.result.folder}/WEB-INF/lib/jspsrc.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> |