You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Jonas Tehler <je...@bozoka.com> on 2000/11/01 10:35:39 UTC

Dynamic targets?

There is one thing I'm really missing in Ant. Dynamic targets. If I for
example where to run ant from the command line like this: 

ant com.foo.bar

If there is no com.foo.bar-target this will fail. I would like it to
pass com.foo.bar to some 'dynamic' target where I can do whatever I want
with it (for example replacing the dots with path delimiters and build
that dir). This would make the size of the build files smaller and open
up for all kinds of nice dynamic stuff.

Any thoughts?

/ Jonas Tehler
  bozoka.com

Re: Dynamic targets?

Posted by Jonas Tehler <je...@bozoka.com>.
Nico Seessle wrote:
> 
> ----- Original Message -----
> From: "Jonas Tehler" <je...@bozoka.com>
> To: <an...@jakarta.apache.org>
> Sent: Wednesday, November 01, 2000 10:35 AM
> Subject: Dynamic targets?
> 
> >
> > There is one thing I'm really missing in Ant. Dynamic targets. If I for
> > example where to run ant from the command line like this:
> >
> > ant com.foo.bar
> >
> > If there is no com.foo.bar-target this will fail. I would like it to
> > pass com.foo.bar to some 'dynamic' target where I can do whatever I want
> > with it (for example replacing the dots with path delimiters and build
> > that dir). This would make the size of the build files smaller and open
> > up for all kinds of nice dynamic stuff.
> >
> 
> What target should ant select? Random? Default-Target?
> To what should the argument you provide be assigned?

One would have to define some target for this. Maybe 'dynamic' is a good
name. So if ant gets an argument that it doesn't find a target for, it
hands it to the dynamic target. I guess you could put the argument in
some property. I haven't checked the source so I don't know the best way
to implement this.

> Why can't you use -DusePackage=com.foo.bar and do whatever you want with it
> in the default-target?

Yes.. I guess you could do it that way. But you can't have it check for
existing packages too then. 

/ Jonas

Re: Dynamic targets?

Posted by Nico Seessle <Ni...@epost.de>.
----- Original Message -----
From: "Jonas Tehler" <je...@bozoka.com>
To: <an...@jakarta.apache.org>
Sent: Wednesday, November 01, 2000 10:35 AM
Subject: Dynamic targets?


>
> There is one thing I'm really missing in Ant. Dynamic targets. If I for
> example where to run ant from the command line like this:
>
> ant com.foo.bar
>
> If there is no com.foo.bar-target this will fail. I would like it to
> pass com.foo.bar to some 'dynamic' target where I can do whatever I want
> with it (for example replacing the dots with path delimiters and build
> that dir). This would make the size of the build files smaller and open
> up for all kinds of nice dynamic stuff.
>

What target should ant select? Random? Default-Target?
To what should the argument you provide be assigned?
Why can't you use -DusePackage=com.foo.bar and do whatever you want with it
in the default-target?

Nico