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

JM-106 -- fixed bug causing plugin to not build if it has no web dir.


git-svn-id: http://svn.igniterealtime.org/svn/repos/messenger/trunk@801 b35dd754-fafc-0310-a699-88a17e54d16e
parent 7691e6fe
...@@ -717,68 +717,80 @@ ...@@ -717,68 +717,80 @@
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/classes" /> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/classes" />
</jar> </jar>
<!-- JSPC any JSP pages --> <!-- JSPC any JSP pages. Do this conditionally as there might not be a web dir. -->
<available property="plugin.@{plugin}.webdocs.available"
<!-- Create output dir --> type="dir" file="@{pluginsrc}/@{plugin}/src/web" />
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" /> <if>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes" /> <equals arg1="${plugin.@{plugin}.webdocs.available}" arg2="true" />
<then>
<!-- Copy jsp's from plugin and web.xml from messenger to a temp dir -->
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web"> <!-- Continue with JSPC tasks... -->
<fileset dir="@{pluginsrc}/@{plugin}/src/web" />
<fileset dir="${web.dir}"> <!-- Create output dir -->
<include name="WEB-INF/**/*.*" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" />
<exclude name="WEB-INF/web.xml.startup.servlet" /> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes" />
<exclude name="WEB-INF/classes/messenger_init.xml" />
<exclude name="WEB-INF/tmp/**/*.*" /> <!-- Copy jsp's from plugin and web.xml from messenger to a temp dir. We'll
<exclude name="WEB-INF/work/**/*.*" /> not fail on an error since the web dir might not exist.
</fileset> -->
</copy> <copy todir="${plugin.dev.dest.dir}/@{plugin}/target/web">
<fileset dir="@{pluginsrc}/@{plugin}/src/web" />
<!-- Declare the jspc task with our plugin's classpath --> <fileset dir="${web.dir}">
<taskdef classname="org.apache.jasper.JspC" name="jasper2" > <include name="WEB-INF/**/*.*" />
<classpath> <exclude name="WEB-INF/web.xml.startup.servlet" />
<pathelement location="${java.home}/../lib/tools.jar" /> <exclude name="WEB-INF/classes/messenger_init.xml" />
<pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" /> <exclude name="WEB-INF/tmp/**/*.*" />
<path refid="jspc.dependencies" /> <exclude name="WEB-INF/work/**/*.*" />
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar" /> </fileset>
<pathelement path="${compile.dir}" /> </copy>
</classpath>
</taskdef> <!-- Declare the jspc task with our plugin's classpath -->
<taskdef classname="org.apache.jasper.JspC" name="jasper2" >
<!-- JSP to Java --> <classpath>
<jasper2 <pathelement location="${java.home}/../lib/tools.jar" />
validateXml="false" <pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" />
uriroot="${plugin.dev.dest.dir}/@{plugin}/target/web" <path refid="jspc.dependencies" />
outputDir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" <fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar" />
package="org.jivesoftware.messenger.plugin.@{plugin}" <pathelement path="${compile.dir}" />
webXml="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml" </classpath>
/> </taskdef>
<!-- Use xmltask to merge the generated web.xml file and a developer one (if any) --> <!-- JSP to Java -->
<jasper2
validateXml="false"
<!-- Compile java classes --> uriroot="${plugin.dev.dest.dir}/@{plugin}/target/web"
<javac outputDir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java"
destdir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes" package="org.jivesoftware.messenger.plugin.@{plugin}"
includeAntRuntime="no" webXml="${plugin.dev.dest.dir}/@{plugin}/target/jspc/web.xml"
debug="on" />
source="1.5"
includes="org/jivesoftware/messenger/plugin/**/*.java" <!-- Use xmltask to merge the generated web.xml file and a developer one (if any) -->
>
<src path="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" />
<classpath> <!-- Compile java classes -->
<path refid="jspc.dependencies" /> <javac
<pathelement path="${compile.dir}" /> destdir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes"
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar" /> includeAntRuntime="no"
<pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" /> debug="on"
</classpath> source="1.5"
</javac> includes="org/jivesoftware/messenger/plugin/**/*.java"
>
<!-- Make a jar of compiled jsp classes --> <src path="${plugin.dev.dest.dir}/@{plugin}/target/jspc/java" />
<jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}-jspc.jar"> <classpath>
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc/classes" includes="**/*.class" /> <path refid="jspc.dependencies" />
</jar> <pathelement path="${compile.dir}" />
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar" />
<pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar" />
</classpath>
</javac>
<!-- Make a jar of compiled jsp classes -->
<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" />
</jar>
</then>
</if>
<!-- Copy everything to Messenger's plugin dir --> <!-- Copy everything to Messenger's plugin dir -->
<copy todir="${plugin.dest.dir}/@{plugin}"> <copy todir="${plugin.dest.dir}/@{plugin}">
...@@ -796,7 +808,7 @@ ...@@ -796,7 +808,7 @@
<exclude name="java/**/*.java" /> <exclude name="java/**/*.java" />
</fileset> </fileset>
</copy> </copy>
<copy todir="${plugin.dest.dir}/@{plugin}/web"> <copy todir="${plugin.dest.dir}/@{plugin}/web" failonerror="false">
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc"> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/jspc">
<include name="web.xml" /> <include name="web.xml" />
</fileset> </fileset>
......
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