Author: kentam
Date: Mon Oct 25 11:05:26 2004
New Revision: 55518
Added:
incubator/beehive/trunk/test/testDistro.cmd (contents, props changed)
incubator/beehive/trunk/user/
incubator/beehive/trunk/user/beehive.properties (contents, props changed)
incubator/beehive/trunk/user/beehiveUser.cmd (contents, props changed)
Modified:
incubator/beehive/trunk/beehive.properties
incubator/beehive/trunk/build.xml
incubator/beehive/trunk/test/ant/buildWebapp.xml
Log:
Flesh out distribution build process (see
http://wiki.apache.org/beehive/Distribution_20Structure?action=show).
The PetStore sample now builds using only the distribution bits, and the
top-level "test.dist" target should
keep this alive.
Modified: incubator/beehive/trunk/beehive.properties
==============================================================================
--- incubator/beehive/trunk/beehive.properties (original)
+++ incubator/beehive/trunk/beehive.properties Mon Oct 25 11:05:26 2004
@@ -22,6 +22,7 @@
ant.jar=${ant.dir}/lib/ant.jar
dist.dir=${beehive.dir}/build/dist
+dist.docs.dir=${beehive.dir}/build/dist-docs
dist.name=apache-beehive
#
Modified: incubator/beehive/trunk/build.xml
==============================================================================
--- incubator/beehive/trunk/build.xml (original)
+++ incubator/beehive/trunk/build.xml Mon Oct 25 11:05:26 2004
@@ -244,10 +244,9 @@
<target name="build.dist" description="Builds a Beehive distribution">
<mkdir dir="${dist.dir}"/>
- <mkdir dir="${dist.dir}/templates"/>
<antcall target="build.dist.core"/>
- <antcall target="build.dist.docs"/>
+ <antcall target="build.dist.samples"/>
</target>
<target name="build.dist.core" depends="deploy">
@@ -286,14 +285,28 @@
<!-- copy the required Ant build files dist/ -->
<copy todir="${dist.dir}/ant" failOnError="true">
+ <fileset file="${beehive.test.dir}/ant/buildWebapp.xml"/>
<fileset file="${beehive.test.dir}/ant/buildWebappCore.xml"/>
<fileset file="${beehive.test.dir}/ant/runTomcatCore.xml"/>
</copy>
+ <copy todir="${dist.dir}" failOnError="true">
+ <fileset dir="${os.BEEHIVE_HOME}/user">
+ <include name="*.*"/>
+ </fileset>
+ <filterset>
+ <filter token="BEEHIVE_HOME" value="${dist.dir}"/>
+ <filter token="JAVA_HOME" value="${os.JAVA_HOME}"/>
+ <filter token="ANT_HOME" value="${os.ANT_HOME}"/>
+ <filter token="CATALINA_HOME"
value="${dist.dir}\jakarta-tomcat-5.0.25"/>
+ </filterset>
+ </copy>
+
<property name="webapp.name" value="netui-blank"/>
<!-- build the project templates in dist/ -->
<echo>Create the Beehive webapp template</echo>
+ <mkdir dir="${dist.dir}/templates"/>
<copy todir="build/tmp-dist/${webapp.name}">
<fileset dir="${os.BEEHIVE_HOME}/netui/build/dist/webapp"/>
</copy>
@@ -314,14 +327,45 @@
</target>
- <target name="build.dist.docs" depends="docs">
+ <target name="build.dist.samples">
+ <!-- Build the petstore dashboard distro -->
+ <copy todir="${dist.dir}/samples/PetStoreDashboard" failOnError="true">
+ <fileset dir="samples/PetStoreDashboard"/>
+ </copy>
+
+ <!-- Build the petstore distro -->
+ <!-- copy the webapp itself -->
+ <copy todir="${dist.dir}/samples/petstoreWeb" failOnError="true">
+ <fileset dir="samples/petstoreWeb"/>
+ </copy>
+
+ <!-- TODO: Expose deploy.netui type targets in a build script in the
distro. For now, we
+ do the deployment here. This needlessly inflates the size of the
distro since most of these
+ jars are already in the distro's lib dir.. -->
+
+ <!-- install netui jars -->
+ <ant antfile="${deployNetui.ant}" target="deploy.netui"
inheritAll="false">
+ <property name="webapp.dir"
location="${dist.dir}/samples/petstoreWeb"/>
+ </ant>
+ <!-- install wsm jars -->
+ <copy todir="${dist.dir}/samples/petstoreWeb/WEB-INF/lib">
+ <fileset dir="${os.BEEHIVE_HOME}/wsm/external"
includes="**/*.jar"/>
+ <fileset dir="${os.BEEHIVE_HOME}/wsm/build/jars"
includes="**/*.jar"/>
+ <fileset file="${velocity14.jar}"/>
+ <fileset file="${velocitydep14.jar}"/>
+ </copy>
+
+ </target>
+
+ <target name="build.dist.docs" depends="docs" description="Builds
documentation for a Beehive distribution">
+ <mkdir dir="${dist.docs.dir}"/>
<!-- copy javadocs to dist -->
- <copy todir="${dist.dir}/docs/javadoc" failOnError="true">
+ <copy todir="${dist.docs.dir}/docs/javadoc" failOnError="true">
<fileset dir="controls/build/docs/reference"/>
<fileset dir="netui/build/docs/reference"/>
<fileset dir="wsm/build/docs/reference"/>
</copy>
- <copy todir="${dist.dir}/docs" failOnError="true">
+ <copy todir="${dist.docs.dir}/docs" failOnError="true">
<fileset file="netui/docs/index.html"/>
</copy>
</target>
@@ -331,9 +375,28 @@
<jar destfile="build/jars/${dist.name}-${beehive.version}.jar"
basedir="${dist.dir}"/>
</target>
+ <target name="build.dist.docs.jar" depends="build.dist"
description="Builds a Beehive distribution docs JAR">
+ <mkdir dir="build/jars"/>
+ <jar destfile="build/jars/${dist.name}-${beehive.version}-docs.jar"
basedir="${dist.docs.dir}"/>
+ </target>
+
<target name="clean.dist">
<delete dir="build/dist"/>
<delete dir="build/tmp-dist"/>
+ </target>
+
+ <target name="test.dist" description="Tests a Beehive distribution">
+ <unzip src="${tomcat.installer}" dest="${dist.dir}"/>
+ <exec executable="cmd" dir="${dist.dir}" newenvironment="true"
os="Windows XP, Windows 2000" outputproperty="testDistro.output">
+ <arg line="/c ${os.BEEHIVE_HOME}/test/testDistro.cmd"/>
+ <env key="dummy" value="value"/>
+ </exec>
+ <fail message="${testDistro.output}">
+ <condition>
+ <contains string="${testDistro.output}" substring="BUILD
FAILED"/>
+ </condition>
+ </fail>
+ <echo message="${testDistro.output}"/>
</target>
<!-- ============================================= -->
Modified: incubator/beehive/trunk/test/ant/buildWebapp.xml
==============================================================================
--- incubator/beehive/trunk/test/ant/buildWebapp.xml (original)
+++ incubator/beehive/trunk/test/ant/buildWebapp.xml Mon Oct 25 11:05:26 2004
@@ -8,9 +8,8 @@
<property name="tomcat.home" location="${tomcat.dir}"/>
<path id="velocity.classpath">
- <fileset dir="${beehive.dir}/external/velocity">
- <include name="velocity*.jar"/>
- </fileset>
+ <fileset file="${velocity14.jar}"/>
+ <fileset file="${velocitydep14.jar}"/>
</path>
<import file="buildWebappCore.xml"/>
Added: incubator/beehive/trunk/test/testDistro.cmd
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/test/testDistro.cmd Mon Oct 25 11:05:26 2004
@@ -0,0 +1,8 @@
+REM
+REM Tests an installation of a Beehive distribution
+REM
+
+call beehiveUser.cmd
+set
+cd ant
+call ant -Dwebapp.dir=%BEEHIVE_HOME%\samples\petstoreWeb -f buildWebapp.xml
build.webapp
Added: incubator/beehive/trunk/user/beehive.properties
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/user/beehive.properties Mon Oct 25 11:05:26 2004
@@ -0,0 +1,24 @@
+#
+#
+# Beehive distribution properties.
+#
+#
+beehive.dir=${os.BEEHIVE_HOME}
+
+controls.jar=${beehive.dir}/lib/controls/controls.jar
+netui-compiler.jar=${beehive.dir}/lib/netui/beehive-netui-compiler.jar
+
+tomcat.dir=${os.CATALINA_HOME}
+ant.dir=${os.ANT_HOME}
+log4j.dir=${os.LOG4J_HOME}
+
+ant.jar=${ant.dir}/lib/ant.jar
+
+log4j.jar=${log4j.dir}/dist/lib/log4j-1.2.8.jar
+servlet24.jar=${tomcat.dir}/common/lib/servlet-api.jar
+jsp20.jar=${tomcat.dir}/common/lib//jsp-api.jar
+jsr173.jar=${beehive.dir}/lib/common/jsr173_1.0_api.jar
+velocity14.jar=${beehive.dir}/lib/controls/velocity-1.4.jar
+tools.jar=${os.JAVA_HOME}/lib/tools.jar
+xbean.jar=${beehive.dir}/lib/common/apache-xbean.jar
+
Added: incubator/beehive/trunk/user/beehiveUser.cmd
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/user/beehiveUser.cmd Mon Oct 25 11:05:26 2004
@@ -0,0 +1,19 @@
[EMAIL PROTECTED] off
+REM
+REM Customize this file based on where you install various 3rd party components
+REM such as the JDK, ant and tomcat.
+REM
+
+REM the root of Beehive distribution
+set [EMAIL PROTECTED]@
+
+REM location of a JDK
+set [EMAIL PROTECTED]@
+
+REM location of ant
+set [EMAIL PROTECTED]@
+
+REM location of tomcat
+set [EMAIL PROTECTED]@
+
+set PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin