Commit 2743c92c authored by Dele Olajide's avatar Dele Olajide

Merge pull request #64 from sdebnath/custom-fix

Allow for custom lib and conf file placement. Jira OF-838
parents 9d4416ce d8e89260
...@@ -68,6 +68,8 @@ ...@@ -68,6 +68,8 @@
<property name="overlay.dir" value="${basedir}/custom"/> <property name="overlay.dir" value="${basedir}/custom"/>
<property name="overlay.src.dir" value="${overlay.dir}/source"/> <property name="overlay.src.dir" value="${overlay.dir}/source"/>
<property name="overlay.web.dir" value="${overlay.dir}/webapp"/> <property name="overlay.web.dir" value="${overlay.dir}/webapp"/>
<property name="overlay.lib.dir" value="${overlay.dir}/lib"/>
<property name="overlay.conf.dir" value="${overlay.dir}/conf"/>
<property name="overlay.properties.file" value="overlay.properties"/> <property name="overlay.properties.file" value="overlay.properties"/>
<property name="overlay.compile.dir" value="${work.dir}/overlay/classes"/> <property name="overlay.compile.dir" value="${work.dir}/overlay/classes"/>
...@@ -146,6 +148,10 @@ ...@@ -146,6 +148,10 @@
<fileset dir="${lib.web.dir}" includes="*.jar"/> <fileset dir="${lib.web.dir}" includes="*.jar"/>
</path> </path>
<path id="custom.dependencies">
<fileset dir="${overlay.lib.dir}" includes="*.jar"/>
</path>
<path id="test.dependencies"> <path id="test.dependencies">
<path refid="compile.dependencies"/> <path refid="compile.dependencies"/>
<fileset dir="${jar.dest.dir}" includes="openfire.jar"/> <fileset dir="${jar.dest.dir}" includes="openfire.jar"/>
...@@ -278,11 +284,22 @@ ...@@ -278,11 +284,22 @@
</classpath> </classpath>
</of.javac> </of.javac>
<available file="${overlay.lib.dir}" type="dir" property="overlay.lib.found"/>
<if>
<equals arg1="${overlay.lib.found}" arg2="true"/>
<then>
<mkdir dir="${jar.dest.dir}"/>
<copy todir="${jar.dest.dir}" overwrite="true">
<fileset dir="${overlay.lib.dir}" includes="*.*"/>
</copy>
</then>
<else><echo>No custom lib here </echo></else>
</if>
<available file="${overlay.src.dir}" type="dir" property="overlay.source.found"/> <available file="${overlay.src.dir}" type="dir" property="overlay.source.found"/>
<if> <if>
<equals arg1="${overlay.source.found}" arg2="true"/> <equals arg1="${overlay.source.found}" arg2="true"/>
<then> <then>
<mkdir dir="${overlay.compile.dir}"/> <mkdir dir="${overlay.compile.dir}"/>
<of.javac <of.javac
destdir="${overlay.compile.dir}" destdir="${overlay.compile.dir}"
...@@ -292,6 +309,7 @@ ...@@ -292,6 +309,7 @@
<src path="${overlay.src.dir}"/> <src path="${overlay.src.dir}"/>
<patternset refid="compile.sources"/> <patternset refid="compile.sources"/>
<classpath> <classpath>
<path refid="custom.dependencies"/>
<path refid="compile.dependencies"/> <path refid="compile.dependencies"/>
<path location="${compile.dir}"/> <path location="${compile.dir}"/>
</classpath> </classpath>
...@@ -300,7 +318,6 @@ ...@@ -300,7 +318,6 @@
</then> </then>
<else><echo>Nothing to compile from custom here </echo></else> <else><echo>Nothing to compile from custom here </echo></else>
</if> </if>
</target> </target>
<!-- i18n ================================================================================== --> <!-- i18n ================================================================================== -->
...@@ -641,6 +658,17 @@ ...@@ -641,6 +658,17 @@
<fileset dir="${src.dir}" includes="conf/**/*.*"></fileset> <fileset dir="${src.dir}" includes="conf/**/*.*"></fileset>
</copy> </copy>
<available file="${overlay.conf.dir}" type="dir" property="overlay.conf.found"/>
<if>
<equals arg1="${overlay.conf.found}" arg2="true"/>
<then>
<copy todir="${target.openfireHome}" overwrite="true">
<fileset dir="${overlay.dir}" includes="conf/**/*.*"/>
</copy>
</then>
<else><echo>No custom config here </echo></else>
</if>
<!-- Copy database scripts --> <!-- Copy database scripts -->
<if> <if>
<equals arg1="${copy.dbscripts}" arg2="true"/> <equals arg1="${copy.dbscripts}" arg2="true"/>
......
...@@ -33,25 +33,44 @@ ...@@ -33,25 +33,44 @@
directory (where all the source files are on your filesystem). directory (where all the source files are on your filesystem).
</p> </p>
<pre>custom/ <pre>custom/
| - overlay.properties &lt;- Properties file to replace text in i18n files (optional) | - overlay.properties &lt;- Properties file to replace text in i18n files (optional)
| - source/ &lt;- Directory to place java source files to be overridden | - conf/ &lt;- Directory to place configuration files to be overridden
| - webapp/ &lt;- Directory to place any web file (image, CSS or jsp) | - lib/ &lt;- Directory to place any private or 3rd prty jar files
</pre> | - source/ &lt;- Directory to place java source files to be overridden
| - webapp/ &lt;- Directory to place any web file (image, CSS or jsp)
</pre>
<p>
In the <tt>custom/conf</tt> directory, mirror the contents under the <tt>src/conf</tt> directory.
Any files you place under <tt>custom/conf</tt> will override the current conf files under conf
in the build. For example, to override the <tt>openfire.xml</tt> config file, you would place a
openfire.xml file under the directory <tt>custom/conf/</tt>.
</p>
<p>
Any files you place under the <tt>custom/lib</tt> directory will be placed along side the other
jar files under the <tt>openfire/lib/</tt> directory. For example, if you require a 3rd party
jar file for use with changes you made under <tt>custom/source/</tt>, you would place the
jar file in <tt>custom/lib/</tt> and it will be placed in the <tt>lib/</tt> in the build.
</p>
<p> <p>
In the <tt>custom/source</tt> directory, mirror the contents under the <tt>src/java</tt> directory. In the <tt>custom/source</tt> directory, mirror the contents under the <tt>src/java</tt> directory.
Any files you place under <tt>custom/source</tt> will override the current source files in the build. Any files you place under <tt>custom/source</tt> will override the current source files in the build.
For example, to override the For example, to override the class <tt>org.jivesoftware.openfire.Channel</tt> you would place a
class <tt>org.jivesoftware.openfire.Channel</tt> you would place a Channel.java file under the directory <tt>custom/source/org/jivesoftware/openfire/</tt> Channel.java file under the directory <tt>custom/source/org/jivesoftware/openfire/</tt>.
</p> </p>
<p> <p>
In the <tt>custom/webapp</tt> directory, mirror the contents of the <tt>src/web</tt> directory. Any files you place In the <tt>custom/webapp</tt> directory, mirror the contents of the <tt>src/web</tt> directory.
there will override the current source files in the build. For example, if you want to modify <tt>src/web/login.jsp</tt> Any files you place there will override the current source files in the build. For example,
then add login.jsp to the directory <tt>custom/webapp</tt>. if you want to modify <tt>src/web/login.jsp</tt> then add login.jsp to the directory
</p> <tt>custom/webapp</tt>.
</p>
<p> <p>
Currently, overridden files will simply be included in the built war or jar files. We have not added Currently, overridden files will simply be included in the built war or jar files. We have not added
functionality to bundle these changes in a separate jar file. functionality to bundle these changes in a separate jar file.
</p> </p>
......
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