You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by wo...@philips.com on 2001/03/14 14:47:18 UTC

terminology

Hi,

I have taken a quick look at the ant docs, and I would like to make some comments about the terminology used. I have been using traditional gnu make styles of make and I think their angle of looking at it is more clear. Let me highlight some parts from 
section "Using Ant" of your docs, mainly from subsection "Targets" (in double quotes):

"Each project defines one or more targets. A target is a set of tasks you want to be executed. When starting Ant, you can select which target(s) you want to have executed. When no target is given, the project's default is used."

I.m.h.o. a target is not a set of tasks, but just a file or whatever desirable object. The set of tasks is the means of getting the target: If the target is out of date, the set of tasks will be executed in order to make the target up to date. That's the 
basic idea of a make utility.

"You might have a target for compiling, for example, and a target for creating a distributable."

Again, target is seen as an action, while it's not. A target is just a file. Compiling is the only the means, not the goal/target. Something like this could be more appropriate: 'You might have several targets for creating java class files, and a target 
for a jar file which groups these together. The latter target then depends on the former targets.'

"It should be noted, however, that Ant's depends attribute only specifies the order in which targets should be executed - it does not affect whether the target that specifies the dependency(s) gets
executed if the dependent target(s) did not (need to) run"

Same again. A hint is that a "target is executed" isn't correct english even, unless you mean the other meaning of executed. A target is made, not executed; the set of task is executed. This terminology is more natural and builds a clearer image of how 
things work.

In subsection "Tasks" a task is defined as a piece of code that can be executed. This is more like it!

For the same reasons as above I don't like the example. A target called "init" and "compile", yuck. You want to make a target called compile? The target is a set of java classes, the target name should reflect that, not the action. So call it "classes" 
or "build tree". Init isn't good either, the target is really a directory structure, so called it "dirs" or something. The way the example and the whole page is set up is to see the makefile as a script, but it isn't a script. A makefile is descriptive, 
and not procedural. A target should really be a noun, not a verb. ("Clean" isn't a really good target either, it's a pronoun, but at least "make clean" makes sense, as opposed to "make compile" and "make init". And "make clean" is a very common 
construction with developers.)

Maybe my comments seem unimportant because it doesn't change how things work, but I think that getting the terminology and examples right is very important for a proper understanding. 

Kind regards,

Wout de Zeeuw

Philips Medical Systems, EasyVision
Room: 		QV-123
Phone:		040-2764094
e-mail:		wout.de.zeeuw@philips.com

Re: terminology

Posted by Glenn McAllister <gl...@somanetworks.com>.
wout.de.zeeuw@philips.com wrote:

> Hi,
>
> I have taken a quick look at the ant docs, and I would like to make some comments about the terminology used. I have been using traditional gnu make styles of make and I think their angle of looking at it is more clear.

And thats where you are missing the point of Ant; it isn't make.  You are translating terminology from a fundamentally different build methodology.  The point of a target is not to build one or more files.  Its to execute a series of tasks, and provide a
way of ordering groups of targets using the "depends" attribute.

Glenn



Re: terminology

Posted by Stefan Bodewig <bo...@apache.org>.
Martin Monsorno <mo...@exolution.de> wrote:

> Anyway, has anybody ever thought about nested task hierarchies? With
> just some sort of dependencies among them?

Yes - see the frANTic proposal in CVS.

Stefan

Re: terminology

Posted by Martin Monsorno <mo...@exolution.de>.
Well, I think the target-is-a-file approach of make is one of its
major drawbacks.

Make has been originally created to (re-)build executables out
of (C-)sources. But it is used also many times to create a complete
system, including configuration tasks or starting server processes,
things that don't depend directly on special files.

When I use make I often think of "how can I get this job done"
instead of "what are the dependencies". If you would say, this is
a misuse of make, then you are right. But this is the way building
tools like make and ant are used much of the time. BTW: "make
compile" may be not a proper english sentence, but unfortunately
computers are not very good in understanding proper english
sentances :-)

I agree that "target" is not the best word for what it stands for,
any suggestions for a better? "Task" was one that came into my
mind, but its used for something else. Anyway, has anybody
ever thought about nested task hierarchies? With just some sort
of dependencies among them?

-- 
Martin Monsorno
mailto:Martin.Monsorno@exolution.de

Re: terminology

Posted by Stefan Bodewig <bo...@apache.org>.
wout de zeeuw <wo...@philips.com> wrote:

> I have taken a quick look at the ant docs, and I would like to make
> some comments about the terminology used. I have been using
> traditional gnu make styles of make and I think their angle of
> looking at it is more clear.

But it doesn't necessarily fit within Ant's view of the world. The
term "target" is used by both tools, but has different meanings.

I don't want to argue whether one terminology is better than the other
- you simply cannot apply the approach of one tool to the terminology
of the other.

> I.m.h.o. a target is not a set of tasks, but just a file or whatever
> desirable object.

This is not exactly the same as what target means in Ant. The object
that corresponds to the "compile" target (which you don't like, I
know) is a whole bunch of .class files in the correct directory
hierarchy, not just a single .class file.

In Ant's view of the world, a target is not just the result of the
build process, but also how to achieve this result - defined via its
dependency list and via the list of tasks that belong to the target
itself.

Let's take two quotes from you to show the difference:

> If the target is out of date, the set of tasks will be executed in
> order to make the target up to date.

The concepts of targets and "up to date" have no connection in Ant -
it's up to the task to decide whether it is supposed to do something,
but it will be executed anyway.

> 'You might have several targets for creating java class files, and a
> target for a jar file which groups these together. The latter target
> then depends on the former targets.'

The things that you call "targets for creating java class files"
simply don't exist in your typical build file - you have

<target name="compile">
  <javac ....>
</target>

with a _single_ javac task. Your average Ant user won't care about
dependencies and up-to-date checks - and not about the single .class
files involved.

> A hint is that a "target is executed" isn't correct english even,

Quite possible - but I (I'm german) understood what it means when I
read it the first time 8-)

> Maybe my comments seem unimportant

No they are not.

> because it doesn't change how things work, but I think that getting
> the terminology and examples right is very important for a proper
> understanding.

So maybe our problem is, that we are using the same terminology as
make but mean a different thing? 

So all we should do, is to explain the concept of targets better than
we currently do - at least to grey-bearded make users.  This section
could probably at best be added by somebody coming from a make
background, which I don't - volunteers?

Stefan

Re: terminology

Posted by Diane Holt <ho...@yahoo.com>.
--- wout.de.zeeuw@philips.com wrote:
> I have taken a quick look at the ant docs, and I would like to make some
> comments about the terminology used.

Glenn and Stefan have already pretty much covered what I would've said,
but I thought I'd add a couple of corrections...

> A target should really be a noun, not a verb.
> ("Clean" isn't a really good target either, it's a pronoun,

"Target" can be either a noun or a verb. "Clean" can be an adjective, an
adverb, or a verb, but not a pronoun.

Okay, enough for the English lesson... :)  Unless someone gets to it
before I do, once I get my new computer set up (and I get back to
connecting through my DSL), I'll revisit the part of the doc that covers
targets and try to add a bit more in the way of explaining the concept as
it pertains to Ant. (Actually, Glenn's and Stefan's responses were clear
enough that they could probably just be incorporated into the doc.) 

Diane 

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



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/