Cool! Yeah, this is sort of what I'm working on now for the distribution but haven't gotten around to doing it internally.
What build.xml file does this patch? There are several of them. <g>
It might be worth having a standalone build file that can be included with a webapp rather than a single one to use for all webapps. The targets would be the same but the BEEHIVE_PROJECT environment variable would be set in the build file itself and probably just point to ${basedir}.
What would you think about that?
Also, it might be worth getting the Tomcat deploy / undeploy targets wired in -- these would use the same ${basedir} for the webapp root and would need a context root property as well.
Eddie
Bryan Che wrote:
Hi, I can certainly understand modifying the tutorial to reflect the
upcoming beehive binaries. For those who want to work with the beehive
source, though, can we also consolidate building webapps into a single ant build file?
As an example, I've patched the main beehive build.xml so that it can handle webapps. I've attached a sample patch file to build.xml to show what I mean. This patch would allow doing things like
$ export BEEHIVE_PROJECT=[path to project webapp root] $ ant clean-project (cleans out WEB-INF and the webapp) $ ant init-project (makes the WEB-INF dir) $ ant build-project (builds the webapp)
Something like this would make working with various webapps much more convenient.
Bryan
Eddie O'Neil wrote:
One thing to mention here...
Right now, the tutorial is running against the Beehive tree as it is built out of SVN. In a week or two once a Beehive distribution is producable as part of the build (and eventually downloadable from the website), the tutorial will shift all of these commands to run against the Ant build files for building webapps / WSM that are shipped as part of the distribution. These will be different than the ones currently referenced below, though you will be able to use them similarly.
You'll also be able to run the webapps against any 5.x version of Tomcat since the distribution doesn't include Tomcat (or Axis).
We're working on getting some of this done right now.
So, the commands below are great for now, but it will be easier at some point in the near future.
<g>
Eddie
ps -- thanks for all the feedback on and interest in the tutorials!
Leverett, Paul Van wrote:
Hi,
I have another suggestion for the tutorial. The following string is used quite a bit throughout the tutorial. It can be set to an environment variable to save typing and make the tutorial more readable.
"C:\beehive-src\trunk\installed\jakarta-tomcat-5.0.25\webapps\pageflow_t utorial "
--------------------------------------- Set the environment variable
set PF_TUTORIAL=C:\beehive-src\trunk\installed\jakarta-tomcat-5.0.25\webapps \pageflow_tutorial ---------------------------------------
Commands like
"ant -f webappTemplate.xml -Dwebapp.dist.dir=C:\beehive-src\trunk\installed\jakarta-tomcat-5.0.25\w ebapps\pageflow_tutorial "
becomes
"ant -f webappTemplate.xml -Dwebapp.dist.dir=%PF_TUTORIAL%"
-----------------------------------------
Instructions like
"In the directory C:/beehive-src/trunk/installed/jakarta-tomcat-5.0.25/webapps/pageflow_tu torial, create a file named index.jsp."
becomes
"In the directory PF_TUTORIAL, create a file named index.jsp"
-------------------------------------------
Thanks, Paul
------------------------------------------------------------------------
309a310,348
<!-- Initialize Project --> <!-- --> <!-- ============================================= --> <target name="init-project" description="Initialize Beehive Web Application $BEEHIVE_PROJECT"> <echo>initialize webapp ${os.BEEHIVE_PROJECT}</echo> <ant dir="netui/ant" antfile="webappTemplate.xml" > <property name="webapp.dist.dir" value="${os.BEEHIVE_PROJECT}" /> </ant> </target>
<!-- ============================================= --> <!-- --> <!-- Build Project --> <!-- --> <!-- ============================================= --> <target name="build-project" description="Build Beehive Web Application $BEEHIVE_PROJECT "> <echo>build webapp ${os.BEEHIVE_PROJECT}</echo> <ant dir="test/ant" target="build.webapp" antfile="buildWebapp.xml"> <property name="webapp.dir" value="${os.BEEHIVE_PROJECT}" /> </ant> </target>
<!-- ============================================= --> <!-- --> <!-- Clean Project --> <!-- --> <!-- ============================================= --> <target name="clean-project" description="Clean Beehive Web Application $BEEHIVE_PROJECT "> <echo>clean webapp ${os.BEEHIVE_PROJECT}</echo> <ant dir="netui/ant" antfile="webappTemplate.xml" target="undeploy.netui.runtime"> <property name="webapp.dir" value="${os.BEEHIVE_PROJECT}" /> </ant> <ant dir="test/ant" target="clean.webapp" antfile="buildWebapp.xml"> <property name="webapp.dir" value="${os.BEEHIVE_PROJECT}" /> </ant> </target>
<!-- ============================================= --> <!-- -->
