You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by Bryan Che <bc...@redhat.com> on 2004/10/14 21:45:01 UTC

build.xml patch (was Re: pageflow tutorial question)

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
>>


Re: build.xml patch (was Re: pageflow tutorial question)

Posted by Eddie O'Neil <ek...@bea.com>.
   Will do.

   Once it's in, we can go around on how it works and make modifications 
as needed.

Eddie



Bryan Che wrote:
>> It'd be an Ant target that creates a directory that contains basically 
>> everything that's in:
>>
>>   $BEEHIVE_HOME/netui/build/dist/webapp
>>
>> and can call targets like build / clean / deploy / undeploy / redeploy 
>> / start / stop.
>>
>> Today or tomorrow, I'm going to checkin a build file a la the one 
>> described above that would be used to build a webapp created from a 
>> Beehive distribution.  Maybe that would help shed some light one way 
>> that this could work...  Let me know if anyone would like a 
>> preliminary copy of this sent into the dev list.
> 
> 
> That sounds great.  If you're checking in today or tomorrow, I'll just 
> look for the new file.  Please e-mail out after you've checked in the 
> file with a description of how to use it and where it is located.
> 
> BTW, is there a way to get e-mail alerts about svn checkins to beehive?
> 
> Bryan
> 

Re: build.xml patch (was Re: pageflow tutorial question)

Posted by Bryan Che <bc...@redhat.com>.
> It'd be an Ant target that creates a directory that contains basically 
> everything that's in:
> 
>   $BEEHIVE_HOME/netui/build/dist/webapp
> 
> and can call targets like build / clean / deploy / undeploy / redeploy / 
> start / stop.
> 
> Today or tomorrow, I'm going to checkin a build file a la the one 
> described above that would be used to build a webapp created from a 
> Beehive distribution.  Maybe that would help shed some light one way 
> that this could work...  Let me know if anyone would like a preliminary 
> copy of this sent into the dev list.

That sounds great.  If you're checking in today or tomorrow, I'll just 
look for the new file.  Please e-mail out after you've checked in the 
file with a description of how to use it and where it is located.

BTW, is there a way to get e-mail alerts about svn checkins to beehive?

Bryan

-- 
Bryan Che
Red Hat, Inc.
10 Technology Park
Westford, MA 01886
978-392-3107
bche@redhat.com

Re: build.xml patch (was Re: pageflow tutorial question)

Posted by Eddie O'Neil <ek...@bea.com>.
   Comments in-line.

   Note, I've taken the user list off of this discussion for the moment...

Bryan Che wrote:
> Eddie O'Neil wrote:
> 
>>
>>   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 patches /trunk/build.xml

Gotcha, thanks!

> 
>>
>>   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?
> 
> 
> Doing this could present a couple difficulties:
> -if the canonical project build.xml gets updated, then you'll have to be 
> sure to remember copy that build.xml file to all your projects.  This 
> could lead to projects with build.xml files that are out of sync

The way we're (currently) dealing with this is that the canonical build 
files are imported using Ant 1.6 <import>.  That way, any build file 
that imports the buildWebappCore.xml Ant file is always up-to-date with 
*the* file that does builds.  So, unless the APIs to the this build file 
change (which hopefully won't happen often), callers should be fine. 
This typically is setup like this:

   build.xml
     - define local properties such as webapp context root
     - import buildWebappCore.xml to pickup the canonical Beehive webapp 
build tasks
     - import runTomcatCore.xml to pickup the canonical Tomcat 
start/deploy tasks
     - define any custom targets needed to build a .war distribution, 
perform additional build steps, generate Javadoc, etc.

I think part of the reason I'm a little hesitant to add these to 
$BEEHIVE_HOME/build.xml is that there are clean / build / deploy / 
undeploy / redeploy / start / stop targets that all need to be there in 
order to do everything to a Tomcat webapp in one place.  Just doesn't 
feel like this belongs in the top-level project build file.

But, we can certainly debate the merits either way.  <g>

> -unless creating a webapp is somehow automated, this places an extra 
> burden on developers to copy the appropriate build.xml to their new webapp

I actually think creating a webapp from the dev tree *should* be 
automated -- in addition to making it easy for users, it'd be nice for 
it to be equally easy for Beehive devs.

It'd be an Ant target that creates a directory that contains basically 
everything that's in:

   $BEEHIVE_HOME/netui/build/dist/webapp

and can call targets like build / clean / deploy / undeploy / redeploy / 
start / stop.

Today or tomorrow, I'm going to checkin a build file a la the one 
described above that would be used to build a webapp created from a 
Beehive distribution.  Maybe that would help shed some light one way 
that this could work...  Let me know if anyone would like a preliminary 
copy of this sent into the dev list.

> 
>>
>>   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.
> 
> 
> Yes, that would be useful.
> 
> Bryan
> 

Re: build.xml patch (was Re: pageflow tutorial question)

Posted by Bryan Che <bc...@redhat.com>.
Eddie O'Neil wrote:
> 
>   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 patches /trunk/build.xml

> 
>   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?

Doing this could present a couple difficulties:
-if the canonical project build.xml gets updated, then you'll have to be 
sure to remember copy that build.xml file to all your projects.  This 
could lead to projects with build.xml files that are out of sync
-unless creating a webapp is somehow automated, this places an extra 
burden on developers to copy the appropriate build.xml to their new webapp

> 
>   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.

Yes, that would be useful.

Bryan

Re: build.xml patch (was Re: pageflow tutorial question)

Posted by Bryan Che <bc...@redhat.com>.
Eddie O'Neil wrote:
> 
>   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 patches /trunk/build.xml

> 
>   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?

Doing this could present a couple difficulties:
-if the canonical project build.xml gets updated, then you'll have to be 
sure to remember copy that build.xml file to all your projects.  This 
could lead to projects with build.xml files that are out of sync
-unless creating a webapp is somehow automated, this places an extra 
burden on developers to copy the appropriate build.xml to their new webapp

> 
>   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.

Yes, that would be useful.

Bryan

Re: build.xml patch (was Re: pageflow tutorial question)

Posted by Eddie O'Neil <ek...@bea.com>.
   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>
>>
>>    <!-- ============================================= -->
>>    <!--                                               -->

Re: build.xml patch (was Re: pageflow tutorial question)

Posted by Eddie O'Neil <ek...@bea.com>.
   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>
>>
>>    <!-- ============================================= -->
>>    <!--                                               -->