You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ek...@apache.org on 2004/10/26 02:14:25 UTC

svn commit: rev 55542 - in incubator/beehive/trunk: . netui netui/ant netui/src/webapp-template/antfiles test user

Author: ekoneil
Date: Mon Oct 25 17:14:25 2004
New Revision: 55542

Added:
   incubator/beehive/trunk/user/buildWebapp.xml   (contents, props changed)
   incubator/beehive/trunk/user/webappRuntimeCore.xml   (contents, props changed)
Removed:
   incubator/beehive/trunk/netui/src/webapp-template/antfiles/build-dev.xml
   incubator/beehive/trunk/netui/src/webapp-template/antfiles/build.xml
Modified:
   incubator/beehive/trunk/beehive.properties
   incubator/beehive/trunk/build.xml
   incubator/beehive/trunk/netui/ant/webappTemplate.xml
   incubator/beehive/trunk/netui/build.xml
   incubator/beehive/trunk/test/testDistro.cmd
   incubator/beehive/trunk/user/beehive.properties
   incubator/beehive/trunk/user/beehiveUser.cmd
Log:
Build fixup for ApacheCon and the release tomorrow.

This makes a bit of a mess of things.  My apologies in advance.  <g>  

Ken and I are working on getting a basic distribution rolling that is:

- not huge
- testable

The former goal is accomplished by *not* including any built webapps / templates at this time.  In order to support development of the webapps, there is a target in ant/buildWebapp.xml that will deploy a Beehive webapp runtime given a webapp.dir.

The latter goal is accomplished using the "testDistro" script which attempts to build the webapps that are deployed into the distribution.

In addition, there is the addition of a user/buildWebapp.xml file that is used in the distribution to support:

- webapp builds
- copying of the webapp runtime
- deploy / undeploy / redeploy of apps on Tomcat

This file is similar in purpose, though different in environment, the dev-line's test/ant/buildWebapp.xml file.  These *need* to be merged in the near term, but the priority is definitely getting the distribution rolling.  The dev-line will get cleaned up shortly.

BB: self
DRT: Beehive pass
Tests: build.dist test.dist passes



Modified: incubator/beehive/trunk/beehive.properties
==============================================================================
--- incubator/beehive/trunk/beehive.properties	(original)
+++ incubator/beehive/trunk/beehive.properties	Mon Oct 25 17:14:25 2004
@@ -8,6 +8,7 @@
 #
 beehive.dir=${os.BEEHIVE_HOME}
 
+beehive.user.dir=${beehive.dir}/user
 beehive.test.dir=${beehive.dir}/test
 beehive.external.dir=${beehive.dir}/external
 beehive.installed.dir=${beehive.dir}/installed
@@ -52,5 +53,4 @@
 #
 runTomcat.ant=${beehive.test.dir}/ant/runTomcat.xml
 buildWebapp.ant=${beehive.test.dir}/ant/buildWebapp.xml
-deployNetui.ant=${beehive.test.dir}/ant/deployNetui.xml
-
+deployNetui.ant=${beehive.test.dir}/ant/deployNetui.xml
\ No newline at end of file

Modified: incubator/beehive/trunk/build.xml
==============================================================================
--- incubator/beehive/trunk/build.xml	(original)
+++ incubator/beehive/trunk/build.xml	Mon Oct 25 17:14:25 2004
@@ -242,30 +242,32 @@
     <!--                                               -->
     <!-- ============================================= -->
 
-    <target name="build.dist" description="Builds a Beehive distribution">
+    <target name="build.dist" depends="deploy" description="Builds a Beehive distribution">
         <mkdir dir="${dist.dir}"/>
 
         <antcall target="build.dist.core"/>
         <antcall target="build.dist.samples"/>
     </target>
 
-    <target name="build.dist.core" depends="deploy">
+    <target name="build.dist.core">
         <!-- copy the required libraries into dist/ -->
         <copy todir="${dist.dir}/lib/common" failOnError="true">
             <fileset file="${log4j.jar}"/>
             <fileset file="${xbean.jar}"/>
             <fileset file="${jsr173.jar}"/>
+
+            <!-- these are required by Controls and WSM -->
+            <fileset file="${velocity14.jar}"/>
+            <fileset file="${velocity14dep.jar}"/>
         </copy>
 
         <copy todir="${dist.dir}/lib/controls" failOnError="true">
             <fileset file="${controls.jar}"/>
