You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ying Wang <yi...@hawaii.edu> on 2002/04/18 21:59:24 UTC

A question on design of build

Hi , all,
  The situation is :
  We have a lot of EJB jars, serveral web applications. We are using
weblogic, ant, JDK. The build can run on UNIX and WinNT boxes.
  Currently , we ask every developer to set their own
JAVA_HOME,ANT_HOME,WEBLOGIC_HOME as their system variables. SO the build
can find home to build.

  My question is :
  Can we set a folder like buildtool which includes all the required
homes: part of JDK, ANT, weblogic folders. Every developer do not have to
take care of the system varibles, he only have to download the tool from
VCS to relative directory to the project.
  Is it good?
  Any better idea than this?

Any help is appreciated!

Ying Wang



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some design questions about "ant in anger"

Posted by Ray Tayek <rt...@attbi.com>.
At 06:56 PM 4/18/02 -0700, you wrote:
>I'd recommend you download Ant1.5alpha and read through the user manual
>(jakarta-ant-1.5alpha/docs/manual/index.html).

got it!

thanks

---
ray tayek http://home.attbi.com/~rtayek/
actively seeking telecommuting work
vice chair orange county java users group http://www.ocjug.org/ 
mailto:chair@ocjug.org
hate spam? http://samspade.org/ssw/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: some design questions about "ant in anger"

Posted by Vincent Massol <vm...@octo.com>.

> -----Original Message-----
> From: Ray Tayek [mailto:rtayek@attbi.com]
> Sent: 19 April 2002 08:48
> To: Ant Users List
> Subject: Re: some design questions about "ant in anger"
> 

[snip]

> 
> > > another issue that seems problematic is that of testing. we will
be
> doing
> > > servlets, so there are at least four (4) levels of testing: junit,
> cactus,
> > > httpunit, and someOtherTesting. ...
> >
> >cactus needs ant; httpunit is simply another junit target you run
*after*
> >deploying.

Just a remark: Cactus does not really need Ant. You _can_ use Ant (it's
even recommended) if you wish to automate Cactus tests. It would be the
same as if you were saying that javac needs Ant ... (compilation can be
automated with Ant).

> >
> >so it goes: build, unit tests. deploy. httpunit. cactus
> >-maybe swap http unit and cactus if you want
> 
> yes, cactus seems to deploy in place somehow (at least with tomcat).

No, Cactus does what you want it to do. Cactus is a simple jar :
cactus.jar. What you do with it is up to you. Cactus simply needs to be
packaged in your webapp WAR file (or EAR). Now you can deploy it
manually in your container, use Ant, do some in-place deployment by
configuring the container, etc. It's really up to you. The Cactus sample
shows how to perform in-place deployment (which is my preferred
mechanism).

Just my £0.2 pence ... :-)

> 
> thanks for your assistance.
> 
> ---
> ray tayek http://home.attbi.com/~rtayek/
> actively seeking telecommuting work
> vice chair orange county java users group http://www.ocjug.org/
> mailto:chair@ocjug.org
> hate spam? http://samspade.org/ssw/
> 


-Vincent



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some design questions about "ant in anger"

Posted by Ray Tayek <rt...@attbi.com>.
At 09:45 PM 4/18/02 -0700, you wrote:

>----- Original Message -----
>From: "Ray Tayek" <rt...@attbi.com>
>To: "Ant Users List" <an...@jakarta.apache.org>
>Sent: Thursday, April 18, 2002 17:59
>Subject: some design questions about "ant in anger"
>
> > ... recommends having standard top-level targets like: build, test, ...
> > ... it would seem that ant is smart enough to look at the build.xml 
> file in each
> > directory and do the right thing. is this more or less how it works?
>
>well, you use <ant> to hand off whatever targets you want to projects in
>subdirs; it is not automatic.

ok, he is not that smart. but iirc, he will compile everthing in the tree 
(including subdirectories), so perhaps we need to exclude those files or 
only include the ones we are interested in so we don't compile something in 
a subdirectory that has it's own build.xml file, correct?

> >
> > ... buildtool that contained all of the JAVA_HOME, ANT_HOME properties (or
> > perhaps the build tools themselves?). perhaps that should be one of the
> > top-level targets?
>
>not a toplevel target, but you should keep as much as you can in SCM; ant
>and all other java libs can go in there.

ok

>  I draw the line at java versions,
>oh, wait a minute, I draw the line at JDKs. We do have a JRE installer under
>SCM so that when we burn CDs it pulls everything (even 50MB app server
>installs) from one place.

oh wow! murphys ...er moores law :)


