Commit 6fad27ba authored by Quality Assurance's avatar Quality Assurance Committed by qa

New build features:

Filtering of source release
Replacing of DATE string
plugin-lib.jar generation
Misc build fixes (clean target, etc.)

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@6801 b35dd754-fafc-0310-a699-88a17e54d16e
parent 8498094d
...@@ -52,6 +52,13 @@ ...@@ -52,6 +52,13 @@
<pathelement location="${basedir}/build/lib/pack200task.jar"/> <pathelement location="${basedir}/build/lib/pack200task.jar"/>
</classpath> </classpath>
</taskdef> </taskdef>
<typedef name="srcinc" classname="com.jivesoftware.tools.selector.IncludeSourceSelector" >
<classpath>
<pathelement location="${basedir}/build/lib/ant-jive-edition.jar"/>
<pathelement location="${basedir}/build/lib/qdox.jar"/>
</classpath>
</typedef>
<!-- ======================================================================================= --> <!-- ======================================================================================= -->
<!-- GLOBAL PROPERTIES --> <!-- GLOBAL PROPERTIES -->
...@@ -438,8 +445,8 @@ ...@@ -438,8 +445,8 @@
<mkdir dir="${webapp.dest.dir}"/> <mkdir dir="${webapp.dest.dir}"/>
<antcall target="-jspc-impl"/> <antcall target="-jspc-impl"/>
</target> </target>
<target name="-jspc-impl" unless="no.jspc"> <target name="-jspc-impl" unless="no.jspc">
<java classname="org.apache.jasper.JspC" fork="true"> <java classname="org.apache.jasper.JspC" fork="true">
<classpath> <classpath>
...@@ -675,21 +682,29 @@ ...@@ -675,21 +682,29 @@
</fileset> </fileset>
</copy> </copy>
</target> </target>
<!-- dist.src =============================================================================== --> <!-- dist.init ============================================================================== -->
<target name="dist.src" depends="javadoc, -i18n" <target name="dist.init" >
description="Creates a source distribution package">
<mkdir dir="${release.dest.dir}"/>
<!-- Create a new prop for the final release dirs then create the dirs -->
<!-- ie: wildfire_src --> <!-- ie: wildfire_src -->
<property name="release.name.src" value="${dist.prefix}_src"/> <property name="release.name.src" value="${dist.prefix}_src"/>
<!-- ie: wildfire_src_2_1_2 --> <!-- ie: wildfire_src_2_1_2 -->
<property name="release.fullname.src" value="${dist.prefix}_src_${version.filename}"/> <property name="release.fullname.src" value="${dist.prefix}_src_${version.filename}"/>
<property name="release.src.out.dir" value="${release.dest.dir}/${release.name.src}"/> <property name="release.src.out.dir" value="${release.dest.dir}/${release.name.src}"/>
<!-- ie: wildfire -->
<property name="release.name" value="${dist.prefix}"/>
<!-- ie: wildfire_2_1_2 -->
<property name="release.fullname" value="${dist.prefix}_${version.filename}"/>
<property name="release.out.dir" value="${release.dest.dir}/${release.name}"/>
</target>
<!-- dist.src =============================================================================== -->
<target name="dist.src" depends="init, dist.init, javadoc, -i18n"
description="Creates a source distribution package">
<mkdir dir="${release.dest.dir}"/>
<!-- Create a new prop for the final release dirs then create the dirs -->
<mkdir dir="${release.src.out.dir}"/> <mkdir dir="${release.src.out.dir}"/>
<!-- Copy dist docs, use filtering --> <!-- Copy dist docs, use filtering -->
<copy todir="${release.src.out.dir}"> <copy todir="${release.src.out.dir}">
...@@ -712,10 +727,22 @@ ...@@ -712,10 +727,22 @@
<copy todir="${release.src.out.dir}/documentation/docs/javadoc"> <copy todir="${release.src.out.dir}/documentation/docs/javadoc">
<fileset dir="${javadoc.dest.dir}"/> <fileset dir="${javadoc.dest.dir}"/>
</copy> </copy>
<!-- Copy source --> <!-- Copy non-java source -->
<copy todir="${release.src.out.dir}/src"> <copy todir="${release.src.out.dir}/src">
<fileset dir="${src.dir}"/> <fileset dir="${src.dir}" excludes="**/*.java"/>
</copy> </copy>
<!-- Copy java source, stripping non-distributable files and replacing DATE strings -->
<copy todir="${release.src.out.dir}/src">
<fileset dir="${src.dir}">
<include name="**/*.java" />
<srcinc />
</fileset>
<filterset>
<filter token="DATE" value="${builddate}"/>
</filterset>
</copy>
<!-- Copy the i18n files to the resources dir. This way they won't be in the jar only --> <!-- Copy the i18n files to the resources dir. This way they won't be in the jar only -->
<copy todir="${release.src.out.dir}/resources/i18n"> <copy todir="${release.src.out.dir}/resources/i18n">
<fileset dir="${target.i18n.dir}" includes="*.properties"/> <fileset dir="${target.i18n.dir}" includes="*.properties"/>
...@@ -751,15 +778,8 @@ ...@@ -751,15 +778,8 @@
</target> </target>
<!-- dist.bin =============================================================================== --> <!-- dist.bin =============================================================================== -->
<target name="dist.bin" depends="plugins,javadoc" <target name="dist.bin" depends="init, dist.init, plugins, javadoc, enterprise"
description="Creates a binary distribution package"> description="Creates a binary distribution package">
<!-- ie: wildfire -->
<property name="release.name" value="${dist.prefix}"/>
<!-- ie: wildfire_2_1_2 -->
<property name="release.fullname" value="${dist.prefix}_${version.filename}"/>
<property name="release.out.dir" value="${release.dest.dir}/${release.name}"/>
<antcall target="enterprise"/>
<mkdir dir="${release.out.dir}"/> <mkdir dir="${release.out.dir}"/>
...@@ -913,7 +933,6 @@ ...@@ -913,7 +933,6 @@
<!-- installer ============================================================================= --> <!-- installer ============================================================================= -->
<target name="installer" description="Creates Wildfire installers"> <target name="installer" description="Creates Wildfire installers">
<condition property="install4j.not.ok" value="true"> <condition property="install4j.not.ok" value="true">
<not> <not>
<available file="${installer.install4j.home}/bin/install4j.jar"/> <available file="${installer.install4j.home}/bin/install4j.jar"/>
...@@ -921,7 +940,7 @@ ...@@ -921,7 +940,7 @@
</condition> </condition>
<fail if="install4j.not.ok" <fail if="install4j.not.ok"
message="Path to Install4j not set, see build.properties.template file."/> message="Path to Install4j not set, see build.properties.template file."/>
<antcall target="dist.src"/> <antcall target="dist.src"/>
<antcall target="dist.bin"> <antcall target="dist.bin">
...@@ -1045,11 +1064,64 @@ ...@@ -1045,11 +1064,64 @@
</classpath> </classpath>
</javac> </javac>
<!-- Searchs source of a plugin and makes a <plugin>-lib.jar that contains compiled versions of all
non-distributable source -->
<property name="pluginlib" value="@{pluginsrc}/@{plugin}/lib" />
<mkdir dir="${pluginlib}" />
<mkdir dir="${pluginlib}/source" />
<mkdir dir="${pluginlib}/classes" />
<!-- copy the source we want to compile -->
<copy todir="${pluginlib}/source">
<fileset dir="@{pluginsrc}/@{plugin}/src/java" includes="**/*.java" >
<not>
<srcinc />
</not>
</fileset>
</copy>
<if>
<not><uptodate>
<srcfiles dir="${pluginlib}/source" includes="**/*.java"/>
<mapper type="merge" to="${pluginlib}/@{plugin}-lib.jar"/>
</uptodate></not>
<then>
<javac
destdir="${pluginlib}/classes"
includeAntRuntime="no"
debug="on"
source="1.5"
includes="**/*.java"
>
<src path="${pluginlib}/source"/>
<classpath>
<pathelement location="${plugin.dev.dest.dir}/@{plugin}/target/classes"/>
<path>
<path refid="plugin.dependencies"/>
<!-- Jars used by the plugin to compile with -->
<fileset dir="@{pluginsrc}/@{plugin}" includes="lib/*.jar"/>
</path>
</classpath>
</javac>
<jar jarfile="${pluginlib}/@{plugin}-lib.jar">
<fileset dir="${pluginlib}/classes" />
</jar>
</then>
</if>
<!-- Make the jar --> <!-- Make the jar -->
<mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/lib"/> <mkdir dir="${plugin.dev.dest.dir}/@{plugin}/target/lib"/>
<jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar"> <jar jarfile="${plugin.dev.dest.dir}/@{plugin}/target/lib/plugin-@{plugin}.jar">
<fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/classes"/> <fileset dir="${plugin.dev.dest.dir}/@{plugin}/target/classes" >
<present present="srconly" targetdir="${pluginlib}/classes"/>
</fileset>
</jar> </jar>
<delete dir="${pluginlib}/classes" />
<delete dir="${pluginlib}/source" />
<available file="@{pluginsrc}/@{plugin}/src/include" type="dir" <available file="@{pluginsrc}/@{plugin}/src/include" type="dir"
property="@{plugin}.include.exists"/> property="@{plugin}.include.exists"/>
<if> <if>
...@@ -1285,6 +1357,15 @@ ...@@ -1285,6 +1357,15 @@
<target name="clean" description="Cleans up all build-generated output"> <target name="clean" description="Cleans up all build-generated output">
<delete dir="${work.dir}"/> <delete dir="${work.dir}"/>
<delete dir="${target.dir}"/> <delete dir="${target.dir}"/>
<!-- Delete the Enterprise plugin in the wildfire plugin directory, if this isn't an enterprise build -->
<if>
<not><equals arg1="${do.enterprise}" arg2="true"/></not>
<then>
<!-- Copy pre-configured wildfireHome dir -->
<delete dir="${basedir}/src/plugins/enterprise" />
</then>
</if>
</target> </target>
<!-- clean-jspc ============================================================================ --> <!-- clean-jspc ============================================================================ -->
......
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