-            <fileset file="${velocity14.jar}"/>
-            <fileset file="${velocity14dep.jar}"/>
         </copy>
 
         <copy todir="${dist.dir}/lib/wsm" failOnError="true">
-            <fileset file="${os.BEEHIVE_HOME}/wsm/build/jars/wsm.jar"/>
-            <fileset file="${os.BEEHIVE_HOME}/wsm/build/jars/wsm-axis.jar"/>
+            <fileset dir="${os.BEEHIVE_HOME}/wsm/external" includes="**/*.jar"/>
+            <fileset dir="${os.BEEHIVE_HOME}/wsm/build/jars" includes="**/*.jar"/>
         </copy>
 
         <copy todir="${dist.dir}/lib/netui" failOnError="true" flatten="true">
@@ -283,22 +285,31 @@
             </fileset>
         </copy>
 
+        <!-- this directory structure can't be flattened -->
+        <copy todir="${dist.dir}/lib/netui/resources" failOnError="true">
+            <fileset dir="${os.BEEHIVE_HOME}/netui/build/dist/webapp/resources">
+                <include name="**/*"/>
+            </fileset>
+        </copy>
+ 
         <!-- 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.user.dir}/webappRuntimeCore.xml"/>
+            <fileset file="${beehive.user.dir}/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">
+            <fileset dir="${beehive.user.dir}">
                 <include name="*.*"/>
+                <exclude name="*.xml"/>
             </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"/>
+                <filter token="CATALINA_HOME" value="${beehive.installed.dir}/jakarta-tomcat-5.0.25"/>
             </filterset>
         </copy>
 
@@ -308,23 +319,16 @@
         <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"/>
+            <fileset dir="${os.BEEHIVE_HOME}/netui/build/dist/webapp">
+                <exclude name="WEB-INF/lib/*.jar"/>
+                <exclude name="WEB-INF/*.tld"/>
+                <exclude name="WEB-INF/*.tldx"/>
+            </fileset>
         </copy>
 
-        <copy todir="build/tmp-dist/${webapp.name}/WEB-INF/src" overwrite="true">
-            <fileset file="${os.BEEHIVE_HOME}/netui/build/dist/webapp/WEB-INF/src/build.xml"/>
-            <filterset>
-                <filter token="WEBAPP_CONTEXT_PATH" value="${webapp.name}"/>
-            </filterset>
+        <copy todir="build/dist/samples/netui-blank">
+            <fileset dir="build/tmp-dist/${webapp.name}"/>
         </copy>
-
-        <ant dir="build/tmp-dist/${webapp.name}/WEB-INF/src" antfile="build.xml" target="build.webapp">
-            <property name="os.BEEHIVE_DIST_HOME" location="${os.BEEHIVE_HOME}/build/dist"/>
-            <property name="webapp.dir" location="${os.BEEHIVE_HOME}/build/tmp-dist/${webapp.name}"/>
-        </ant>
-
-        <jar destfile="${dist.dir}/templates/${webapp.name}.war" basedir="build/tmp-dist/${webapp.name}"/>
-        
     </target>
 
     <target name="build.dist.samples">
@@ -335,26 +339,18 @@
 
         <!-- 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 antfile="${buildWebapp.ant}" target="clean.webapp">
+            <property name="webapp.dir" location="${os.BEEHIVE_HOME}/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>
 
+        <copy todir="${dist.dir}/samples/petstoreWeb" failOnError="true">
+            <fileset dir="samples/petstoreWeb">
+                <exclude name="WEB-INF/src/petstore-build.xml"/>
+                <exclude name="WEB-INF/lib/*.jar"/>
+                <exclude name="WEB-INF/*.tld"/>
+                <exclude name="WEB-INF/*.tldx"/>
+            </fileset>
+        </copy>
     </target>
 
     <target name="build.dist.docs" depends="docs" description="Builds documentation for a Beehive distribution">
@@ -371,11 +367,15 @@
     </target>
 
     <target name="build.dist.jar" depends="build.dist" description="Builds a Beehive distribution JAR">
+        <fail unless="beehive.version" message="Could not build distribution JARs; beehive.version was not specified"/>
+
         <mkdir dir="build/jars"/>
         <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">
+        <fail unless="beehive.version" message="Could not build distribution JARs; beehive.version was not specified"/>
+
         <mkdir dir="build/jars"/>
         <jar destfile="build/jars/${dist.name}-${beehive.version}-docs.jar" basedir="${dist.docs.dir}"/>
     </target>
