Author: steveh Date: Wed Jan 26 09:11:53 2005 New Revision: 126518 URL: http://svn.apache.org/viewcvs?view=rev&rev=126518 Log: A patch for distribution-related targets. Contributed by Brian Che.
tests: drt, build.dist, test.dist Modified: incubator/beehive/trunk/distribution.xml Modified: incubator/beehive/trunk/distribution.xml Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/distribution.xml?view=diff&rev=126518&p1=incubator/beehive/trunk/distribution.xml&r1=126517&p2=incubator/beehive/trunk/distribution.xml&r2=126518 ============================================================================== --- incubator/beehive/trunk/distribution.xml (original) +++ incubator/beehive/trunk/distribution.xml Wed Jan 26 09:11:53 2005 @@ -13,6 +13,7 @@ <property name="dist.base.dir" location="${beehive.home}/build/dist"/> <property name="dist.docs.dir" location="${beehive.home}/build/dist-docs"/> <property name="dist.dir" location="${dist.base.dir}/${dist.name}"/> + <property name="dist.lib.dir" location="${dist.base.dir}/${dist.lib.name}"/> <!-- ============================================= --> <!-- --> @@ -27,13 +28,9 @@ <antcall target="build.dist.docs"/> </target> - <target name="docs" description=""> - <ant antfile="build.xml" target="docs" inheritAll="false"/> - </target> - - <target name="build.dist.core"> - <!-- copy the required libraries into dist/ --> - <copy todir="${dist.dir}/lib/common" failOnError="true"> + <!-- target for buliding libraries. required property: lib.dir --> + <target name="build.lib"> + <copy todir="${lib.dir}/common" failOnError="true"> <fileset refid="commons-codec.fileset"/> <fileset refid="log4j.fileset"/> <fileset refid="xbean.fileset"/> @@ -41,18 +38,18 @@ <fileset refid="velocity.fileset"/> </copy> - <copy todir="${dist.dir}/lib/controls" failOnError="true"> + <copy todir="${lib.dir}/controls" failOnError="true"> <fileset refid="controls.fileset"/> </copy> <!-- todo: this needs to be cleaned up; axis shouldn't be in the Beehive distribution --> - <copy todir="${dist.dir}/lib/wsm" failOnError="true"> + <copy todir="${lib.dir}/wsm" failOnError="true"> <fileset dir="${beehive.home}/wsm/external" includes="**/*.jar"/> <fileset dir="${beehive.home}/wsm/lib" includes="**/*.jar"/> <fileset dir="${beehive.home}/wsm/build/jars" includes="**/*.jar"/> </copy> - <copy todir="${dist.dir}/lib/netui" failOnError="true" flatten="true"> + <copy todir="${lib.dir}/netui" failOnError="true" flatten="true"> <fileset dir="${beehive.home}/netui/build/dist/compiler"> <include name="*.jar"/> </fileset> @@ -68,11 +65,38 @@ </copy> <!-- this directory structure can't be flattened --> - <copy todir="${dist.dir}/lib/netui/resources" failOnError="true"> + <copy todir="${lib.dir}/netui/resources" failOnError="true"> <fileset dir="${beehive.home}/netui/build/dist/webapp/resources"> <include name="**/*"/> </fileset> </copy> + </target> + + <target name="docs" description=""> + <ant antfile="build.xml" target="docs" inheritAll="false"/> + </target> + + <target name="build.dist.lib" description="Builds a Beehive library distribution"> + <mkdir dir="${dist.lib.dir}"/> + + <!-- build libraries for distribution --> + <antcall target="build.lib"> + <param name="lib.dir" value="${dist.lib.dir}"/> + </antcall> + + <copy todir="${dist.lib.dir}" failOnError="true"> + <fileset dir="${beehive.home}"> + <include name="LICENSE.TXT"/> + <include name="NOTICE.txt"/> + </fileset> + </copy> + </target> + + <target name="build.dist.core"> + <!-- copy the required libraries into dist/ --> + <antcall target="build.lib"> + <param name="lib.dir" value="${dist.dir}/lib"/> + </antcall> <!-- copy the required Ant build files dist/ --> <copy todir="${dist.dir}/ant" failOnError="true"> @@ -188,14 +212,14 @@ </copy> </target> - <target name="build.livesite" depends="build.dist.docs" description="Builds a ZIP file to be posted on the live site"> - <zip basedir="${dist.dir}/docs/" destfile="${dist.dir}/docs/site.zip" /> - </target> - - <target name="build.dist.archives" description="Builds all Beehive distribution archives (.zip, .tar.gz, etc)"> + <target name="build.dist.archives" depends="build.dist,build.dist.lib" description="Builds all Beehive distribution archives (.zip, .tar.gz, etc)"> <fail unless="beehive.version" message="Could not build distribution archives; beehive.version property not specified!"/> <antcall target="build.dist.zip"/> <antcall target="build.dist.tgz"/> + <antcall target="build.dist.lib.zip"/> + <antcall target="build.dist.lib.tgz"/> + <antcall target="build.dist.docs.zip"/> + <antcall target="build.dist.docs.tgz"/> <!-- <antcall target="build.dist.docs.jar"/> --> @@ -205,14 +229,28 @@ <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> <mkdir dir="build/jars"/> - <zip destfile="build/jars/${dist.name}.zip" basedir="${dist.base.dir}"/> + <zip destfile="build/jars/${dist.name}.zip" includes="${dist.name}/**" basedir="${dist.base.dir}"/> </target> <target name="build.dist.tgz" description="Builds a Beehive distribution tarball (.tar.gz)"> <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> <mkdir dir="build/jars"/> - <tar destfile="build/jars/${dist.name}.tar.gz" basedir="${dist.base.dir}" compression="gzip"/> + <tar destfile="build/jars/${dist.name}.tar.gz" basedir="${dist.base.dir}" includes="${dist.name}/**" compression="gzip"/> + </target> + + <target name="build.dist.lib.tgz" description="Builds a Beehive library distribution tarball (.tar.gz)"> + <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> + + <mkdir dir="build/jars"/> + <tar destfile="build/jars/${dist.lib.name}.tar.gz" basedir="${dist.base.dir}" includes="${dist.lib.name}/**" compression="gzip"/> + </target> + + <target name="build.dist.lib.zip" description="Builds a Beehive library distribution zipfile"> + <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> + + <mkdir dir="build/jars"/> + <zip destfile="build/jars/${dist.lib.name}.zip" includes="${dist.lib.name}/**" basedir="${dist.base.dir}"/> </target> <target name="build.dist.docs.jar" depends="build.dist" description="Builds a Beehive distribution docs JAR"> @@ -222,9 +260,39 @@ <jar destfile="build/jars/${dist.name}-docs.jar" basedir="${dist.dir}/docs"/> </target> - <target name="clean.dist"> + <target name="build.dist.docs.zip" description="Builds a Beehive distribution docs zipfile"> + <property name="tmpdocsdir" location="build/tmp-dist/${dist.name}-docs" /> + <copy todir="${tmpdocsdir}"> + <fileset dir="${dist.dir}/docs" /> + </copy> + + <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> + + <mkdir dir="build/jars"/> + <zip destfile="build/jars/${dist.name}-docs.zip" basedir="build/tmp-dist" includes="${dist.name}-docs/**" /> + + <delete dir="${tmpdocsdir}" /> + </target> + + <target name="build.dist.docs.tgz" description="Builds a Beehive distribution docs tarball (.tar.gz)"> + <property name="tmpdocsdir" location="build/tmp-dist/${dist.name}-docs" /> + <copy todir="${tmpdocsdir}"> + <fileset dir="${dist.dir}/docs" /> + </copy> + + <fail unless="beehive.version" message="Could not build distribution archive; beehive.version was not specified"/> + + <mkdir dir="build/jars"/> + <tar destfile="build/jars/${dist.name}-docs.tgz" basedir="build/tmp-dist" includes="${dist.name}-docs/**" compression="gzip"/> + + <delete dir="${tmpdocsdir}" /> + </target> + + <target name="clean.dist" description="Cleans a Beehive distribution build"> + <delete dir="build/jars"/> <delete dir="build/dist"/> <delete dir="build/tmp-dist"/> + <delete dir="build/testDistArchives"/> </target> <target name="test.dist" description="Tests a Beehive distribution"> @@ -269,6 +337,17 @@ antfile="buildTestDist.xml" target="build.test.dist" inheritall="false"/> + </target> + + <!-- ============================================= --> + <!-- --> + <!-- Default usage target --> + <!-- --> + <!-- ============================================= --> + <target name="usage" description="Print the usage for this build.xml"> + <java fork="no" classname="org.apache.tools.ant.Main"> + <arg line="-f distribution.xml -projecthelp"/> + </java> </target> </project>