> >
> > the author suggests having "internal" targets at each level like: init,
> > compile, link/jar, staging. not sure what this is all about, buy it sounds
> > sorta like the separation between interface (the standard top level
> > targets) and implementation (the internal "targets").
>
>more that you should have well known targets, be they public ones or
>internal ones.

got it.

> > otoh, if i am using ant calls, what happens to all of the properties that
> > have already been defined by descending the tree up to the point of this
> > particular ant call? do these properties get lost when the new ant call
> > gets made?
>
>your choice

yes, eric pointed out the ant and antcall (inheritAll).


> > when ant sees new build.xml and build.properties files do these
> > "go away" when that ant call terminates?
>
>yes. View it as a heirarchical context of properties; as you return up the
>chain the context gets rolled back.

great!

> > another issue that seems problematic is that of testing. we will be doing
> > servlets, so there are at least four (4) levels of testing: junit, cactus,
> > httpunit, and someOtherTesting. ...
>
>cactus needs ant; httpunit is simply another junit target you run *after* 
>deploying.
>
>so it goes: build, unit tests. deploy. httpunit. cactus
>-maybe swap http unit and cactus if you want

yes, cactus seems to deploy in place somehow (at least with tomcat).

thanks for your assistance.

---
ray tayek http://home.attbi.com/~rtayek/
actively seeking telecommuting work
vice chair orange county java users group http://www.ocjug.org/ 
mailto:chair@ocjug.org
hate spam? http://samspade.org/ssw/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some design questions about "ant in anger"

Posted by Steve Loughran <st...@iseran.com>.
----- Original Message -----
From: "Ray Tayek" <rt...@attbi.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Thursday, April 18, 2002 17:59
Subject: some design questions about "ant in anger"


> hi, i am digging thought the "ant in anger" article and noticed that the
> author

that'll be me :)

>recommends having standard top-level targets like: build, test,
> clean, deploy, publish, fetch, docs/javadocs, all, and main and using ant
> calls to pass the control down the tree. so it seems like while some of
the
> stuff (in the build.xml file) is generic (implementation), some of it is
> non generic (policy) and "knows" what's below in the build tree. it would
> seem that ant is smart enough to look at the build.xml file in each
> directory and do the right thing. is this more or less how it works?

well, you use <ant> to hand off whatever targets you want to projects in
subdirs; it is not automatic.

>
> there was a recent post from yingwang@uhunix2 about a directory called say
> buildtool that contained all of the JAVA_HOME, ANT_HOME properties (or
> perhaps the build tools themselves?). perhaps that should be one of the
> top-level targets?

not a toplevel target, but you should keep as much as you can in SCM; ant
and all other java libs can go in there. I draw the line at java versions,
oh, wait a minute, I draw the line at JDKs. We do have a JRE installer under
SCM so that when we burn CDs it pulls everything (even 50MB app server
installs) from one place.

>
> the author suggests having "internal" targets at each level like: init,
> compile, link/jar, staging. not sure what this is all about, buy it sounds
> sorta like the separation between interface (the standard top level
> targets) and implementation (the internal "targets").

more that you should have well known targets, be they public ones or
internal ones. Common names are good. If you give targets a description
attribute, then when you go
    ant -projecthelp
it lists them differently (in ant 1.5 it wont list targets without a
description except in verbose mode)

>
> otoh, if i am using ant calls, what happens to all of the properties that
> have already been defined by descending the tree up to the point of this
> particular ant call? do these properties get lost when the new ant call
> gets made?

your choice

> when ant sees new build.xml and build.properties files do these
> "go away" when that ant call terminates?

yes. View it as a heirarchical context of properties; as you return up the
chain the context gets rolled back.