@@ -387,7 +387,7 @@
 
     <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">
+        <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>

Modified: incubator/beehive/trunk/netui/ant/webappTemplate.xml
==============================================================================
--- incubator/beehive/trunk/netui/ant/webappTemplate.xml	(original)
+++ incubator/beehive/trunk/netui/ant/webappTemplate.xml	Mon Oct 25 17:14:25 2004
@@ -75,9 +75,6 @@
             </fileset>
         </copy>
 
-        <!-- include the default build files -->
-        <copy file="${template.root.dir}/antfiles/build.xml" todir="${webapp.dir}/WEB-INF/src"/>
-
         <!-- copy the javascript files to the javavscript directory -->
         <copy file="${src.dir}/javascript/tagshtml/netui-tree.js" todir="${javascript.dir}"/>
 

Modified: incubator/beehive/trunk/netui/build.xml
==============================================================================
--- incubator/beehive/trunk/netui/build.xml	(original)
+++ incubator/beehive/trunk/netui/build.xml	Mon Oct 25 17:14:25 2004
@@ -91,7 +91,7 @@
         </ant>
     </target>
 
-    <target name="create.beehive.webapp">
+    <target name="create.beehive.webapp" description="Utility target that will create a Beehive enabled webapp using the properties webapp.dir and context.path">
         <fail unless="webapp.dir" message="The ${webapp.dir} property is unset"/>
         <fail unless="context.path" message="The ${context.path} property is unset"/>
 
@@ -100,13 +100,6 @@
         </copy>
 
         <mkdir dir="${webapp.dir}/WEB-INF/src"/>
-
-        <copy tofile="${webapp.dir}/WEB-INF/src/build.xml" overwrite="true">
-            <fileset file="${os.BEEHIVE_HOME}/netui/src/webapp-template/default/build-dev.xml"/>
-            <filterset>
-                <filter token="WEBAPP_CONTEXT_PATH" value="${context.path}"/>
-            </filterset>
-        </copy>
     </target>
 
 </project>

Modified: incubator/beehive/trunk/test/testDistro.cmd
==============================================================================
--- incubator/beehive/trunk/test/testDistro.cmd	(original)
+++ incubator/beehive/trunk/test/testDistro.cmd	Mon Oct 25 17:14:25 2004
@@ -5,4 +5,4 @@
 call beehiveUser.cmd
 set
 cd ant
-call ant -Dwebapp.dir=%BEEHIVE_HOME%\samples\petstoreWeb -f buildWebapp.xml build.webapp
+call ant -Dwebapp.dir=%BEEHIVE_HOME%\samples\petstoreWeb -f buildWebapp.xml deploy.beehive.webapp.runtime build.webapp

Modified: incubator/beehive/trunk/user/beehive.properties
==============================================================================
--- incubator/beehive/trunk/user/beehive.properties	(original)
+++ incubator/beehive/trunk/user/beehive.properties	Mon Oct 25 17:14:25 2004
@@ -5,20 +5,22 @@
 #
 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}
 
+# External JARs not included in the Beehive distribution
+tools.jar=${os.JAVA_HOME}/lib/tools.jar
 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
+jsp20.jar=${tomcat.dir}/common/lib/jsp-api.jar
+
+# External JARs included in the Beehive distribution
 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
+velocity14.jar=${beehive.dir}/lib/common/velocity-1.4.jar
 xbean.jar=${beehive.dir}/lib/common/apache-xbean.jar
 
+# Beehive JARs
+controls.jar=${beehive.dir}/lib/controls/controls.jar
+netui-compiler.jar=${beehive.dir}/lib/netui/beehive-netui-compiler.jar

Modified: incubator/beehive/trunk/user/beehiveUser.cmd
==============================================================================
--- incubator/beehive/trunk/user/beehiveUser.cmd	(original)
+++ incubator/beehive/trunk/user/beehiveUser.cmd	Mon Oct 25 17:14:25 2004
@@ -1,7 +1,7 @@
 @echo off
 REM
 REM Customize this file based on where you install various 3rd party components
-REM such as the JDK, ant and tomcat.
+REM such as the JDK, Ant and Tomcat.
 REM
 
 REM the root of Beehive distribution
@@ -10,10 +10,10 @@
 REM location of a JDK
 set JAVA_HOME=@JAVA_HOME@
 
