Commit 662a67d4 authored by Andrew Wright's avatar Andrew Wright Committed by andrew

a few changes to make plugin development easier:

1. copy statements in buildplugin macro use the overwrite value from ${overwrite}, default is true
2. there is a target plugin that will build the plugin that has the name ${plugin}
3. run target does not depend on jar, instead displays a message mentioning that jar should have been already run, this increases the startime of the target significantly


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@1578 b35dd754-fafc-0310-a699-88a17e54d16e
parent 192d1665
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
<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="overwrite" value="true"/>
<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"/>
...@@ -330,7 +331,8 @@ ...@@ -330,7 +331,8 @@
</target> </target>
<!-- run =================================================================================== --> <!-- run =================================================================================== -->
<target name="run" depends="jar" description="Starts Messenger inline to the build process."> <target name="run" description="Starts Messenger inline to the build process.">
<echo>Ensure that you have run ant jar!</echo>
<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>
...@@ -847,6 +849,9 @@ ...@@ -847,6 +849,9 @@
</for> </for>
</target> </target>
<target name="plugin" description="build one plugin">
<buildplugin plugin="${plugin}" pluginsrc="${plugin.src.dir}"/>
</target>
<!-- buildplugin (MACRO) =================================================================== --> <!-- buildplugin (MACRO) =================================================================== -->
<macrodef name="buildplugin"> <macrodef name="buildplugin">
...@@ -892,19 +897,19 @@ ...@@ -892,19 +897,19 @@
</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" overwrite="${overwrite}" >
<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" overwrite="${overwrite}" >
<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" overwrite="${overwrite}" >
<fileset dir="@{pluginsrc}/@{plugin}" includes="*.xml, *.html"/> <fileset dir="@{pluginsrc}/@{plugin}" includes="*.xml, *.html"/>
</copy> </copy>
...@@ -924,7 +929,7 @@ ...@@ -924,7 +929,7 @@
<!-- 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" overwrite="${overwrite}">
<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>
...@@ -983,7 +988,7 @@ ...@@ -983,7 +988,7 @@
</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" overwrite="${overwrite}"/>
</else> </else>
</if> </if>
...@@ -1005,7 +1010,7 @@ ...@@ -1005,7 +1010,7 @@
</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>
...@@ -1013,7 +1018,7 @@ ...@@ -1013,7 +1018,7 @@
</if> </if>
<!-- 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" overwrite="true" >
<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"/>
......
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