> another issue that seems problematic is that of testing. we will be doing
> servlets, so there are at least four (4) levels of testing: junit, cactus,
> httpunit, and someOtherTesting. the cactus seems a bit complicated (he
> deploys in place somehow - i don't quite grok that yet). has anyone had
any
> luck with putting different kinds of testing like these ant?

cactus needs ant; httpunit is simply another junit target you run *after*
deploying.

so it goes

build
unit tests
deploy
httpunit
cactus


-maybe swap http unit and cactus if you want

-steve






--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some design questions about "ant in anger"

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
----- Original Message -----
From: "Ray Tayek" <rt...@attbi.com>
> > > ... if you wanted to override some property, you would need to somehow
> > > process your build.properties in a "bottom up" manner ...
> >
> >you set your properties in precedence order, and the command-line
> >(-D/-propertyfile) options take ultimate precedence.
>
> because the first guy to define it gets it his way, correct?

Exactly.

> i also see that if you do not inheritAll (properties), then it looksl like
> you can still access the "outer" properties by using something called
> "nested property tags".

You can specify properties on an <ant> basis that get defined in the
sub-builds,  yes, even overriding ones that get inherited if you want.

> i was thinking of putting the different tests in different source
> directories and keeping the junit tests in the same package (so i can test
> protected methods easily) but in a different source directory (i would
> expect helper classes to hang out here).

Yes, I keep plain JUnit and Cactus tests in separate trees.  I want my
builds to be testable even without using Cactus on occasion, since Cactus
requires more time and more dependencies and configuration be in place which
may not be the case on every machine. And yes, Tomcat Cactus tests deploy
"in place" which is quite nice (in answer to another e-mail).

    Erik


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some design questions about "ant in anger"

Posted by Ray Tayek <rt...@attbi.com>.
At 09:54 PM 4/18/02 -0400, you wrote:
>----- Original Message -----
>From: "Ray Tayek" <rt...@attbi.com>
>To: "Ant Users List" <an...@jakarta.apache.org>
>Sent: Thursday, April 18, 2002 8:59 PM
>Subject: some design questions about "ant in anger"
>
>
> > hi, i am digging thought the "ant in anger" article ...
>
>I encourage you to have a look at 
>Maven.  ...  http://jakarta.apache.org/turbine/maven/

looks interesting. i will probbaly try it out when i am ready to write that 
"...single set of Ant files are used to build any number of projects that 
you are managing".


> > also, i am a bit confused about properties. afaict, these are immutable
>
>correct, they are immutable.
>
> > ... if you wanted to override some property, you would need to somehow
> > process your build.properties in a "bottom up" manner ...
>
>you set your properties in precedence order, and the command-line
>(-D/-propertyfile) options take ultimate precedence.

because the first guy to define it gets it his way, correct?

> > otoh, if i am using ant calls, what happens to all of the properties that
> > have already been defined by descending the tree up to the point of this
> > particular ant call? do these properties get lost when the new ant call
> > gets made? when ant sees new build.xml and build.properties files do these
> > "go away" when that ant call terminates?
>
>I'm assuming you mean <antcall>?   Or <ant>?

i was thinking of <ant> (did not know about antcall) and was assuming that 
the build file would be from a sub-directory of the current ant task (but i 
can see from the doc that this does not have to be the case - neat!).

>  Either way there are options to pass properties down from the calling build

oops, i should rtfm more :(

i also see that if you do not inheritAll (properties), then it looksl like 
you can still access the "outer" properties by using something called 
"nested property tags".

>and in Ant 1.5 even references.

excellent!

>   Properties do not pass back up though (unless you do some tricks ...
>
> > another issue that seems problematic is that of testing. we will be doing
> > servlets, so there are at least four (4) levels of testing: junit, cactus,
> > httpunit, and someOtherTesting. the cactus seems a bit complicated (he
> > deploys in place somehow - i don't quite grok that yet). has anyone had any
> > luck with putting different kinds of testing like these ant?
>
>These all play fine together, and all are actually JUnit tests anyway, so
>they could even all be run in one <junit> task (although I separate Cactus
>and regular JUnit tests).  HttpUnit tests would be wrapped in a JUnit test
>case, typically, and pretty much any other test I'd perform would be too.

i think i would lobby for more separation of the different kinds of tests. 
if a bunch of your junit guys fail, the you probably want to bail or just 
for organizational reasons.

i was thinking of putting the different tests in different source 
directories and keeping the junit tests in the same package (so i can test 
protected methods easily) but in a different source directory (i would 
expect helper classes to hang out here).

>What specific issues are you having here?

nothing specific, i am just getting started :)

thanks for the assistance

---
ray tayek http://home.attbi.com/~rtayek/
actively seeking telecommuting work
vice chair orange county java users group http://www.ocjug.org/ 
mailto:chair@ocjug.org
hate spam? http://samspade.org/ssw/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some design questions about "ant in anger"

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
----- Original Message -----
From: "Ray Tayek" <rt...@attbi.com>
To: "Ant Users List" <an...@jakarta.apache.org>
Sent: Thursday, April 18, 2002 8:59 PM
Subject: some design questions about "ant in anger"


> hi, i am digging thought the "ant in anger" article and noticed that the
> author recommends having standard top-level targets like: build, test,
> clean, deploy, publish, fetch, docs/javadocs, all, and main and using ant
> calls to pass the control down the tree. so it seems like while some of
the
> stuff (in the build.xml file) is generic (implementation), some of it is
> non generic (policy) and "knows" what's below in the build tree. it would
> seem that ant is smart enough to look at the build.xml file in each
> directory and do the right thing. is this more or less how it works?

I encourage you to have a look at Maven.  It may be what you're looking for
in this regard.

    http://jakarta.apache.org/turbine/maven/

> also, i am a bit confused about properties. afaict, these are immutable

correct, they are immutable.

> (i.e. once defined, they will not be changed). i gather that this means
> that if you wanted to override some property, you would need to somehow
> process your build.properties in a "bottom up" manner (from the leaves to
> the root of the build process). so if i have a property in a
> build.properties file in a subdirectory and i do not use the ant call,
then
> (assuming that ant finds the file in the subdirectory), it would seem like
> the properties would *not* be overridden.

you set your properties in precedence order, and the command-line
(-D/-propertyfile) options take ultimate precedence.

> otoh, if i am using ant calls, what happens to all of the properties that
> have already been defined by descending the tree up to the point of this
> particular ant call? do these properties get lost when the new ant call
> gets made? when ant sees new build.xml and build.properties files do these
> "go away" when that ant call terminates?

I'm assuming you mean <antcall>?   Or <ant>?  Either way there are options
to pass properties down from the calling build and in Ant 1.5 even
references.  Properties do not pass back up though (unless you do some
tricks like writing to a property file and read it back in).

> another issue that seems problematic is that of testing. we will be doing
> servlets, so there are at least four (4) levels of testing: junit, cactus,
> httpunit, and someOtherTesting. the cactus seems a bit complicated (he
> deploys in place somehow - i don't quite grok that yet). has anyone had
any
> luck with putting different kinds of testing like these ant?

These all play fine together, and all are actually JUnit tests anyway, so
they could even all be run in one <junit> task (although I separate Cactus
and regular JUnit tests).  HttpUnit tests would be wrapped in a JUnit test
case, typically, and pretty much any other test I'd perform would be too.

What specific issues are you having here?

    Erik



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: some design questions about "ant in anger"

Posted by Diane Holt <ho...@yahoo.com>.
I'd recommend you download Ant1.5alpha and read through the user manual
(jakarta-ant-1.5alpha/docs/manual/index.html). If you still have questions
after doing that, let us know. See:
  http://marc.theaimsgroup.com/?l=ant-dev&m=101889733409957&w=2
for a link to the alpha downloads area.

Diane


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


some design questions about "ant in anger"

Posted by Ray Tayek <rt...@attbi.com>.
hi, i am digging thought the "ant in anger" article and noticed that the 
author recommends having standard top-level targets like: build, test, 
clean, deploy, publish, fetch, docs/javadocs, all, and main and using ant 
calls to pass the control down the tree. so it seems like while some of the 
stuff (in the build.xml file) is generic (implementation), some of it is 
non generic (policy) and "knows" what's below in the build tree. it would 
seem that ant is smart enough to look at the build.xml file in each 
directory and do the right thing. is this more or less how it works?

there was a recent post from yingwang@uhunix2 about a directory called say 
buildtool that contained all of the JAVA_HOME, ANT_HOME properties (or 
perhaps the build tools themselves?). perhaps that should be one of the 
top-level targets?

the author suggests having "internal" targets at each level like: init, 
compile, link/jar, staging. not sure what this is all about, buy it sounds 
sorta like the separation between interface (the standard top level 
targets) and implementation (the internal "targets").

also, i am a bit confused about properties. afaict, these are immutable 
(i.e. once defined, they will not be changed). i gather that this means 
that if you wanted to override some property, you would need to somehow 
process your build.properties in a "bottom up" manner (from the leaves to 
the root of the build process). so if i have a property in a 
build.properties file in a subdirectory and i do not use the ant call, then 
(assuming that ant finds the file in the subdirectory), it would seem like 
the properties would *not* be overridden.

otoh, if i am using ant calls, what happens to all of the properties that 
have already been defined by descending the tree up to the point of this 
particular ant call? do these properties get lost when the new ant call 
gets made? when ant sees new build.xml and build.properties files do these 
"go away" when that ant call terminates?

another issue that seems problematic is that of testing. we will be doing 
servlets, so there are at least four (4) levels of testing: junit, cactus, 
httpunit, and someOtherTesting. the cactus seems a bit complicated (he 
deploys in place somehow - i don't quite grok that yet). has anyone had any 
luck with putting different kinds of testing like these ant?

thanks

---
ray tayek http://home.attbi.com/~rtayek/
actively seeking telecommuting work
vice chair orange county java users group http://www.ocjug.org/ 
mailto:chair@ocjug.org
hate spam? http://samspade.org/ssw/


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: A question on design of build

Posted by Diane Holt <ho...@yahoo.com>.
--- Ying Wang <yi...@hawaii.edu> wrote:
> Every developer do not have to take care of the system varibles,
> he only have to download the tool from VCS to relative directory to
> the project. Is it good?

Yes. Not only does it take care of things like not having to worry about
everyone's environment, it also allows you to track the versions of the
tools being used.

Diane


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>