Commit bbc3c83f authored by Dave Cridland's avatar Dave Cridland Committed by GitHub

Merge pull request #599 from guusdk/OF-1149_Build_improvements

OF-1149: Improve build speed
parents 645e3de3 25f66a6c
......@@ -102,7 +102,6 @@
<property name="anttools.src.dir" value="${src.dir}/tools"/>
<property name="anttools.target.dir" value="${work.dir}/tools"/>
<property name="copy.dbscripts" value="true"/>
<property name="overwrite" value="true"/>
<property name="installer.install4j.home" value="/home/bamboo/install4j"/>
<property name="installer.src" value="${basedir}/build/installer"/>
......@@ -1322,66 +1321,50 @@
<antcall target="openfireHome"/>
</target>
<macrodef name="buildparentplugin">
<attribute name="plugin"/>
<attribute name="pluginsrc"/>
<attribute name="pluginlib" default="${plugin.dev.dest.dir}/@{plugin}/work/lib" />
<attribute name="parentPlug"/>
<sequential>
<echo message="Read XML properties of @{pluginsrc}/@{parentPlug}/plugin.xml"/>
<xmlproperty file="@{pluginsrc}/@{parentPlug}/plugin.xml" prefix="@{parentPlug}" keepRoot="false"/>
<if>
<isset property="@{parentPlug}.parentPlugin"/>
<then>
<echo message="Compile parent of parent plugin ${@{parentPlug}.parentPlugin}"/>
<buildparentplugin parentPlug="${@{parentPlug}.parentPlugin}" plugin="@{plugin}" pluginsrc="@{pluginsrc}" pluginlib="@{pluginlib}"/>
</then>
</if>
<echo message="Compile parent plugin @{parentPlug}"/>
<javac
destdir="${plugin.dev.dest.dir}/@{plugin}/target/classes"
includeAntRuntime="no"
debug="on"
source="${javac.source}"
target="${javac.target}"
>
<src path="@{pluginsrc}/@{parentPlug}/src/java"/>
<classpath>
<path refid="plugin.dependencies"/>
<!-- Jars used by the plugin to compile with -->
<fileset dir="@{pluginsrc}/@{parentPlug}" includes="lib/*.jar"/>
</classpath>
</javac>
</sequential>
</macrodef>
<!-- buildplugin (MACRO) =================================================================== -->
<macrodef name="buildplugin">
<attribute name="plugin"/>
<attribute name="pluginsrc"/>
<attribute name="pluginlib" default="${plugin.dev.dest.dir}/@{plugin}/work/lib" />
<sequential>
<trycatch property="message_ref" reference="exception_ref" >
<if>
<not>
<istrue value="${plugin.@{plugin}.skip}"/>
</not>
<then>
<trycatch property="message_ref" reference="exception_ref">
<try>
<!-- For each plugin, copile code, make a jar and copy resources. -->
<!-- For each plugin, compile code, make a jar and copy resources. -->
<mkdir dir="${plugin.dev.dest.dir}"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/classes"/>
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/parentlibs"/>
<xmlproperty file="${plugin.src.dir}/@{plugin}/plugin.xml" prefix="@{plugin}" keeproot="false"/>
<if>
<isset property="@{plugin}.parentPlugin"/>
<then>
<echo>Parent plugin found: ${@{plugin}.parentPlugin}</echo>
<buildparentplugin parentPlug="${@{plugin}.parentPlugin}" plugin="@{plugin}" pluginsrc="@{pluginsrc}" pluginlib="@{pluginlib}"/>
<!--<buildparentplugin parentPlug="${@{plugin}.parentPlugin}" plugin="@{plugin}" pluginsrc="@{pluginsrc}" pluginlib="@{pluginlib}"/>-->
<buildplugin plugin="${@{plugin}.parentPlugin}" pluginsrc="${plugin.src.dir}"/>
<!-- Copy parent plugin code + dependencies into our own plugin directory. -->
<echo>Parent plugin built. Copying its resources and continuing with build for child plugin.</echo>
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/parentlibs">
<fileset dir="${plugin.dev.dest.dir}/${@{plugin}.parentPlugin}/target/parentlibs/" includes="**/*.jar" />
</copy>
<copy todir="${plugin.dev.dest.dir}/@{plugin}/target/parentlibs">
<fileset dir="${plugin.dev.dest.dir}/${@{plugin}.parentPlugin}/target/lib/" includes="**/*.jar" />
</copy>
</then>
</if>
<path id="plugin.classpath.source">
<path refid="plugin.dependencies"/>
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/parentlibs" includes="**/*.jar"/>
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar"/>
</path>
......@@ -1568,7 +1551,8 @@
<classpath>
<path refid="jspc.dependencies"/>
<pathelement path="${compile.dir}"/>
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target" includes="lib/*.jar"/>
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/lib" includes="*.jar"/>
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/parentlibs" includes="**/*.jar"/>
</classpath>
</of.javac>
......@@ -1613,6 +1597,9 @@
<!-- Delete the exploded plugin -->
<delete dir="${plugin.dev.dest.dir}/@{plugin}/jar"/>
<!-- Plugin is done! No need to rebuilt it within the same Ant task -->
<property name="plugin.@{plugin}.skip" value="true"/>
</try>
<catch>
<property name="exception" refid="exception_ref" />
......@@ -1625,6 +1612,8 @@
</fail>
</catch>
</trycatch>
</then>
</if>
</sequential>
</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