-REM location of ant
+REM location of Ant
 set ANT_HOME=@ANT_HOME@
 
-REM location of tomcat
+REM location of Tomcat
 set CATALINA_HOME=@CATALINA_HOME@
 
 set PATH=%PATH%;%JAVA_HOME%\bin;%ANT_HOME%\bin

Added: incubator/beehive/trunk/user/buildWebapp.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/user/buildWebapp.xml	Mon Oct 25 17:14:25 2004
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+
+<!-- 
+    Beehive webapp build file.
+
+    This build file will compile source files for Beehive / XMLBean / Java 
+    source artifacts that are located in the webapp under the following locations:
+
+    webapp-root/
+      *.jpf,*.jpfs
+      WEB-INF/
+        schemas/
+          *.xsd
+        src/
+          *.java,*.jcs,*.jcx
+
+    In addition, all of the resource files in WEB-INF/src will be moved into 
+    WEB-INF/classes so that they are available in classloader in a webapp's 
+    runtime.
+-->
+<project name="Webapp Build" default="usage" basedir="../..">
+
+    <property environment="os"/>
+    <property file="${os.BEEHIVE_HOME}/beehive.properties"/>
+
+    <property name="tomcat.home" location="${tomcat.dir}"/>
+
+    <path id="velocity.classpath">
+        <fileset file="${velocity14.jar}"/>
+        <fileset file="${velocitydep14.jar}"/>
+    </path>
+
+    <!-- 
+        Import the canonical Beehive webapp build targets.
+      -->
+    <import file="${beehive.dir}/ant/buildWebappCore.xml"/>
+
+    <!-- 
+        Import the canonical Beehive webapp runtime deployment targets.
+      -->
+    <import file="${beehive.dir}/ant/webappRuntimeCore.xml"/>
+
+    <!-- 
+        Use of the tasks defined in runTomcatCore.xml require that the "manager" role be setup 
+        in Tomcat.  A user's credentials (username / password) should be used here in order
+        to use the Tomcat deployment Ant tasks.
+      -->
+    <property name="catalina.username" location="manager"/>
+    <property name="catalina.password" location="manager"/>
+
+    <import file="${beehive.dir}/ant/runTomcatCore.xml"/>
+
+    <target name="usage" description="Print the usage for this build.xml">
+        <java fork="no" classname="org.apache.tools.ant.Main">
+            <arg line="-projecthelp"/>
+        </java>
+    </target>
+
+</project>

Added: incubator/beehive/trunk/user/webappRuntimeCore.xml
==============================================================================
--- (empty file)
+++ incubator/beehive/trunk/user/webappRuntimeCore.xml	Mon Oct 25 17:14:25 2004
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+
+<project name="Beehive/Webapp Build" default="usage" basedir=".">
+
+    <property environment="os"/>
+    <property file="${os.BEEHIVE_HOME}/beehive.properties"/>
+
+    <property name="webappTemplate.dir" location="${os.BEEHIVE_HOME}/netui/build/dist/webapp"/>
+
+    <target name="deploy.beehive.webapp.runtime" description="Deploy the Beehive webapp runtime given a webapp root as -Dwebapp.dir">
+        <available property="webapp.dir.available" file="${webapp.dir}" type="dir"/>
+        <fail unless="webapp.dir.available" message="Can't find the webapp directory ${webapp.dir}"/>
+
+        <echo>Deploy NetUI to webapp rooted at: ${webapp.dir}</echo>
+
+        <copy todir="${webapp.dir}/WEB-INF/lib">
+            <fileset dir="${os.BEEHIVE_HOME}/lib/netui">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${os.BEEHIVE_HOME}/lib/common">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${os.BEEHIVE_HOME}/lib/controls">
+                <include name="*.jar"/>
+            </fileset>
+            <fileset dir="${os.BEEHIVE_HOME}/lib/wsm/">
+                <include name="*.jar"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${webapp.dir}/WEB-INF/">
+            <fileset dir="${os.BEEHIVE_HOME}/lib/netui">
+                <include name="**.tld*"/>
+            </fileset>
+        </copy>
+
+        <copy todir="${webapp.dir}/resources/">
+            <fileset dir="${os.BEEHIVE_HOME}/lib/netui/resources">
+                <include name="**/*"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="usage" description="Print the usage for this build.xml">
+        <java fork="no" classname="org.apache.tools.ant.Main">
+            <arg line="-projecthelp"/>
+        </java>
+    </target>
+
+</project>