Author: ekoneil
Date: Mon Feb 21 20:27:31 2005
New Revision: 154784

URL: http://svn.apache.org/viewcvs?view=rev&rev=154784
Log:
Add a petstoreWeb build file that's usable from the Beehive distribution.

This change also includes some of the <macrodef>s in SVN's beehive-imports.xml 
so that the build / clean webapp targets and deploy netui / wsm targets are 
callable as:

  <build-webapp webappDir="..."/>

It should be the case that Beehive developers using the distribution can import 
the distribution's beehive-imports.xml and have access to the Beehive build 
tools / macros that way.

BB: self
Test: build the distribution and ran "ant deploy-beehive build" and "ant clean" 
on petstoreWeb


Modified:
    incubator/beehive/trunk/distribution.xml
    incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml
    incubator/beehive/trunk/user/beehive-imports.xml
    incubator/beehive/trunk/user/buildWebapp.xml

Modified: incubator/beehive/trunk/distribution.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/distribution.xml?view=diff&r1=154783&r2=154784
==============================================================================
--- incubator/beehive/trunk/distribution.xml (original)
+++ incubator/beehive/trunk/distribution.xml Mon Feb 21 20:27:31 2005
@@ -32,6 +32,7 @@
         <antcall target="build.dist.samples"/>
         <antcall target="build.dist.docs"/>
     </target>
+
     <target name="build.system.controls" description="gets controls from 
controlhaus">
         <!-- this pulls down the most generally useful controls from 
             controlhaus.org, and builds them into the distribution --> 
@@ -113,7 +114,7 @@
        <copy 
file="controlhaus/webservice/trunk/servicecontrol/build/jars/webservice-control.jar"
            todir="${dist.dir}/lib/controls"/>        
  
-   </target>
+     </target>
 
     <!-- EJB Control svn targets -->
     <target name="ejb.svn.update" if="ejb.control.exists">
@@ -290,6 +291,9 @@
                 <exclude name="WEB-INF/lib/*.jar"/>
             </fileset>
         </copy>
+
+        <copy tofile="${dist.dir}/samples/petstoreWeb/WEB-INF/src/build.xml" 
+              
file="${beehive.home}/samples/petstoreWeb/WEB-INF/src/build-dist.xml" 
failOnError="true"/>
 
         <!-- Build the controls blank template app distro -->
         <copy todir="${dist.dir}/samples/controls-blank" failOnError="true">

Modified: incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml?view=diff&r1=154783&r2=154784
==============================================================================
--- incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml 
(original)
+++ incubator/beehive/trunk/samples/petstoreWeb/WEB-INF/src/build-dist.xml Mon 
Feb 21 20:27:31 2005
@@ -1,29 +1,58 @@
-<?xml version="1.0" ?>
-
+<?xml version="1.0"?>
 <!--
-   Copyright 2004 The Apache Software Foundation 
- 
+   Copyright 2004 The Apache Software Foundation.
+
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
-  
-      http://www.apache.org/licenses/LICENSE-2.0
-  
+   
+       http://www.apache.org/licenses/LICENSE-2.0
+   
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
- 
+  
    $Header:$
  -->
 
+<!--
+    A build file that needs to be imported by all sub-projects.             
+-->
 <project name="Beehive/Samples/PetstoreWeb" default="build" basedir="../..">
 
-  <import file="../../../../beehive-imports.xml" />
+    <import file="../../../../beehive-imports.xml"/>
 
-  <property name="context.path" value="petstoreWeb"/>
+    <target name="build" description="Build the petstoreWeb webapp">
+        <build-webapp webappDir="${basedir}"/>
+    </target>
 
-  <!-- todo: need to add the clean/build targets to beehive-imports.xml -->
-  
-</project>
+    <target name="clean" description="Clean the petstoreWeb webapp">
+        <clean-webapp webappDir="${basedir}"/>
+    </target>
+
+    <target name="deploy-beehive" description="Copy the Beehive webapp rutime 
into the petstoreWeb webapp">
+        <deploy-netui webappDir="${basedir}"/>
+        <deploy-wsm webappDir="${basedir}"/>
+    </target>
+
+    <target name="usage">
+        <echo>
+Welcome to the Beehive petstoreWeb sample webapp!  
+
+To run the webapp, two steps need to occur:
+- copy the Beehive runtime to the webapp
+- build the webapp
+
+Once the webapp is built, it's ready to deploy onto your application container.
+        <echo>
+
+        <target name="usage" description="Print the usage for this build.xml">
+            <java fork="no" classname="org.apache.tools.ant.Main">
+                <arg line="-f ${ant.file} -projecthelp"/>
+            </java>
+        </target>
+    </target>
+
+</project>
\ No newline at end of file

