Commit c1235ce1 authored by Bill Lynch's avatar Bill Lynch Committed by bill

Added support for extra plugins dev dir, other minor fixes to plugin process


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@498 b35dd754-fafc-0310-a699-88a17e54d16e
parent 74dff134
...@@ -10,8 +10,11 @@ ...@@ -10,8 +10,11 @@
deploy.jar.dir= deploy.jar.dir=
# #
# Directory where the installer messenger.iap_xml file is located. # Directory where plugin development is done. This is assumed to be the
# Example: d:\\cvs\\xmpp\\chat\\build\\installer (win paths must have \\) # root directory:
# Note: Do not put a trailing "\" at the end!
# #
installer.new.path= # /home/joeuser/java/myplugins/ <- Point to this directory
\ No newline at end of file # |- fooplugin/
# |- barplugin/
#
plugin.dev.dir=
\ No newline at end of file
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
</classpath> </classpath>
</taskdef> </taskdef>
<taskdef resource="clovertasks" />
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
<!-- GLOBAL PROPERTIES --> <!-- GLOBAL PROPERTIES -->
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
...@@ -72,6 +74,7 @@ ...@@ -72,6 +74,7 @@
<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.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" />
...@@ -109,6 +112,8 @@ ...@@ -109,6 +112,8 @@
<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="${ant.home}/lib" includes="clover.jar" />
</path> </path>
<path id="plugin.dependencies"> <path id="plugin.dependencies">
...@@ -345,6 +350,19 @@ ...@@ -345,6 +350,19 @@
</target> </target>
<target name="with-clover">
<clover-setup initString="${target.dir}/test/messenger-coverage.db" />
</target>
<target name="clover-html" depends="with-clover">
<mkdir dir="${test.results.dest.dir}/clover" />
<clover-report>
<current outfile="${test.results.dest.dir}/clover">
<format type="html"/>
</current>
</clover-report>
</target>
<!-- 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 -->
...@@ -496,9 +514,15 @@ ...@@ -496,9 +514,15 @@
<!-- 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>
<filter token="version" value="${version}" />
</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>
<filter token="version" value="${version}" />
</filterset>
</copy> </copy>
<!-- Copy Javadocs --> <!-- Copy Javadocs -->
...@@ -588,10 +612,28 @@ ...@@ -588,10 +612,28 @@
</ant> </ant>
<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" />
<antcall target="-plugins-impl-dev" />
</target><target name="-plugins-impl" if="${dirlist}">
<for list="${dirlist}" param="plugin" trim="true"> <for list="${dirlist}" param="plugin" trim="true">
<sequential> <sequential>
<buildplugin plugin="@{plugin}" /> <buildplugin plugin="@{plugin}" pluginsrc="${plugin.src.dir}" />
</sequential>
</for>
</target><target name="-plugins-impl-dev" unless="${plugin.dev.dir}">
<subdirinfo dir="${plugin.dev.dir}" property="dirlist2" ifexists="plugin.xml" />
<antcall target="-plugin-impl-dev-build" />
</target><target name="-plugin-impl-dev-build" if="dirlist2">
<for list="${dirlist2}" param="plugin" trim="true">
<sequential>
<buildplugin plugin="@{plugin}" pluginsrc="${plugin.dev.dir}" />
</sequential> </sequential>
</for> </for>
...@@ -600,6 +642,7 @@ ...@@ -600,6 +642,7 @@
<!-- buildplugin (MACRO) =================================================================== --> <!-- buildplugin (MACRO) =================================================================== -->
<macrodef name="buildplugin"> <macrodef name="buildplugin">
<attribute name="plugin" /> <attribute name="plugin" />
<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}" />
...@@ -607,18 +650,18 @@ ...@@ -607,18 +650,18 @@
<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="@{pluginsrc}/@{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="${plugin.src.dir}/@{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 -->
<pathelement location="${plugin.src.dir}/@{plugin}/lib/*.jar" /> <pathelement location="@{pluginsrc}/@{plugin}/lib/*.jar" />
</classpath> </classpath>
</javac> </javac>
...@@ -636,7 +679,7 @@ ...@@ -636,7 +679,7 @@
<!-- Copy jsp's from plugin and web.xml from messenger to a temp dir --> <!-- Copy jsp's from plugin and web.xml from messenger to a temp dir -->
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web"> <copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web">
<fileset dir="${plugin.src.dir}/@{plugin}/src/web" /> <fileset dir="@{pluginsrc}/@{plugin}/src/web" />
<fileset dir="${web.dir}"> <fileset dir="${web.dir}">
<include name="WEB-INF/**/*.*" /> <include name="WEB-INF/**/*.*" />
<exclude name="WEB-INF/web.xml.startup.servlet" /> <exclude name="WEB-INF/web.xml.startup.servlet" />
...@@ -652,7 +695,6 @@ ...@@ -652,7 +695,6 @@
<pathelement location="${java.home}/../lib/tools.jar" /> <pathelement location="${java.home}/../lib/tools.jar" />
<path refid="jspc.dependencies" /> <path refid="jspc.dependencies" />
<pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" /> <pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" />
<!-- <pathelement location="${jar.dest.dir}/messenger.jar" />-->
<pathelement path="${compile.dir}" /> <pathelement path="${compile.dir}" />
</classpath> </classpath>
</taskdef> </taskdef>
...@@ -677,7 +719,6 @@ ...@@ -677,7 +719,6 @@
<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 location="${jar.dest.dir}/messenger.jar" />-->
<pathelement path="${compile.dir}" /> <pathelement path="${compile.dir}" />
</classpath> </classpath>
</javac> </javac>
...@@ -692,10 +733,10 @@ ...@@ -692,10 +733,10 @@
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target"> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/target">
<include name="lib/*.jar" /> <include name="lib/*.jar" />
</fileset> </fileset>
<fileset dir="${plugin.src.dir}/@{plugin}"> <fileset dir="@{pluginsrc}/@{plugin}">
<include name="plugin.xml" /> <include name="plugin.xml" />
</fileset> </fileset>
<fileset dir="${plugin.src.dir}/@{plugin}/src"> <fileset dir="@{pluginsrc}/@{plugin}/src">
<include name="web/**/*.*" /> <include name="web/**/*.*" />
<exclude name="web/**/*.jsp" /> <exclude name="web/**/*.jsp" />
<exclude name="web/**/*.jspf" /> <exclude name="web/**/*.jspf" />
...@@ -709,6 +750,11 @@ ...@@ -709,6 +750,11 @@
</fileset> </fileset>
</copy> </copy>
<!-- Jar the plugin -->
<jar jarfile="${plugin.dest.dir}/@{plugin}.jar">
<fileset dir="${plugin.dest.dir}" />
</jar>
</sequential> </sequential>
</macrodef> </macrodef>
......
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