ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Drew Davidson <d...@eblox.com>
Subject Re: Determine target's name
Date Fri, 01 Mar 2002 16:21:58 GMT
Erik Hatcher wrote:

> Welcome to ant-user, Drew my friend!  :)  I was waiting to post on this
> issue until others had gotten a chance to weigh in on it.
>
> I have corresponded with Drew on this issue via private e-mail quite a bit
> and have even pushed back on him with the same "give me a use-case" speech.
> I certainly cannot do justice to his scenario by explaining it myself, but
> the idea is that he wants to drop in sub-projects into his directory
> structure and have them "auto-detected" and incorporated into a master build
> routine automatically.  Drew, is this accurate?  Could you elaborate on your
> scenario a bit if I'm not explaining it properly?

Yes, this is accurate.  I would like to have my source organized into logical
groupings (such as packages, webapps, etc.) and have these auto-detected at
runtime and passed to generic targets for "compile_and_copy_resources" and
"build-web-app" and "deploy-web-app" rather than having to declare each one and
<antcall> to the targets manually.  Then I don't have to modify my build file
every time I add a component.

Also (to Diane primarily) I have been talking with Erik quite a lot in the past
and I realize now that this was my first post on the subject to ant-user;
obviously the state that I was in from talking with Erik was inconsistent with
the perceived state  on this list (it looks like I just jumped in and started
bitching).  Diane, please don't take offense at my posts; from your perspective
there really was no justification for my immediate move to "rant".

I really do with to be constructive with ant, because I really enjoy using it
and it does a good job (and fast!) given it's current goals.

> I have even pushed back on Drew to get involved with ant-dev to explain this
> to everyone and to even make a patch and submit it.  I have even prodded him
> to write a "crawler" task to be bascially an <anton>.

Certainly this is one way to go; it still requires knowing the target to
properly dispatch to the right target.

> After mulling this over a fair bit, I do believe his use-case is valid
> (because I can't think of a reason to *not* provide the target name). While
> some will say this is a slippery slope to Ant becoming a scripting language,
> I don't think so. Why shouldn't Ant provide this context to to tasks?  I
> liken Ant to JSP/Taglibs a fair bit, and within a taglib you have access to
> page, request, session, and application scope contexts.  Is there a reason
> Ant should not provide similar "scoping"?  Taglibs are all about making
> JSP's *not* scripty - to get rid of <% %> junk.

Exactly so, wrt JSP.  Perhaps if ant would be more like JSP in that regard (with
templates, iteration capable, etc.) I wouldn't have to graft this on the front
end with my custom stuff.

> So, for the record, I am +1 on us adding the main target name being executed
> to Ant (probably as "ant.target.name").  I'm CC'ing ant-dev.  While Drew's
> rant on ant-user was certainly harsh, he's been brewing this issue over with
> me privately some in the past so he was not posting on this issue for the
> first time, only for the first time on the list.
>
> It may likely get veto'd by ant-dev.  And I personally don't have the time
> to make this change, so if it gets accepted, Drew, will you supply the patch
> for it?

I can't promise anything but I'll look into it.

> But, in the mean time, I have these requests/suggestions for Drew:
>
> 1) Why not make this change to a local copy of Ant yourself and save
> yourself the trouble of writing your own build file generator?  Then the
> patch is ready, you'll learn the good/bad/ugly of Ant's source code, and you
> can always run your own version of Ant forever!  :)

I think that the current line of thinking on ant development is still
declarative, rather than scripting.

> 2) If you do continue on the build file generator path (as others have done,
> so you may be reinventing the wheel on this, check the archives of ant-dev),
> would you submit it back to ant-dev at the very least for archive purposes,
> or perhaps we even commit it to our CVS?

The template parser is, right now, a private thing that I use in my web
framework.  Open sourcing it is definitely in my plan, but until that is
resolved I can't promise anything.

> 3) Question: how are you able to determine the target at run time with your
> template pre-processor?  You mean you are just able to supply it statically
> into the generated build files, correct?

The pre-processor runs before it starts ant - you basically call my program
which calls ant so it knows the target list before passing it to ant.

> p.s. No offense to any other Java developers out there that I know
> personally, but Drew is by far the sharpest and most innovative Java
> developer/architect I've ever had the pleasure of working with. He is truly
> "ahead of his time" architecturally and the things I've seen him build push
> the envelope of my comprehension.

Thanks, Erik.

- Drew


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message