Modified: incubator/beehive/trunk/user/beehive-imports.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/user/beehive-imports.xml?view=diff&r1=154783&r2=154784
==============================================================================
--- incubator/beehive/trunk/user/beehive-imports.xml (original)
+++ incubator/beehive/trunk/user/beehive-imports.xml Mon Feb 21 20:27:31 2005
@@ -18,7 +18,8 @@
  -->
 
 <!--
-    A build file that needs to be imported by all sub-projects.             
+  This Ant build file contains a set of common paths and targets
+  that can be used to build Beehive source files.
 -->
 <project name="beehive-imports" default="" basedir=".">
 
@@ -42,6 +43,46 @@
         <pathelement location="${beehive.home}/lib/common/apache-xbean.jar"/>
         <pathelement location="${beehive.home}/lib/common/jsr173_1.0_api.jar"/>
     </path>
+
+    <macrodef name="deploy-netui">
+        <attribute name="webappDir"/>
+        <sequential>
+            <echo>Deploy NetUI to webapp @{webappDir}</echo>
+            <ant antfile="${beehive.home}/ant/webappRuntimeCore.xml" 
target="deploy.beehive.webapp.runtime" inheritAll="false">
+                <property name="webapp.dir" location="@{webappDir}"/>
+            </ant>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="deploy-wsm">
+        <attribute name="webappDir"/>
+        <sequential>
+            <echo>Deploy WSM to webapp @{webappDir}</echo>
+            <ant antfile="${beehive.home}/ant/webappRuntimeCore.xml" 
target="deploy.wsm.webapp.runtime" inheritAll="false">
+                <property name="webapp.dir" location="@{webappDir}"/>
+            </ant>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="build-webapp">
+        <attribute name="webappDir"/>
+        <sequential>
+            <echo>Build webapp @{webappDir}</echo>
+            <ant antfile="${beehive.home}/ant/buildWebapp.xml" target="build" 
inheritAll="false">
+                <property name="webapp.dir" location="@{webappDir}"/>
+            </ant>
+        </sequential>
+    </macrodef>
+
+    <macrodef name="clean-webapp">
+        <attribute name="webappDir"/>
+        <sequential>
+            <echo>Clean webapp @{webappDir}</echo>
+            <ant antfile="${beehive.home}/ant/buildWebapp.xml" target="clean" 
inheritAll="false">
+                <property name="webapp.dir" location="@{webappDir}"/>
+            </ant>
+        </sequential>
+    </macrodef>
 
     <target name="usage" description="Print the usage for this build.xml">
         <java fork="no" classname="org.apache.tools.ant.Main">

Modified: incubator/beehive/trunk/user/buildWebapp.xml
URL: 
http://svn.apache.org/viewcvs/incubator/beehive/trunk/user/buildWebapp.xml?view=diff&r1=154783&r2=154784
==============================================================================
--- incubator/beehive/trunk/user/buildWebapp.xml (original)
+++ incubator/beehive/trunk/user/buildWebapp.xml Mon Feb 21 20:27:31 2005
@@ -3,6 +3,7 @@
 <project name="Beehive/WebappBuild" default="usage">
 
     <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
+    <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
 
     <import file="../beehive-imports.xml"/>
     <import file="buildWebappCore.xml"/>
@@ -62,6 +63,7 @@
 
         <delete dir="${webapp.dir}/WEB-INF/classes" includeEmptyDirs="true"/>
         <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}" 
includeEmptyDirs="true"/>
+        <delete dir="${webapp.dir}/WEB-INF/${tmp.jpfgen.dir}" 
includeEmptyDirs="true"/>
     </target>
 
 </project>


Reply via email to