Commit d5c789f6 authored by Derek DeMoro's avatar Derek DeMoro Committed by derek

Update build to allow for jsp compiling.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1467 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4bfa38f4
...@@ -28,13 +28,19 @@ ...@@ -28,13 +28,19 @@
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties"> <taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath><pathelement location="${basedir}/build/lib/ant-contrib.jar"/></classpath> <classpath>
<pathelement location="${basedir}/build/lib/ant-contrib.jar"/>
</classpath>
</taskdef> </taskdef>
<taskdef name="subdirinfo" classname="org.jivesoftware.ant.SubDirInfoTask"> <taskdef name="subdirinfo" classname="org.jivesoftware.ant.SubDirInfoTask">
<classpath><pathelement location="${basedir}/build/lib/ant-subdirtask.jar"/></classpath> <classpath>
<pathelement location="${basedir}/build/lib/ant-subdirtask.jar"/>
</classpath>
</taskdef> </taskdef>
<taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"> <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask">
<classpath><pathelement location="${basedir}/build/lib/xmltask.jar"/></classpath> <classpath>
<pathelement location="${basedir}/build/lib/xmltask.jar"/>
</classpath>
</taskdef> </taskdef>
<!-- <!--
...@@ -45,126 +51,126 @@ ...@@ -45,126 +51,126 @@
<!-- GLOBAL PROPERTIES --> <!-- GLOBAL PROPERTIES -->
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
<property name="version.major" value="2" /> <property name="version.major" value="2"/>
<property name="version.minor" value="1" /> <property name="version.minor" value="1"/>
<property name="version.revision" value="4" /> <property name="version.revision" value="4"/>
<property name="version.extra" value="" /> <!-- For 'beta' or 'alpha' --> <property name="version.extra" value=""/> <!-- For 'beta' or 'alpha' -->
<property name="dist.prefix" value="jive_messenger" /> <property name="dist.prefix" value="jive_messenger"/>
<property file="${basedir}/build/build.properties" /> <property file="${basedir}/build/build.properties"/>
<property name="src.dir" value="${basedir}/src" /> <property name="src.dir" value="${basedir}/src"/>
<property name="src.java.dir" value="${src.dir}/java" /> <property name="src.java.dir" value="${src.dir}/java"/>
<property name="src.i18n.dir" value="${src.dir}/i18n" /> <property name="src.i18n.dir" value="${src.dir}/i18n"/>
<property name="src.test.dir" value="${src.dir}/test" /> <property name="src.test.dir" value="${src.dir}/test"/>
<property name="src.test.java.dir" value="${src.test.dir}/java" /> <property name="src.test.java.dir" value="${src.test.dir}/java"/>
<property name="docs.dir" value="${basedir}/documentation" /> <property name="docs.dir" value="${basedir}/documentation"/>
<property name="web.dir" value="${src.dir}/web" /> <property name="web.dir" value="${src.dir}/web"/>
<property name="lib.build.dir" value="${basedir}/build/lib" /> <property name="lib.build.dir" value="${basedir}/build/lib"/>
<property name="lib.build.installer.dir" value="${basedir}/build/installer" /> <property name="lib.build.installer.dir" value="${basedir}/build/installer"/>
<property name="lib.merge.dir" value="${lib.build.dir}/merge" /> <property name="lib.merge.dir" value="${lib.build.dir}/merge"/>
<property name="lib.dist.dir" value="${lib.build.dir}/dist" /> <property name="lib.dist.dir" value="${lib.build.dir}/dist"/>
<property name="lib.web.dir" value="${web.dir}/WEB-INF/lib" /> <property name="lib.web.dir" value="${web.dir}/WEB-INF/lib"/>
<property name="i18n.basename" value="messenger_i18n" /> <property name="i18n.basename" value="messenger_i18n"/>
<property name="i18n.default.locale" value="en" /> <property name="i18n.default.locale" value="en"/>
<property name="target.dir" value="${basedir}/target" /> <property name="target.dir" value="${basedir}/target"/>
<property name="temp.build.dir" value="${basedir}/target/tempbuild" /> <property name="temp.build.dir" value="${basedir}/target/tempbuild"/>
<property name="target.i18n.dir" value="${temp.build.dir}/i18n" /> <property name="target.i18n.dir" value="${temp.build.dir}/i18n"/>
<property name="compile.dir" value="${target.dir}/classes" /> <property name="compile.dir" value="${target.dir}/classes"/>
<property name="jar.name" value="messenger.jar" /> <property name="jar.name" value="messenger.jar"/>
<property name="jar.starter.name" value="startup.jar" /> <property name="jar.starter.name" value="startup.jar"/>
<property name="jar.dest.dir" value="${target.dir}/lib" /> <property name="jar.dest.dir" value="${target.dir}/lib"/>
<property name="resources.dir" value="${src.dir}/resources" /> <property name="resources.dir" value="${src.dir}/resources"/>
<property name="javadoc.src.dir" value="${src.dir}/javadoc" /> <property name="javadoc.src.dir" value="${src.dir}/javadoc"/>
<property name="javadoc.dest.dir" value="${target.dir}/javadoc" /> <property name="javadoc.dest.dir" value="${target.dir}/javadoc"/>
<property name="jspc.dest.dir" value="${target.dir}/jspc" /> <property name="jspc.dest.dir" value="${target.dir}/jspc"/>
<property name="jspc.java.dest.dir" value="${target.dir}/jspc/java" /> <property name="jspc.java.dest.dir" value="${target.dir}/jspc/java"/>
<property name="jspc.classes.dest.dir" value="${target.dir}/jspc/classes" /> <property name="jspc.classes.dest.dir" value="${target.dir}/jspc/classes"/>
<property name="jspc.jar.name" value="admin-jsp.jar" /> <property name="jspc.jar.name" value="admin-jsp.jar"/>
<property name="test.dest.dir" value="${target.dir}/test" /> <property name="test.dest.dir" value="${target.dir}/test"/>
<property name="test.classes.dest.dir" value="${test.dest.dir}/classes" /> <property name="test.classes.dest.dir" value="${test.dest.dir}/classes"/>
<property name="test.results.dest.dir" value="${test.dest.dir}/results" /> <property name="test.results.dest.dir" value="${test.dest.dir}/results"/>
<property name="plugin.src.dir" value="${src.dir}/plugins" /> <property name="plugin.src.dir" value="${src.dir}/plugins"/>
<property name="plugin.dev.dir" value="" /> <!-- Set by a developer as alt plugin location --> <property name="plugin.dev.dir" value=""/> <!-- Set by a developer as alt plugin location -->
<property name="plugin.dev.dest.dir" value="${target.dir}/plugins-dev" /> <property name="plugin.dev.dest.dir" value="${target.dir}/plugins-dev"/>
<property name="plugin.dest.dir" value="${target.dir}/plugins" /> <property name="plugin.dest.dir" value="${target.dir}/plugins"/>
<property name="webapp.dest.dir" value="${target.dir}/webapp" /> <property name="webapp.dest.dir" value="${target.dir}/webapp"/>
<property name="war.name" value="messenger.war" /> <property name="war.name" value="messenger.war"/>
<property name="war.dest.dir" value="${target.dir}/war" /> <property name="war.dest.dir" value="${target.dir}/war"/>
<property name="release.dest.dir" value="${target.dir}/release" /> <property name="release.dest.dir" value="${target.dir}/release"/>
<property name="overwrite" value="false" /> <property name="overwrite" value="false"/>
<property name="deploy.jar.dir" value="${jar.dest.dir}" /> <property name="deploy.jar.dir" value="${jar.dest.dir}"/>
<property name="anttools.src.dir" value="${src.dir}/tools" /> <property name="anttools.src.dir" value="${src.dir}/tools"/>
<property name="anttools.target.dir" value="${target.dir}/tools" /> <property name="anttools.target.dir" value="${target.dir}/tools"/>
<property name="copy.dbscripts" value="true" /> <property name="copy.dbscripts" value="true"/>
<property name="whack.src" value="${target.dir}/whack" /> <property name="whack.src" value="${target.dir}/whack"/>
<property name="installer.install4j.home" value="c:\\Program Files\\install4j" /> <property name="installer.install4j.home" value="c:\\Program Files\\install4j"/>
<property name="installer.src" value="${basedir}/build/installer" /> <property name="installer.src" value="${basedir}/build/installer"/>
<property name="installer.dest.dir" value="${release.dest.dir}/installers" /> <property name="installer.dest.dir" value="${release.dest.dir}/installers"/>
<property name="installer.install4j.srcfile" value="${installer.src}/messenger.install4j" /> <property name="installer.install4j.srcfile" value="${installer.src}/messenger.install4j"/>
<property name="installer.app_name" value="Jive Messenger" /> <property name="installer.app_name" value="Jive Messenger"/>
<property name="installer.app_short_name" value="jive_messenger" /> <property name="installer.app_short_name" value="jive_messenger"/>
<property name="installer.product_name" value="messenger" /> <property name="installer.product_name" value="messenger"/>
<property name="installer.application_id" value="6886-9911-0474-3571"/> <property name="installer.application_id" value="6886-9911-0474-3571"/>
<property name="installer.unix_install_dir" value="jive_messenger"/> <property name="installer.unix_install_dir" value="jive_messenger"/>
<property name="installer.windows_install_dir" value="Jive Messenger"/> <property name="installer.windows_install_dir" value="Jive Messenger"/>
<property name="installer.publisher" value="Jive Software" /> <property name="installer.publisher" value="Jive Software"/>
<property name="installer.publisher_url" value="www.jivesoftware.org" /> <property name="installer.publisher_url" value="www.jivesoftware.org"/>
<property name="installer.file_prefix" value="${installer.app_short_name}" /> <property name="installer.file_prefix" value="${installer.app_short_name}"/>
<property name="installer.release_root_path" value="${release.dest.dir}" /> <property name="installer.release_root_path" value="${release.dest.dir}"/>
<property name="license.file.path" value="${docs.dir}/dist" /> <property name="license.file.path" value="${docs.dir}/dist"/>
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
<!-- PATHs / PATTERNSETs / FILTERSETs --> <!-- PATHs / PATTERNSETs / FILTERSETs -->
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
<path id="javadoc.dependencies"> <path id="javadoc.dependencies">
<fileset dir="${lib.build.dir}" includes="*.jar" excludes="junit.jar" /> <fileset dir="${lib.build.dir}" includes="*.jar" excludes="junit.jar"/>
<fileset dir="${lib.merge.dir}" includes="*.jar" /> <fileset dir="${lib.merge.dir}" includes="*.jar"/>
<fileset dir="${lib.dist.dir}" includes="servlet.jar, mail.jar, activation.jar" /> <fileset dir="${lib.dist.dir}" includes="servlet.jar, mail.jar, activation.jar"/>
</path> </path>
<path id="compile.dependencies"> <path id="compile.dependencies">
<path refid="javadoc.dependencies" /> <path refid="javadoc.dependencies"/>
</path> </path>
<path id="jspc.dependencies"> <path id="jspc.dependencies">
<path refid="compile.dependencies" /> <path refid="compile.dependencies"/>
<fileset dir="${lib.web.dir}" includes="*.jar" /> <fileset dir="${lib.web.dir}" includes="*.jar"/>
</path> </path>
<path id="test.dependencies"> <path id="test.dependencies">
<path refid="compile.dependencies" /> <path refid="compile.dependencies"/>
<fileset dir="${jar.dest.dir}" includes="messenger.jar" /> <fileset dir="${jar.dest.dir}" includes="messenger.jar"/>
<fileset dir="${lib.build.dir}" includes="junit.jar" /> <fileset dir="${lib.build.dir}" includes="junit.jar"/>
<fileset dir="${jar.dest.dir}" includes="messenger.jar" /> <fileset dir="${jar.dest.dir}" includes="messenger.jar"/>
<!-- <fileset dir="${ant.home}/lib" includes="clover.jar" /> --> <!-- <fileset dir="${ant.home}/lib" includes="clover.jar" /> -->
</path> </path>
<path id="plugin.dependencies"> <path id="plugin.dependencies">
<path refid="javadoc.dependencies" /> <path refid="javadoc.dependencies"/>
<fileset dir="${jar.dest.dir}" includes="messenger.jar" /> <fileset dir="${jar.dest.dir}" includes="messenger.jar"/>
</path> </path>
<patternset id="compile.sources"> <patternset id="compile.sources">
<include name="**/*.java" /> <include name="**/*.java"/>
</patternset> </patternset>
<patternset id="test.sources"> <patternset id="test.sources">
<include name="**/*Test.java" /> <include name="**/*Test.java"/>
</patternset> </patternset>
<patternset id="web.sources"> <patternset id="web.sources">
<include name="**/*.jsp" /> <include name="**/*.jsp"/>
<include name="**/*.jar" /> <include name="**/*.jar"/>
<include name="**/*.tld" /> <include name="**/*.tld"/>
<include name="**/*.jspf" /> <include name="**/*.jspf"/>
<include name="**/*.html" /> <include name="**/*.html"/>
<include name="**/*.css" /> <include name="**/*.css"/>
<include name="**/*.gif" /> <include name="**/*.gif"/>
<include name="**/*.png" /> <include name="**/*.png"/>
</patternset> </patternset>
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
...@@ -172,59 +178,67 @@ ...@@ -172,59 +178,67 @@
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
<!-- all =================================================================================== --> <!-- all =================================================================================== -->
<target name="all" depends="jar, javadoc" description="Calls jar and javadoc targets" /> <target name="all" depends="jar, javadoc" description="Calls jar and javadoc targets"/>
<!-- init ================================================================================== --> <!-- init ================================================================================== -->
<target name="init"> <target name="init">
<!-- Check for min build requirements --> <!-- Check for min build requirements -->
<condition property="ant.not.ok" value="true"><not><contains string="${ant.version}" substring="1.6" /></not></condition> <condition property="ant.not.ok" value="true">
<condition property="java.not.ok" value="true"><not><contains string="${ant.java.version}" substring="1.5" /></not></condition> <not>
<fail if="ant.not.ok" message="Must use Ant 1.6.x to build Jive Messenger" /> <contains string="${ant.version}" substring="1.6"/>
<fail if="java.not.ok" message="Must use JDK 1.5.x to build Jive Messenger" /> </not>
</condition>
<condition property="java.not.ok" value="true">
<not>
<contains string="${ant.java.version}" substring="1.5"/>
</not>
</condition>
<fail if="ant.not.ok" message="Must use Ant 1.6.x to build Jive Messenger"/>
<fail if="java.not.ok" message="Must use JDK 1.5.x to build Jive Messenger"/>
<tstamp /> <tstamp/>
<tstamp> <tstamp>
<format property="builddate" pattern="MM/dd/yyyy" /> <format property="builddate" pattern="MM/dd/yyyy"/>
</tstamp> </tstamp>
<tstamp> <tstamp>
<format property="dailybuild.tstamp" pattern="yyyy-MM-dd" locale="en"/> <format property="dailybuild.tstamp" pattern="yyyy-MM-dd" locale="en"/>
</tstamp> </tstamp>
<mkdir dir="${target.dir}" /> <mkdir dir="${target.dir}"/>
<!-- Setup the full version property correctly --> <!-- Setup the full version property correctly -->
<if> <if>
<equals arg1="${version.extra}" arg2="" /> <equals arg1="${version.extra}" arg2=""/>
<then> <then>
<property name="version" value="${version.major}.${version.minor}.${version.revision}" /> <property name="version" value="${version.major}.${version.minor}.${version.revision}"/>
<property name="version.filename" value="${version.major}_${version.minor}_${version.revision}" /> <property name="version.filename" value="${version.major}_${version.minor}_${version.revision}"/>
</then> </then>
<else> <else>
<property name="version" value="${version.major}.${version.minor}.${version.revision}.${version.extra}" /> <property name="version" value="${version.major}.${version.minor}.${version.revision}.${version.extra}"/>
<property name="version.filename" value="${version.major}_${version.minor}_${version.revision}_${version.extra}" /> <property name="version.filename" value="${version.major}_${version.minor}_${version.revision}_${version.extra}"/>
</else> </else>
</if> </if>
<!-- Extract the source from the whack jar --> <!-- Extract the source from the whack jar -->
<unjar src="${lib.merge.dir}/whack.jar" dest="${whack.src}"> <unjar src="${lib.merge.dir}/whack.jar" dest="${whack.src}">
<patternset includes="org/xmpp/**/*.java" /> <patternset includes="org/xmpp/**/*.java"/>
</unjar> </unjar>
</target> </target>
<!-- compile =============================================================================== --> <!-- compile =============================================================================== -->
<target name="compile" depends="init" description="Compiles Messenger app code"> <target name="compile" depends="init" description="Compiles Messenger app code">
<mkdir dir="${compile.dir}" /> <mkdir dir="${compile.dir}"/>
<javac <javac
destdir="${compile.dir}" destdir="${compile.dir}"
includeAntRuntime="no" includeAntRuntime="no"
debug="on" debug="on"
source="1.5" source="1.5"
> >
<src path="${src.java.dir}" /> <src path="${src.java.dir}"/>
<patternset refid="compile.sources" /> <patternset refid="compile.sources"/>
<classpath> <classpath>
<path refid="compile.dependencies" /> <path refid="compile.dependencies"/>
</classpath> </classpath>
</javac> </javac>
</target> </target>
...@@ -233,26 +247,62 @@ ...@@ -233,26 +247,62 @@
<!-- Note, this is a "private" target - no need to call it externally --> <!-- Note, this is a "private" target - no need to call it externally -->
<target name="-i18n"> <target name="-i18n">
<!-- Auto generates a default base i18n file --> <!-- Auto generates a default base i18n file -->
<mkdir dir="${target.i18n.dir}" /> <mkdir dir="${target.i18n.dir}"/>
<copy file="${src.i18n.dir}/${i18n.basename}_${i18n.default.locale}.properties" <copy file="${src.i18n.dir}/${i18n.basename}_${i18n.default.locale}.properties"
tofile="${target.i18n.dir}/${i18n.basename}.properties" /> tofile="${target.i18n.dir}/${i18n.basename}.properties"/>
</target>
<target name="plugins-dev">
<!-- Setup Messenger -->
<ant antfile="${basedir}/build/build.xml" dir="${basedir}" target="jar" inheritAll="false" inheritRefs="false"/>
<copy file="${java.home}/../lib/tools.jar" todir="${jar.dest.dir}"></copy>
<copy file="${ant.home}/lib/ant.jar" todir="${jar.dest.dir}"></copy>
<!-- Retrieve each plugin -->
<!-- Get a list of subdirs of the main plugins dir. This tells us which plugins to make.
<subdirinfo dir="${plugin.src.dir}" property="dirlist" ifexists="plugin.xml" except="admin"/>
<for list="${dirlist}" param="plugin" trim="true">
<sequential>
<xmltask source="${plugin.src.dir}/@{plugin}/plugin.xml" dest="${plugin.src.dir}/@{plugin}/plugins2.xml">
<insert path="/plugin/minMessengerVersion[last()]" position="after">
<![CDATA[
<development>
<webRoot>
${java.home}
</webRoot>
<classesDir>
dafasdfdsa
</classesDir>
</development>
]]>
</insert>
</xmltask>
<jar jarfile="c:\\test\\@{plugin}.jar">
<fileset dir="${plugin.src.dir}/@{plugin}" includes="*.xml"/>
</jar>
</sequential>
</for>
-->
</target> </target>
<!-- jar =================================================================================== --> <!-- jar =================================================================================== -->
<target name="jar" depends="compile, jspc, -i18n" description="Produces Messengers jars and sets up dependencies"> <target name="jar" depends="compile, jspc, -i18n" description="Produces Messengers jars and sets up dependencies">
<mkdir dir="${jar.dest.dir}" /> <mkdir dir="${jar.dest.dir}"/>
<!-- Make main Messenger jar --> <!-- Make main Messenger jar -->
<jar jarfile="${jar.dest.dir}/${jar.name}" index="true"> <jar jarfile="${jar.dest.dir}/${jar.name}" index="true">
<fileset dir="${compile.dir}" includes="**/*.class" excludes="org/jivesoftware/messenger/starter/ServerStarter.class" /> <fileset dir="${compile.dir}" includes="**/*.class" excludes="org/jivesoftware/messenger/starter/ServerStarter.class"/>
<fileset dir="${jspc.classes.dest.dir}" includes="**/*.class" /> <fileset dir="${jspc.classes.dest.dir}" includes="**/*.class"/>
<fileset dir="${src.i18n.dir}" includes="*.properties" /> <fileset dir="${src.i18n.dir}" includes="*.properties"/>
<fileset dir="${target.i18n.dir}" includes="*.properties" /> <fileset dir="${target.i18n.dir}" includes="*.properties"/>
<fileset dir="${src.dir}" includes="database/*.sql" /> <fileset dir="${src.dir}" includes="database/*.sql"/>
<fileset dir="${src.dir}" includes="database/upgrade/**/*.sql" /> <fileset dir="${src.dir}" includes="database/upgrade/**/*.sql"/>
<fileset dir="${resources.dir}/jar" includes="admin-sidebar.xml" /> <fileset dir="${resources.dir}/jar" includes="admin-sidebar.xml"/>
<fileset dir="${lib.build.installer.dir}/images" includes="**/*.gif" /> <fileset dir="${lib.build.installer.dir}/images" includes="**/*.gif"/>
<fileset dir="${lib.build.installer.dir}/images" includes="**/*.png" /> <fileset dir="${lib.build.installer.dir}/images" includes="**/*.png"/>
<zipgroupfileset dir="${lib.merge.dir}" includes="*.jar"/> <zipgroupfileset dir="${lib.merge.dir}" includes="*.jar"/>
<manifest> <manifest>
<attribute name="Built-By" value="Jive Software (www.jivesoftware.org)"/> <attribute name="Built-By" value="Jive Software (www.jivesoftware.org)"/>
...@@ -262,75 +312,76 @@ ...@@ -262,75 +312,76 @@
<!-- Make startup jar --> <!-- Make startup jar -->
<jar jarfile="${jar.dest.dir}/${jar.starter.name}"> <jar jarfile="${jar.dest.dir}/${jar.starter.name}">
<fileset dir="${compile.dir}"> <fileset dir="${compile.dir}">
<include name="org/jivesoftware/messenger/starter/ServerStarter.class" /> <include name="org/jivesoftware/messenger/starter/ServerStarter.class"/>
<include name="org/jivesoftware/messenger/starter/JiveClassLoader*.class" /> <include name="org/jivesoftware/messenger/starter/JiveClassLoader*.class"/>
</fileset> </fileset>
<manifest> <manifest>
<attribute name="Main-Class" value="org.jivesoftware.messenger.starter.ServerStarter" /> <attribute name="Main-Class" value="org.jivesoftware.messenger.starter.ServerStarter"/>
<attribute name="Built-By" value="Jive Software (www.jivesoftware.org)"/> <attribute name="Built-By" value="Jive Software (www.jivesoftware.org)"/>
</manifest> </manifest>
</jar> </jar>
<!-- Copy application dependent files --> <!-- Copy application dependent files -->
<copy todir="${jar.dest.dir}"> <copy todir="${jar.dest.dir}">
<fileset dir="${lib.dist.dir}" includes="*.*" /> <fileset dir="${lib.dist.dir}" includes="*.*"/>
</copy> </copy>
<!-- Setup environment --> <!-- Setup environment -->
<antcall target="-prepare" /> <antcall target="-prepare"/>
</target> </target>
<!-- run =================================================================================== --> <!-- run =================================================================================== -->
<target name="run" depends="jar" description="Starts Messenger inline to the build process."> <target name="run" depends="jar" description="Starts Messenger inline to the build process.">
<condition property="run.debug" value="-Xdebug -Xint -server -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000"> <condition property="run.debug" value="-Xdebug -Xint -server -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000">
<isset property="debug" /> <isset property="debug"/>
</condition> </condition>
<java jar="${target.dir}/lib/startup.jar" fork="true" dir="${target.dir}/bin"> <java jar="${target.dir}/lib/startup.jar" fork="true" dir="${target.dir}/bin">
<jvmarg line="${run.debug}" /> <jvmarg line="${run.debug}"/>
</java> </java>
</target> </target>
<!-- deployjar ============================================================================= --> <!-- deployjar ============================================================================= -->
<target name="deployjar" depends="jar" description="Pushes JARs to specified web location."> <target name="deployjar" depends="jar" description="Pushes JARs to specified web location.">
<copy todir="${deploy.jar.dir}" overwrite="${overwrite}"> <copy todir="${deploy.jar.dir}" overwrite="${overwrite}">
<fileset dir="${jar.dest.dir}" includes="*.jar" /> <fileset dir="${jar.dest.dir}" includes="*.jar"/>
</copy> </copy>
</target> </target>
<!-- war =================================================================================== --> <!-- war =================================================================================== -->
<target name="war" depends="jar" description="Creates a WAR of Messenger"> <target name="war" depends="jar" description="Creates a WAR of Messenger">
<mkdir dir="${war.dest.dir}" /> <mkdir dir="${war.dest.dir}"/>
<mkdir dir="${war.dest.dir}/build" /> <mkdir dir="${war.dest.dir}/build"/>
<!-- Make a new web.xml file in the build dir --> <!-- Make a new web.xml file in the build dir -->
<loadfile property="startup-def" srcFile="${web.dir}/WEB-INF/web.xml.startup.servlet" /> <loadfile property="startup-def" srcFile="${web.dir}/WEB-INF/web.xml.startup.servlet"/>
<copy file="${web.dir}/WEB-INF/web.xml" toFile="${war.dest.dir}/build/web.xml" overwrite="${overwrite}"> <copy file="${web.dir}/WEB-INF/web.xml" toFile="${war.dest.dir}/build/web.xml" overwrite="${overwrite}">
<filterset begintoken="&lt;!--@@" endtoken="@@--&gt;"> <filterset begintoken="&lt;!--@@" endtoken="@@--&gt;">
<filter token="STARTUP-SERVLET" value="${startup-def}" /> <filter token="STARTUP-SERVLET" value="${startup-def}"/>
</filterset> </filterset>
</copy> </copy>
<!-- Make the war --> <!-- Make the war -->
<war destfile="${war.dest.dir}/${war.name}" basedir="${web.dir}" <war destfile="${war.dest.dir}/${war.name}" basedir="${web.dir}"
webxml="${war.dest.dir}/build/web.xml" webxml="${war.dest.dir}/build/web.xml"
excludes="WEB-INF/web.xml.startup.servlet"> excludes="WEB-INF/web.xml.startup.servlet">
<patternset refid="web.sources" /> <patternset refid="web.sources"/>
<lib dir="${jar.dest.dir}" excludes="jasper*.jar, servlet.jar" /> <lib dir="${jar.dest.dir}" excludes="jasper*.jar, servlet.jar"/>
</war> </war>
<!-- Create a Messenger home --> <!-- Create a Messenger home -->
<copy todir="${war.dest.dir}/messengerHome"> <copy todir="${war.dest.dir}/messengerHome">
<fileset dir="${target.dir}"> <fileset dir="${target.dir}">
<include name="conf/**/*.*" /> <include name="conf/**/*.*"/>
<include name="resources/**/*.*" /> <include name="resources/**/*.*"/>
</fileset> </fileset>
</copy> </copy>
<!-- Force create the logs dir (will be empty) --> <!-- Force create the logs dir (will be empty) -->
<mkdir dir="${war.dest.dir}/messengerHome/logs" /> <mkdir dir="${war.dest.dir}/messengerHome/logs"/>
</target> </target>
<!-- javadoc =============================================================================== --> <!-- javadoc =============================================================================== -->
<target name="javadoc" depends="compile" description="Produces Messenger Javadocs"> <target name="javadoc" depends="compile" description="Produces Messenger Javadocs">
<mkdir dir="${javadoc.dest.dir}" /> <mkdir dir="${javadoc.dest.dir}"/>
<antcall target="-javadoc-impl" /> <antcall target="-javadoc-impl"/>
</target><target name="-javadoc-impl" unless="no.javadoc"> </target>
<target name="-javadoc-impl" unless="no.javadoc">
<!-- Run javadoc over all source code --> <!-- Run javadoc over all source code -->
<javadoc <javadoc
...@@ -339,16 +390,16 @@ ...@@ -339,16 +390,16 @@
windowtitle="Jive Messenger ${version} Javadoc" windowtitle="Jive Messenger ${version} Javadoc"
overview="${src.java.dir}/overview.html" overview="${src.java.dir}/overview.html"
failonerror="yes" failonerror="yes"
> >
<sourcepath> <sourcepath>
<path location="${src.java.dir}" /> <path location="${src.java.dir}"/>
<path location="${whack.src}" /> <path location="${whack.src}"/>
</sourcepath> </sourcepath>
<doctitle><![CDATA[<font face="arial,helvetica,sans-serif">Jive Messenger ${version} Javadoc</font>]]></doctitle> <doctitle><![CDATA[<font face="arial,helvetica,sans-serif">Jive Messenger ${version} Javadoc</font>]]></doctitle>
<header><![CDATA[<b>Jive Messenger ${version} Javadoc</b>]]></header> <header><![CDATA[<b>Jive Messenger ${version} Javadoc</b>]]></header>
<bottom><![CDATA[<i>Copyright &copy; 1999-2004 Jive Software.</i>]]></bottom> <bottom><![CDATA[<i>Copyright &copy; 1999-2004 Jive Software.</i>]]></bottom>
<classpath> <classpath>
<path refid="javadoc.dependencies" /> <path refid="javadoc.dependencies"/>
</classpath> </classpath>
<link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="${javadoc.src.dir}/jdk15"/> <link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="${javadoc.src.dir}/jdk15"/>
</javadoc> </javadoc>
...@@ -356,21 +407,22 @@ ...@@ -356,21 +407,22 @@
<!-- jspc ================================================================================== --> <!-- jspc ================================================================================== -->
<target name="jspc" depends="compile" description="Compiles all JSP pages in the admin console"> <target name="jspc" depends="compile" description="Compiles all JSP pages in the admin console">
<mkdir dir="${jspc.dest.dir}" /> <mkdir dir="${jspc.dest.dir}"/>
<mkdir dir="${jspc.java.dest.dir}" /> <mkdir dir="${jspc.java.dest.dir}"/>
<mkdir dir="${jspc.classes.dest.dir}" /> <mkdir dir="${jspc.classes.dest.dir}"/>
<mkdir dir="${webapp.dest.dir}" /> <mkdir dir="${webapp.dest.dir}"/>
<antcall target="-jspc-impl" /> <antcall target="-jspc-impl"/>
</target><target name="-jspc-impl" unless="no.jspc"> </target>
<target name="-jspc-impl" unless="no.jspc">
<!-- Have to use Tomcat 5's JspC task, not the default Ant one --> <!-- Have to use Tomcat 5's JspC task, not the default Ant one -->
<taskdef classname="org.apache.jasper.JspC" name="jasper2" loaderref="jasperA"> <taskdef classname="org.apache.jasper.JspC" name="jasper2" loaderref="jasperA">
<classpath id="jspc.classpath"> <classpath id="jspc.classpath">
<pathelement location="${java.home}/../lib/tools.jar" /> <pathelement location="${java.home}/../lib/tools.jar"/>
<pathelement path="${compile.dir}" /> <pathelement path="${compile.dir}"/>
<path refid="jspc.dependencies" /> <path refid="jspc.dependencies"/>
</classpath> </classpath>
</taskdef> </taskdef>
...@@ -380,7 +432,7 @@ ...@@ -380,7 +432,7 @@
uriroot="${web.dir}" uriroot="${web.dir}"
outputDir="${jspc.java.dest.dir}" outputDir="${jspc.java.dest.dir}"
package="org.jivesoftware.messenger.admin" package="org.jivesoftware.messenger.admin"
webXmlFragment="${jspc.dest.dir}/web.partial.xml" /> webXmlFragment="${jspc.dest.dir}/web.partial.xml"/>
<!-- Compile java source --> <!-- Compile java source -->
<javac <javac
...@@ -389,27 +441,27 @@ ...@@ -389,27 +441,27 @@
debug="on" debug="on"
source="1.5" source="1.5"
includes="org/jivesoftware/messenger/admin/**/*.java" includes="org/jivesoftware/messenger/admin/**/*.java"
> >
<src path="${jspc.java.dest.dir}" /> <src path="${jspc.java.dest.dir}"/>
<classpath> <classpath>
<pathelement path="${compile.dir}" /> <pathelement path="${compile.dir}"/>
<path refid="jspc.dependencies" /> <path refid="jspc.dependencies"/>
</classpath> </classpath>
</javac> </javac>
<!-- Update the web.xml to include the servlet and servlet mapping defs from jspc --> <!-- Update the web.xml to include the servlet and servlet mapping defs from jspc -->
<loadfile property="servlet-xml" srcFile="${jspc.dest.dir}/web.partial.xml" /> <loadfile property="servlet-xml" srcFile="${jspc.dest.dir}/web.partial.xml"/>
<copy file="${web.dir}/WEB-INF/web.xml" <copy file="${web.dir}/WEB-INF/web.xml"
toFile="${webapp.dest.dir}/WEB-INF/web.xml" toFile="${webapp.dest.dir}/WEB-INF/web.xml"
overwrite="true"> overwrite="true">
<filterset begintoken="&lt;!--@@" endtoken="@@--&gt;"> <filterset begintoken="&lt;!--@@" endtoken="@@--&gt;">
<filter token="JSPC-SERVLETS" value="${servlet-xml}" /> <filter token="JSPC-SERVLETS" value="${servlet-xml}"/>
</filterset> </filterset>
</copy> </copy>
<!-- Create a jar of compiled servlets --> <!-- Create a jar of compiled servlets -->
<jar jarfile="${jspc.dest.dir}/${jspc.jar.name}"> <jar jarfile="${jspc.dest.dir}/${jspc.jar.name}">
<fileset dir="${jspc.classes.dest.dir}" includes="**/*.class" /> <fileset dir="${jspc.classes.dest.dir}" includes="**/*.class"/>
</jar> </jar>
</target> </target>
...@@ -432,41 +484,41 @@ ...@@ -432,41 +484,41 @@
<!-- test ================================================================================== --> <!-- test ================================================================================== -->
<target name="test" depends="jar" description="Compiles and runs test cases"> <target name="test" depends="jar" description="Compiles and runs test cases">
<!-- Compile all test code --> <!-- Compile all test code -->
<mkdir dir="${test.classes.dest.dir}" /> <mkdir dir="${test.classes.dest.dir}"/>
<javac <javac
destdir="${test.classes.dest.dir}" destdir="${test.classes.dest.dir}"
includeAntRuntime="no" includeAntRuntime="no"
debug="on" debug="on"
source="1.5" source="1.5"
> >
<src path="${src.test.java.dir}" /> <src path="${src.test.java.dir}"/>
<patternset refid="test.sources" /> <patternset refid="test.sources"/>
<classpath> <classpath>
<path refid="test.dependencies" /> <path refid="test.dependencies"/>
<pathelement path="${compile.dir}" /> <pathelement path="${compile.dir}"/>
</classpath> </classpath>
</javac> </javac>
<!-- Copy resources --> <!-- Copy resources -->
<copy todir="${test.dest.dir}"> <copy todir="${test.dest.dir}">
<fileset dir="${src.test.dir}" includes="resources/**/*.*" /> <fileset dir="${src.test.dir}" includes="resources/**/*.*"/>
</copy> </copy>
<!-- Run jUnit --> <!-- Run jUnit -->
<mkdir dir="${test.results.dest.dir}" /> <mkdir dir="${test.results.dest.dir}"/>
<junit printsummary="yes" haltonfailure="yes" fork="yes" dir="${test.dest.dir}"> <junit printsummary="yes" haltonfailure="yes" fork="yes" dir="${test.dest.dir}">
<!-- We must add our own classes to the classpath for testing --> <!-- We must add our own classes to the classpath for testing -->
<classpath> <classpath>
<path refid="test.dependencies" /> <path refid="test.dependencies"/>
<pathelement path="${test.classes.dest.dir}" /> <pathelement path="${test.classes.dest.dir}"/>
</classpath> </classpath>
<formatter type="plain" /> <formatter type="plain"/>
<batchtest todir="${test.results.dest.dir}"> <batchtest todir="${test.results.dest.dir}">
<fileset dir="${src.test.java.dir}"> <fileset dir="${src.test.java.dir}">
<patternset refid="test.sources" /> <patternset refid="test.sources"/>
</fileset> </fileset>
</batchtest> </batchtest>
</junit> </junit>
...@@ -474,7 +526,7 @@ ...@@ -474,7 +526,7 @@
<target name="-prepare"> <target name="-prepare">
<property name="prepare.out.dir" value="${target.dir}" /> <property name="prepare.out.dir" value="${target.dir}"/>
<!-- Copy lib dir --> <!-- Copy lib dir -->
<copy todir="${prepare.out.dir}/lib"> <copy todir="${prepare.out.dir}/lib">
...@@ -488,7 +540,7 @@ ...@@ -488,7 +540,7 @@
<!-- Copy database scripts --> <!-- Copy database scripts -->
<if> <if>
<equals arg1="${copy.dbscripts}" arg2="true" /> <equals arg1="${copy.dbscripts}" arg2="true"/>
<then> <then>
<copy todir="${prepare.out.dir}/resources"> <copy todir="${prepare.out.dir}/resources">
<fileset dir="${src.dir}" includes="database/**/*.sql"></fileset> <fileset dir="${src.dir}" includes="database/**/*.sql"></fileset>
...@@ -499,248 +551,252 @@ ...@@ -499,248 +551,252 @@
<!-- Copy security resources --> <!-- Copy security resources -->
<copy todir="${prepare.out.dir}/resources"> <copy todir="${prepare.out.dir}/resources">
<fileset dir="${src.dir}"> <fileset dir="${src.dir}">
<include name="security/*" /> <include name="security/*"/>
<include name="security/*.*" /> <include name="security/*.*"/>
</fileset> </fileset>
</copy> </copy>
<!-- Copy bin dir --> <!-- Copy bin dir -->
<copy todir="${prepare.out.dir}"> <copy todir="${prepare.out.dir}">
<fileset dir="${src.dir}" includes="bin/**/*" /> <fileset dir="${src.dir}" includes="bin/**/*"/>
</copy> </copy>
<fixcrlf srcdir="${prepare.out.dir}/bin" eol="lf" eof="remove" includes="*.sh,extra/*.*" /> <fixcrlf srcdir="${prepare.out.dir}/bin" eol="lf" eof="remove" includes="*.sh,extra/*.*"/>
<!-- Create a logs dir in the binary release --> <!-- Create a logs dir in the binary release -->
<mkdir dir="${prepare.out.dir}/logs" /> <mkdir dir="${prepare.out.dir}/logs"/>
<!-- Copy admin plugin source (if any) --> <!-- Copy admin plugin source (if any) -->
<copy todir="${prepare.out.dir}"> <copy todir="${prepare.out.dir}">
<fileset dir="${src.dir}" includes="plugins/admin/*.*" /> <fileset dir="${src.dir}" includes="plugins/admin/*.*"/>
</copy> </copy>
<!-- Copy admin plugin resources --> <!-- Copy admin plugin resources -->
<copy todir="${prepare.out.dir}/plugins/admin/webapp"> <copy todir="${prepare.out.dir}/plugins/admin/webapp">
<!-- All web resources minus jsp's and jspf's - those are precompiled --> <!-- All web resources minus jsp's and jspf's - those are precompiled -->
<fileset dir="${web.dir}"> <fileset dir="${web.dir}">
<patternset refid="web.sources" /> <patternset refid="web.sources"/>
<exclude name="**/*.jsp" /> <exclude name="**/*.jsp"/>
<exclude name="**/*.jspf" /> <exclude name="**/*.jspf"/>
</fileset> </fileset>
</copy> </copy>
<!-- Copy other admin WEB-INF stuff --> <!-- Copy other admin WEB-INF stuff -->
<copy todir="${prepare.out.dir}/plugins/admin/webapp"> <copy todir="${prepare.out.dir}/plugins/admin/webapp">
<fileset dir="${webapp.dest.dir}" /> <fileset dir="${webapp.dest.dir}"/>
</copy> </copy>
<!-- Copy in tag library support --> <!-- Copy in tag library support -->
<copy todir="${prepare.out.dir}/lib"> <copy todir="${prepare.out.dir}/lib">
<fileset dir="${lib.build.dir}" includes="commons-el.jar" /> <fileset dir="${lib.build.dir}" includes="commons-el.jar"/>
</copy> </copy>
<!-- Copy in pre-compiled JSP jar --> <!-- Copy in pre-compiled JSP jar -->
<copy todir="${prepare.out.dir}/plugins/admin/webapp/WEB-INF/lib"> <copy todir="${prepare.out.dir}/plugins/admin/webapp/WEB-INF/lib">
<fileset dir="${jspc.dest.dir}" includes="${jspc.jar.name}" /> <fileset dir="${jspc.dest.dir}" includes="${jspc.jar.name}"/>
</copy> </copy>
<!-- Copy in jasper runtime jar --> <!-- Copy in jasper runtime jar -->
<copy todir="${prepare.out.dir}/lib"> <copy todir="${prepare.out.dir}/lib">
<fileset dir="${lib.build.dir}" includes="jasper-runtime.jar" /> <fileset dir="${lib.build.dir}" includes="jasper-runtime.jar"/>
<fileset dir="${lib.build.dir}" includes="jasper-compiler.jar" /> <fileset dir="${lib.build.dir}" includes="jasper-compiler.jar"/>
</copy> </copy>
</target> </target>
<!-- release =============================================================================== --> <!-- release =============================================================================== -->
<target name="release" depends="jar,javadoc" description="Creates a distribution"> <target name="release" depends="jar,javadoc" description="Creates a distribution">
<mkdir dir="${release.dest.dir}" /> <mkdir dir="${release.dest.dir}"/>
<!-- Create a new prop for the final release dirs then create the dirs --> <!-- Create a new prop for the final release dirs then create the dirs -->
<!-- ie: jive_messenger --> <!-- ie: jive_messenger -->
<property name="release.name" value="${dist.prefix}" /> <property name="release.name" value="${dist.prefix}"/>
<!-- ie: jive_messenger_src --> <!-- ie: jive_messenger_src -->
<property name="release.name.src" value="${dist.prefix}_src" /> <property name="release.name.src" value="${dist.prefix}_src"/>
<!-- ie: jive_messenger_2_1_2 --> <!-- ie: jive_messenger_2_1_2 -->
<property name="release.fullname" value="${dist.prefix}_${version.filename}" /> <property name="release.fullname" value="${dist.prefix}_${version.filename}"/>
<!-- ie: jive_messenger_src_2_1_2 --> <!-- ie: jive_messenger_src_2_1_2 -->
<property name="release.fullname.src" value="${dist.prefix}_src_${version.filename}" /> <property name="release.fullname.src" value="${dist.prefix}_src_${version.filename}"/>
<property name="release.out.dir" value="${release.dest.dir}/${release.name}" /> <property name="release.out.dir" value="${release.dest.dir}/${release.name}"/>
<property name="release.src.out.dir" value="${release.dest.dir}/${release.name.src}" /> <property name="release.src.out.dir" value="${release.dest.dir}/${release.name.src}"/>
<mkdir dir="${release.out.dir}" /> <mkdir dir="${release.out.dir}"/>
<mkdir dir="${release.src.out.dir}" /> <mkdir dir="${release.src.out.dir}"/>
<!-- Copy all prepare dirs to the binary dist --> <!-- Copy all prepare dirs to the binary dist -->
<ant antfile="${basedir}/build/build.xml" target="-prepare"> <ant antfile="${basedir}/build/build.xml" target="-prepare">
<property name="prepare.out.dir" value="${release.out.dir}" /> <property name="prepare.out.dir" value="${release.out.dir}"/>
</ant> </ant>
<!-- Copy dist docs, use filtering --> <!-- Copy dist docs, use filtering -->
<copy todir="${release.out.dir}"> <copy todir="${release.out.dir}">
<fileset dir="${docs.dir}/dist" includes="*.*" excludes="LICENSE.html" /> <fileset dir="${docs.dir}/dist" includes="*.*" excludes="LICENSE.html"/>
<filterset> <filterset>
<filter token="builddate" value="${builddate}" /> <filter token="builddate" value="${builddate}"/>
<filter token="version" value="${version}" /> <filter token="version" value="${version}"/>
</filterset> </filterset>
</copy> </copy>
<copy todir="${release.src.out.dir}"> <copy todir="${release.src.out.dir}">
<fileset dir="${docs.dir}/dist" includes="*.*" excludes="LICENSE.html" /> <fileset dir="${docs.dir}/dist" includes="*.*" excludes="LICENSE.html"/>
<filterset> <filterset>
<filter token="builddate" value="${builddate}" /> <filter token="builddate" value="${builddate}"/>
<filter token="version" value="${version}" /> <filter token="version" value="${version}"/>
</filterset> </filterset>
</copy> </copy>
<!-- Copy the license --> <!-- Copy the license -->
<copy todir="${release.out.dir}" file="${license.file.path}/LICENSE.html" /> <copy todir="${release.out.dir}" file="${license.file.path}/LICENSE.html"/>
<copy todir="${release.src.out.dir}" file="${license.file.path}/LICENSE.html" /> <copy todir="${release.src.out.dir}" file="${license.file.path}/LICENSE.html"/>
<!-- Copy docs --> <!-- Copy docs -->
<copy todir="${release.out.dir}/documentation"> <copy todir="${release.out.dir}/documentation">
<fileset dir="${docs.dir}/docs" /> <fileset dir="${docs.dir}/docs"/>
<filterset> <filterset>
<filter token="version" value="${version}" /> <filter token="version" value="${version}"/>
</filterset> </filterset>
</copy> </copy>
<copy todir="${release.src.out.dir}/documentation"> <copy todir="${release.src.out.dir}/documentation">
<fileset dir="${docs.dir}/docs" /> <fileset dir="${docs.dir}/docs"/>
<filterset> <filterset>
<filter token="version" value="${version}" /> <filter token="version" value="${version}"/>
</filterset> </filterset>
</copy> </copy>
<copy todir="${release.out.dir}/documentation"> <copy todir="${release.out.dir}/documentation">
<fileset dir="${docs.dir}/docs/licenses" /> <fileset dir="${docs.dir}/docs/licenses"/>
</copy> </copy>
<copy todir="${release.src.out.dir}/documentation"> <copy todir="${release.src.out.dir}/documentation">
<fileset dir="${docs.dir}/docs/licenses" /> <fileset dir="${docs.dir}/docs/licenses"/>
</copy> </copy>
<copy todir="${release.out.dir}/documentation/images" filtering="false" overwrite="true"> <copy todir="${release.out.dir}/documentation/images" filtering="false" overwrite="true">
<fileset dir="${docs.dir}/docs/images" /> <fileset dir="${docs.dir}/docs/images"/>
</copy> </copy>
<copy todir="${release.src.out.dir}/documentation/images" filtering="false" overwrite="true"> <copy todir="${release.src.out.dir}/documentation/images" filtering="false" overwrite="true">
<fileset dir="${docs.dir}/docs/images" /> <fileset dir="${docs.dir}/docs/images"/>
</copy> </copy>
<!-- Copy Javadocs --> <!-- Copy Javadocs -->
<copy todir="${release.out.dir}/documentation/javadoc"> <copy todir="${release.out.dir}/documentation/javadoc">
<fileset dir="${javadoc.dest.dir}" /> <fileset dir="${javadoc.dest.dir}"/>
</copy> </copy>
<copy todir="${release.src.out.dir}/documentation/javadoc"> <copy todir="${release.src.out.dir}/documentation/javadoc">
<fileset dir="${javadoc.dest.dir}" /> <fileset dir="${javadoc.dest.dir}"/>
</copy> </copy>
<!-- Copy source --> <!-- Copy source -->
<copy todir="${release.src.out.dir}/src"> <copy todir="${release.src.out.dir}/src">
<fileset dir="${src.dir}"> <fileset dir="${src.dir}">
<exclude name="database/upgrade/**/*.*" /> <exclude name="database/upgrade/**/*.*"/>
</fileset> </fileset>
</copy> </copy>
<copy todir="${release.src.out.dir}/src/java"> <copy todir="${release.src.out.dir}/src/java">
<fileset dir="${whack.src}"> <fileset dir="${whack.src}">
<exclude name="org/xmpp/packet.*.java" /> <exclude name="org/xmpp/packet.*.java"/>
</fileset> </fileset>
</copy> </copy>
<!-- Weird.. have to delete the "empty" upgrade dir --> <!-- Weird.. have to delete the "empty" upgrade dir -->
<delete dir="${release.src.out.dir}/src/database/upgrade" /> <delete dir="${release.src.out.dir}/src/database/upgrade"/>
<!-- Copy the i18n files to the resources dir. This way they won't be in the jar only --> <!-- Copy the i18n files to the resources dir. This way they won't be in the jar only -->
<copy todir="${release.out.dir}/resources/i18n"> <copy todir="${release.out.dir}/resources/i18n">
<fileset dir="${target.i18n.dir}" includes="*.properties" /> <fileset dir="${target.i18n.dir}" includes="*.properties"/>
<fileset dir="${src.i18n.dir}" includes="*.properties" /> <fileset dir="${src.i18n.dir}" includes="*.properties"/>
</copy> </copy>
<copy todir="${release.src.out.dir}/resources/i18n"> <copy todir="${release.src.out.dir}/resources/i18n">
<fileset dir="${target.i18n.dir}" includes="*.properties" /> <fileset dir="${target.i18n.dir}" includes="*.properties"/>
<fileset dir="${src.i18n.dir}" includes="*.properties" /> <fileset dir="${src.i18n.dir}" includes="*.properties"/>
</copy> </copy>
<!-- Copy build --> <!-- Copy build -->
<copy todir="${release.src.out.dir}/build"> <copy todir="${release.src.out.dir}/build">
<fileset dir="${basedir}/build" /> <fileset dir="${basedir}/build"/>
</copy> </copy>
<!-- Package the release --> <!-- Package the release -->
<antcall target="release-package" /> <antcall target="release-package"/>
</target> </target>
<!-- quickrelease ========================================================================== --> <!-- quickrelease ========================================================================== -->
<target name="quickrelease" description="Makes an unpackaged release without Javadocs"> <target name="quickrelease" description="Makes an unpackaged release without Javadocs">
<antcall target="release"> <antcall target="release">
<param name="no.javadoc" value="true" /> <param name="no.javadoc" value="true"/>
<param name="no.package" value="true" /> <param name="no.package" value="true"/>
</antcall> </antcall>
</target> </target>
<!-- release-package ======================================================================= --> <!-- release-package ======================================================================= -->
<target name="release-package" unless="no.package" description="Packages a release"> <target name="release-package" unless="no.package" description="Packages a release">
<property name="package.dest.dir" value="${release.dest.dir}" /> <property name="package.dest.dir" value="${release.dest.dir}"/>
<!-- ZIP --> <!-- ZIP -->
<zip zipfile="${package.dest.dir}/${release.fullname}.zip" <zip zipfile="${package.dest.dir}/${release.fullname}.zip"
basedir="${release.out.dir}/.." basedir="${release.out.dir}/.."
includes="${release.fullname}/**/*, ${release.name}/**/*" includes="${release.fullname}/**/*, ${release.name}/**/*"
/> />
<zip zipfile="${package.dest.dir}/${release.fullname.src}.zip" <zip zipfile="${package.dest.dir}/${release.fullname.src}.zip"
basedir="${release.src.out.dir}/.." basedir="${release.src.out.dir}/.."
includes="${release.fullname.src}/**/*, ${release.name.src}/**/*" includes="${release.fullname.src}/**/*, ${release.name.src}/**/*"
/> />
<!-- TAR.GZ --> <!-- TAR.GZ -->
<tar tarfile="${package.dest.dir}/${release.fullname}.tar.gz" <tar tarfile="${package.dest.dir}/${release.fullname}.tar.gz"
basedir="${release.out.dir}/.." basedir="${release.out.dir}/.."
includes="${release.fullname}/**/*, ${release.name}/**/*" includes="${release.fullname}/**/*, ${release.name}/**/*"
compression="gzip" compression="gzip"
longfile="gnu" longfile="gnu"
/> />
<tar tarfile="${package.dest.dir}/${release.fullname.src}.tar.gz" <tar tarfile="${package.dest.dir}/${release.fullname.src}.tar.gz"
basedir="${release.src.out.dir}/.." basedir="${release.src.out.dir}/.."
includes="${release.fullname.src}/**/*, ${release.name.src}/**/*" includes="${release.fullname.src}/**/*, ${release.name.src}/**/*"
compression="gzip" compression="gzip"
longfile="gnu" longfile="gnu"
/> />
</target> </target>
<!-- dailybuild ============================================================================ --> <!-- dailybuild ============================================================================ -->
<target name="dailybuild" depends="init" description="Creates a daily build release"> <target name="dailybuild" depends="init" description="Creates a daily build release">
<property name="release.out.name" value="${dist.prefix}_${dailybuild.tstamp}" /> <property name="release.out.name" value="${dist.prefix}_${dailybuild.tstamp}"/>
<property name="release.fullname" value="${release.out.name}" /> <property name="release.fullname" value="${release.out.name}"/>
<property name="release.src.out.name" value="${dist.prefix}_src_${dailybuild.tstamp}" /> <property name="release.src.out.name" value="${dist.prefix}_src_${dailybuild.tstamp}"/>
<property name="release.fullname.src" value="${release.src.out.name}" /> <property name="release.fullname.src" value="${release.src.out.name}"/>
<property name="release.out.dir" value="${release.dest.dir}/dailybuild/${release.out.name}" /> <property name="release.out.dir" value="${release.dest.dir}/dailybuild/${release.out.name}"/>
<property name="release.src.out.dir" value="${release.dest.dir}/dailybuild/${release.src.out.name}" /> <property name="release.src.out.dir" value="${release.dest.dir}/dailybuild/${release.src.out.name}"/>
<antcall target="release"> <antcall target="release">
<param name="release.out.name" value="${release.out.name}" /> <param name="release.out.name" value="${release.out.name}"/>
<param name="release.src.out.name" value="${release.src.out.name}" /> <param name="release.src.out.name" value="${release.src.out.name}"/>
<param name="release.out.dir" value="${release.out.dir}" /> <param name="release.out.dir" value="${release.out.dir}"/>
<param name="release.src.out.dir" value="${release.src.out.dir}" /> <param name="release.src.out.dir" value="${release.src.out.dir}"/>
<param name="package.dest.dir" value="${release.dest.dir}/dailybuild" /> <param name="package.dest.dir" value="${release.dest.dir}/dailybuild"/>
</antcall> </antcall>
</target> </target>
<!-- installer ============================================================================= --> <!-- installer ============================================================================= -->
<target name="installer" depends="release" description="Creates an Install4j installer"> <target name="installer" depends="release" description="Creates an Install4j installer">
<condition property="install4j.not.ok" value="true"><not><available file="${installer.install4j.home}/bin/install4j.jar" /></not></condition> <condition property="install4j.not.ok" value="true">
<fail if="install4j.not.ok" message="Path to Install4j not set, see build.properties.template file." /> <not>
<available file="${installer.install4j.home}/bin/install4j.jar"/>
</not>
</condition>
<fail if="install4j.not.ok" message="Path to Install4j not set, see build.properties.template file."/>
<taskdef name="install4j" <taskdef name="install4j"
classname="com.install4j.Install4JTask" classname="com.install4j.Install4JTask"
classpath="${installer.install4j.home}/bin/install4j.jar" /> classpath="${installer.install4j.home}/bin/install4j.jar"/>
<mkdir dir="${installer.dest.dir}" /> <mkdir dir="${installer.dest.dir}"/>
<install4j projectfile="${installer.install4j.srcfile}" destination="${installer.dest.dir}"> <install4j projectfile="${installer.install4j.srcfile}" destination="${installer.dest.dir}">
<variable name="VERSION_MAJOR" value="${version.major}" /> <variable name="VERSION_MAJOR" value="${version.major}"/>
<variable name="VERSION_MINOR" value="${version.minor}" /> <variable name="VERSION_MINOR" value="${version.minor}"/>
<variable name="VERSION_REVISION" value="${version.revision}" /> <variable name="VERSION_REVISION" value="${version.revision}"/>
<variable name="APP_NAME" value="${installer.app_name}" /> <variable name="APP_NAME" value="${installer.app_name}"/>
<variable name="APP_SHORT_NAME" value="${installer.app_short_name}" /> <variable name="APP_SHORT_NAME" value="${installer.app_short_name}"/>
<variable name="PRODUCT_NAME" value="${installer.product_name}" /> <variable name="PRODUCT_NAME" value="${installer.product_name}"/>
<variable name="PUBLISHER" value="${installer.publisher}" /> <variable name="PUBLISHER" value="${installer.publisher}"/>
<variable name="PUBLISHER_URL" value="${installer.publisher_url}" /> <variable name="PUBLISHER_URL" value="${installer.publisher_url}"/>
<variable name="FILE_PREFIX" value="${installer.app_short_name}" /> <variable name="FILE_PREFIX" value="${installer.app_short_name}"/>
<variable name="RELEASE_ROOT_PATH" value="${installer.release_root_path}" /> <variable name="RELEASE_ROOT_PATH" value="${installer.release_root_path}"/>
<variable name="APPLICATION_ID" value="${installer.application_id}" /> <variable name="APPLICATION_ID" value="${installer.application_id}"/>
<variable name="UNIX_INSTALL_DIR" value="${installer.unix_install_dir}" /> <variable name="UNIX_INSTALL_DIR" value="${installer.unix_install_dir}"/>
<variable name="WINDOWS_INSTALL_DIR" value="${installer.windows_install_dir}" /> <variable name="WINDOWS_INSTALL_DIR" value="${installer.windows_install_dir}"/>
</install4j> </install4j>
</target> </target>
...@@ -752,38 +808,41 @@ ...@@ -752,38 +808,41 @@
--> -->
<ant antfile="${basedir}/build/build.xml" dir="${basedir}" <ant antfile="${basedir}/build/build.xml" dir="${basedir}"
target="jar" inheritAll="false" inheritRefs="false" target="jar" inheritAll="false" inheritRefs="false"
> >
<property name="no.jspc" value="true" /> <property name="no.jspc" value="true"/>
</ant> </ant>
<!-- Get a list of subdirs of the main plugins dir. This tells us which plugins to make. --> <!-- Get a list of subdirs of the main plugins dir. This tells us which plugins to make. -->
<subdirinfo dir="${plugin.src.dir}" property="dirlist" ifexists="plugin.xml" except="admin" /> <subdirinfo dir="${plugin.src.dir}" property="dirlist" ifexists="plugin.xml" except="admin"/>
<antcall target="-plugins-impl-dev" /> <antcall target="-plugins-impl-dev"/>
<antcall target="-plugins-impl" /> <antcall target="-plugins-impl"/>
</target><target name="-plugins-impl" if="dirlist"> </target>
<target name="-plugins-impl" if="dirlist">
<!-- For each plugin in the main src dir, call the 'buildplugin' macro --> <!-- For each plugin in the main src dir, call the 'buildplugin' macro -->
<for list="${dirlist}" param="plugin" trim="true"> <for list="${dirlist}" param="plugin" trim="true">
<sequential> <sequential>
<buildplugin plugin="@{plugin}" pluginsrc="${plugin.src.dir}" /> <buildplugin plugin="@{plugin}" pluginsrc="${plugin.src.dir}"/>
</sequential> </sequential>
</for> </for>
</target><target name="-plugins-impl-dev" if="plugin.dev.dir"> </target>
<target name="-plugins-impl-dev" if="plugin.dev.dir">
<!-- Get a list of plugins in the optional dev dir --> <!-- Get a list of plugins in the optional dev dir -->
<subdirinfo dir="${plugin.dev.dir}" property="dirlist2" ifexists="plugin.xml" /> <subdirinfo dir="${plugin.dev.dir}" property="dirlist2" ifexists="plugin.xml"/>
<antcall target="-plugin-impl-dev-build" /> <antcall target="-plugin-impl-dev-build"/>
</target><target name="-plugin-impl-dev-build" if="dirlist2"> </target>
<target name="-plugin-impl-dev-build" if="dirlist2">
<!-- For each list of plugins in the dev dir call the 'buildplugin' macro --> <!-- For each list of plugins in the dev dir call the 'buildplugin' macro -->
<for list="${dirlist2}" param="plugin" trim="true"> <for list="${dirlist2}" param="plugin" trim="true">
<sequential> <sequential>
<buildplugin plugin="@{plugin}" pluginsrc="${plugin.dev.dir}" /> <buildplugin plugin="@{plugin}" pluginsrc="${plugin.dev.dir}"/>
</sequential> </sequential>
</for> </for>
...@@ -791,102 +850,102 @@ ...@@ -791,102 +850,102 @@
<!-- buildplugin (MACRO) =================================================================== --> <!-- buildplugin (MACRO) =================================================================== -->
<macrodef name="buildplugin"> <macrodef name="buildplugin">
<attribute name="plugin" /> <attribute name="plugin"/>
<attribute name="pluginsrc" /> <attribute name="pluginsrc"/>
<sequential> <sequential>
<!-- For each plugin, copile code, make a jar and copy resources. --> <!-- For each plugin, copile code, make a jar and copy resources. -->
<mkdir dir="${plugin.dev.dest.dir}" /> <mkdir dir="${plugin.dev.dest.dir}"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target"/>
<!-- Compile plugin source code --> <!-- Compile plugin source code -->
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/classes" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/classes"/>
<javac <javac
destdir="${plugin.dev.dest.dir}/@{plugin}/target/classes" destdir="${plugin.dev.dest.dir}/@{plugin}/target/classes"
includeAntRuntime="no" includeAntRuntime="no"
debug="on" debug="on"
source="1.5" source="1.5"
> >
<src path="@{pluginsrc}/@{plugin}/src/java" /> <src path="@{pluginsrc}/@{plugin}/src/java"/>
<classpath> <classpath>
<path refid="plugin.dependencies" /> <path refid="plugin.dependencies"/>
<!-- Jars used by the plugin to compile with --> <!-- Jars used by the plugin to compile with -->
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar" /> <fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar"/>
</classpath> </classpath>
</javac> </javac>
<!-- Make the jar --> <!-- Make the jar -->
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/lib" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/lib"/>
<jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar"> <jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar">
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/classes" /> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/classes"/>
</jar> </jar>
<available file="@{pluginsrc}/@{plugin}/src/include" type="dir" property="@{plugin}.include.exists" /> <available file="@{pluginsrc}/@{plugin}/src/include" type="dir" property="@{plugin}.include.exists"/>
<if> <if>
<equals arg1="${@{plugin}.include.exists}" arg2="true" /> <equals arg1="${@{plugin}.include.exists}" arg2="true"/>
<then> <then>
<jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" <jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar"
update="true"> update="true">
<fileset dir="@{pluginsrc}/@{plugin}/src/include" includes="**/*.*" /> <fileset dir="@{pluginsrc}/@{plugin}/src/include" includes="**/*.*"/>
</jar> </jar>
</then> </then>
</if> </if>
<!-- Copy anything in the plugin's lib dir to the target lib dir --> <!-- Copy anything in the plugin's lib dir to the target lib dir -->
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/lib" failonerror="false"> <copy todir="${plugin.dev.dest.dir}/@{plugin}/target/lib" failonerror="false">
<fileset dir="@{pluginsrc}/@{plugin}/lib" includes="**/*.*" /> <fileset dir="@{pluginsrc}/@{plugin}/lib" includes="**/*.*"/>
</copy> </copy>
<!-- Copy anything in the plugin's lib dir to the target lib dir --> <!-- Copy anything in the plugin's lib dir to the target lib dir -->
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF" failonerror="false"> <copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF" failonerror="false">
<fileset dir="@{pluginsrc}/@{plugin}/src/web/WEB-INF" includes="web.xml" /> <fileset dir="@{pluginsrc}/@{plugin}/src/web/WEB-INF" includes="web.xml"/>
<mapper type="glob" from="web.xml" to="web-custom.xml" /> <mapper type="glob" from="web.xml" to="web-custom.xml"/>
</copy> </copy>
<!-- Copy the plugin.xml and documentation to the target dir, code below assumes it's there --> <!-- Copy the plugin.xml and documentation to the target dir, code below assumes it's there -->
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/jar" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/jar"/>
<copy todir="${plugin.dev.dest.dir}/@{plugin}/jar" failonerror="false"> <copy todir="${plugin.dev.dest.dir}/@{plugin}/jar" failonerror="false">
<fileset dir="@{pluginsrc}/@{plugin}" includes="*.xml, *.html" /> <fileset dir="@{pluginsrc}/@{plugin}" includes="*.xml, *.html"/>
</copy> </copy>
<!-- JSPC any JSP pages. Do this conditionally as there might not be a web dir. --> <!-- JSPC any JSP pages. Do this conditionally as there might not be a web dir. -->
<available property="plugin.@{plugin}.webdocs.available" <available property="plugin.@{plugin}.webdocs.available"
type="dir" file="@{pluginsrc}/@{plugin}/src/web" /> type="dir" file="@{pluginsrc}/@{plugin}/src/web"/>
<if> <if>
<equals arg1="${plugin.@{plugin}.webdocs.available}" arg2="true" /> <equals arg1="${plugin.@{plugin}.webdocs.available}" arg2="true"/>
<then> <then>
<!-- Continue with JSPC tasks... --> <!-- Continue with JSPC tasks... -->
<!-- Create output dir --> <!-- Create output dir -->
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes"/>
<!-- Copy jsp's from plugin and web.xml from messenger to a temp dir. We'll <!-- Copy jsp's from plugin and web.xml from messenger to a temp dir. We'll
not fail on an error since the web dir might not exist. not fail on an error since the web dir might not exist.
--> -->
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web"> <copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web">
<fileset dir="@{pluginsrc}/@{plugin}/src/web"> <fileset dir="@{pluginsrc}/@{plugin}/src/web">
<exclude name="WEB-INF/web.xml" /> <exclude name="WEB-INF/web.xml"/>
</fileset> </fileset>
<fileset dir="${web.dir}"> <fileset dir="${web.dir}">
<include name="WEB-INF/**/*.*" /> <include name="WEB-INF/**/*.*"/>
<exclude name="WEB-INF/web.xml" /> <exclude name="WEB-INF/web.xml"/>
<exclude name="WEB-INF/web.xml.startup.servlet" /> <exclude name="WEB-INF/web.xml.startup.servlet"/>
<exclude name="WEB-INF/classes/messenger_init.xml" /> <exclude name="WEB-INF/classes/messenger_init.xml"/>
<exclude name="WEB-INF/tmp/**/*.*" /> <exclude name="WEB-INF/tmp/**/*.*"/>
<exclude name="WEB-INF/work/**/*.*" /> <exclude name="WEB-INF/work/**/*.*"/>
</fileset> </fileset>
</copy> </copy>
<!-- Declare the jspc task with our plugin's classpath --> <!-- Declare the jspc task with our plugin's classpath -->
<taskdef classname="org.apache.jasper.JspC" name="jasper2" loaderref="jasperB"> <taskdef classname="org.apache.jasper.JspC" name="jasper2" loaderref="jasperB">
<classpath> <classpath>
<pathelement location="${java.home}/../lib/tools.jar" /> <pathelement location="${java.home}/../lib/tools.jar"/>
<pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" /> <pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar"/>
<path refid="jspc.dependencies" /> <path refid="jspc.dependencies"/>
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar" /> <fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar"/>
<pathelement path="${compile.dir}" /> <pathelement path="${compile.dir}"/>
</classpath> </classpath>
</taskdef> </taskdef>
...@@ -897,34 +956,34 @@ ...@@ -897,34 +956,34 @@
outputDir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" outputDir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java"
package="org.jivesoftware.messenger.plugin.@{plugin}" package="org.jivesoftware.messenger.plugin.@{plugin}"
webXml="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml" webXml="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml"
/> />
<!-- Use xmltask to merge the generated web.xml file and a developer one (if any) --> <!-- Use xmltask to merge the generated web.xml file and a developer one (if any) -->
<available property="plugin.@{plugin}.webxml.available" <available property="plugin.@{plugin}.webxml.available"
type="file" file="@{pluginsrc}/@{plugin}/src/web/WEB-INF/web.xml" /> type="file" file="@{pluginsrc}/@{plugin}/src/web/WEB-INF/web.xml"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF"/>
<if> <if>
<equals arg1="${plugin.@{plugin}.webxml.available}" arg2="true" /> <equals arg1="${plugin.@{plugin}.webxml.available}" arg2="true"/>
<then> <then>
<!-- Copy the servlet and servlet-mapping elements from the original web.xml to a temp buffer. <!-- Copy the servlet and servlet-mapping elements from the original web.xml to a temp buffer.
Note: The original web.xml can only contain one servlet and servlet-mapping --> Note: The original web.xml can only contain one servlet and servlet-mapping -->
<xmltask source="@{pluginsrc}/@{plugin}/src/web/WEB-INF/web.xml"> <xmltask source="@{pluginsrc}/@{plugin}/src/web/WEB-INF/web.xml">
<copy path="//web-app/servlet[last()]" buffer="foobar" /> <copy path="//web-app/servlet[last()]" buffer="foobar"/>
<copy path="//web-app/servlet-mapping[last()]" buffer="foobar2" /> <copy path="//web-app/servlet-mapping[last()]" buffer="foobar2"/>
</xmltask> </xmltask>
<!-- Add the copied servlet and servlet-mapping elements to the generated web.xml --> <!-- Add the copied servlet and servlet-mapping elements to the generated web.xml -->
<xmltask source="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml" dest="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF/web.xml"> <xmltask source="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml" dest="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF/web.xml">
<insert path="/web-app/servlet[last()]" buffer="foobar" position="after" /> <insert path="/web-app/servlet[last()]" buffer="foobar" position="after"/>
<insert path="/web-app/servlet-mapping[last()]" buffer="foobar2" position="after" /> <insert path="/web-app/servlet-mapping[last()]" buffer="foobar2" position="after"/>
</xmltask> </xmltask>
</then> </then>
<else> <else>
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF" <copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web/WEB-INF"
file="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml" /> file="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml"/>
</else> </else>
</if> </if>
...@@ -935,19 +994,19 @@ ...@@ -935,19 +994,19 @@
debug="on" debug="on"
source="1.5" source="1.5"
includes="org/jivesoftware/messenger/plugin/**/*.java" includes="org/jivesoftware/messenger/plugin/**/*.java"
> >
<src path="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" /> <src path="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java"/>
<classpath> <classpath>
<path refid="jspc.dependencies" /> <path refid="jspc.dependencies"/>
<pathelement path="${compile.dir}" /> <pathelement path="${compile.dir}"/>
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar" /> <fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar"/>
<pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" /> <pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar"/>
</classpath> </classpath>
</javac> </javac>
<!-- Make a jar of compiled jsp classes --> <!-- Make a jar of compiled jsp classes -->
<jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}-jspc.jar"> <jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}-jspc.jar">
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes" includes="**/*.class" /> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes" includes="**/*.class"/>
</jar> </jar>
</then> </then>
...@@ -956,30 +1015,30 @@ ...@@ -956,30 +1015,30 @@
<!-- Copy everything else to Messenger's plugin dir --> <!-- Copy everything else to Messenger's plugin dir -->
<copy todir="${plugin.dev.dest.dir}/@{plugin}/jar"> <copy todir="${plugin.dev.dest.dir}/@{plugin}/jar">
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target"> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/target">
<include name="lib/*.jar" /> <include name="lib/*.jar"/>
<include name="web/WEB-INF/web.xml" /> <include name="web/WEB-INF/web.xml"/>
<include name="web/WEB-INF/web-custom.xml" /> <include name="web/WEB-INF/web-custom.xml"/>
</fileset> </fileset>
<fileset dir="@{pluginsrc}/@{plugin}"> <fileset dir="@{pluginsrc}/@{plugin}">
<include name="classes/**/*.*" /> <include name="classes/**/*.*"/>
</fileset> </fileset>
<fileset dir="@{pluginsrc}/@{plugin}/src"> <fileset dir="@{pluginsrc}/@{plugin}/src">
<include name="web/**/*.*" /> <include name="web/**/*.*"/>
<exclude name="web/WEB-INF/web.xml" /> <exclude name="web/WEB-INF/web.xml"/>
<exclude name="web/**/*.jsp" /> <exclude name="web/**/*.jsp"/>
<exclude name="web/**/*.jspf" /> <exclude name="web/**/*.jspf"/>
<exclude name="web/**/*.html" /> <exclude name="web/**/*.html"/>
<exclude name="java/**/*.java" /> <exclude name="java/**/*.java"/>
</fileset> </fileset>
</copy> </copy>
<!-- Jar the plugin --> <!-- Jar the plugin -->
<jar jarfile="${plugin.dest.dir}/@{plugin}.jar"> <jar jarfile="${plugin.dest.dir}/@{plugin}.jar">
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/jar" /> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/jar"/>
</jar> </jar>
<!-- Delete the exploded plugin --> <!-- Delete the exploded plugin -->
<delete dir="${plugin.dev.dest.dir}/@{plugin}/jar" /> <delete dir="${plugin.dev.dest.dir}/@{plugin}/jar"/>
</sequential> </sequential>
</macrodef> </macrodef>
...@@ -987,46 +1046,46 @@ ...@@ -987,46 +1046,46 @@
<!-- anttasks ============================================================================== --> <!-- anttasks ============================================================================== -->
<target name="anttasks" depends="init"> <target name="anttasks" depends="init">
<mkdir dir="${anttools.target.dir}" /> <mkdir dir="${anttools.target.dir}"/>
<mkdir dir="${anttools.target.dir}/classes" /> <mkdir dir="${anttools.target.dir}/classes"/>
<javac <javac
destdir="${anttools.target.dir}/classes" destdir="${anttools.target.dir}/classes"
includeAntRuntime="no" includeAntRuntime="no"
debug="on" debug="on"
source="1.4" source="1.4"
> >
<src path="${anttools.src.dir}" /> <src path="${anttools.src.dir}"/>
<patternset refid="compile.sources" /> <patternset refid="compile.sources"/>
<classpath> <classpath>
<path refid="compile.dependencies" /> <path refid="compile.dependencies"/>
</classpath> </classpath>
</javac> </javac>
<jar jarfile="${anttools.target.dir}/ant-subdirtask.jar"> <jar jarfile="${anttools.target.dir}/ant-subdirtask.jar">
<fileset dir="${anttools.target.dir}/classes" includes="**/*.class" /> <fileset dir="${anttools.target.dir}/classes" includes="**/*.class"/>
</jar> </jar>
</target> </target>
<!-- clean ================================================================================= --> <!-- clean ================================================================================= -->
<target name="clean" description="Cleans up all build-generated output"> <target name="clean" description="Cleans up all build-generated output">
<delete dir="${target.dir}" /> <delete dir="${target.dir}"/>
</target> </target>
<!-- clean-jspc ============================================================================ --> <!-- clean-jspc ============================================================================ -->
<target name="clean-jspc" description="Cleans all JSPC output"> <target name="clean-jspc" description="Cleans all JSPC output">
<delete dir="${jspc.dest.dir}" /> <delete dir="${jspc.dest.dir}"/>
</target> </target>
<!-- clean-test ============================================================================ --> <!-- clean-test ============================================================================ -->
<target name="clean-test" description="Cleans all compiled test classes"> <target name="clean-test" description="Cleans all compiled test classes">
<delete dir="${test.classes.dest.dir}" /> <delete dir="${test.classes.dest.dir}"/>
</target> </target>
<!-- clean-plugins ========================================================================= --> <!-- clean-plugins ========================================================================= -->
<target name="clean-plugins" description="Cleans all generated plugins"> <target name="clean-plugins" description="Cleans all generated plugins">
<delete dir="${plugin.dest.dir}" /> <delete dir="${plugin.dest.dir}"/>
<delete dir="${plugin.dev.dest.dir}" /> <delete dir="${plugin.dev.dest.dir}"/>
</target> </target>
</project> </project>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment