You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Edgar S�nchez <ve...@yahoo.com> on 2001/08/31 19:00:40 UTC

nested targets and calling a target from a command line?

  Hi everyone.. as I told you the questions are not
finished yet :-)

   This time a come with 2 more... :-P

  Is there a chance to nest targets, I mean, can I
have a main target and inside of it, keep 3, 4 or n
targets??? this guide us to the next question..... is
it possible to call a target from a command line??

  all this could be more especific with an example.

  <target name="main1">
      <target name="in1ofmain1">
      </target>
      <target name="in2ofmain1">
      </target>
      <target name="in3ofmain1">
      </target>
      <target name="inNofmain1">
      </target>
  </target>

  <target name="main2" depens="main1">
      <target name="in1ofmain2">
      </target>
      <target name="in2ofmain2">
      </target>
      <target name="in3ofmain2">
      </target>
      <target name="inNofmain2">
      </target>
  </target>

  <target name="main3" depens="main2">
      <target name="in1ofmain3">
      </target>
      <target name="in2ofmain3">
      </target>
      <target name="in3ofmain3">
      </target>
      <target name="inNofmain3">
      </target>
  </target>


  So, from the command line I would like to call
main2, and the dependency would check which target
goes first

   ant -target="main2" -buildfile testtarget.xml

  I do not know if is this too crazy, but, is it
possible??

  Thanks
VES

=====

_________________________________________________________________

"Puedes sentirte desilusionado si fallas, pero est�s condenado si no lo intentas."

"You can get disappointed if you fail down, but you are doomed if you do not try it."

ICQ #  22338121


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

RE: nested targets and calling a target from a command line?

Posted by Edgar S�nchez <ve...@yahoo.com>.
 thanks Ylan!!
--- Ylan Segal <yl...@digiworks.tv> wrote:
> 
> >   so, the command line will be in as follows...
> >
> > ant -compile="targetname" -buildfile buildtest.xml
> >
> >   is it correct???
> >
> Sorry I wasn't clear enough..
> The commnand line would be:
>  ant targetname -buildfile buildtest.xml
> 
> (compile was just the name of my target.!)
> 
> You can actualy include more than one target name,
> for options on running
> ant from the command line type:
> 
> ant -help
> 
> :)
> 
> Ylan Segal.
> 


=====

_________________________________________________________________

"Puedes sentirte desilusionado si fallas, pero est�s condenado si no lo intentas."

"You can get disappointed if you fail down, but you are doomed if you do not try it."

ICQ #  22338121


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

RE: nested targets and calling a target from a command line?

Posted by Ylan Segal <yl...@digiworks.tv>.
>   so, the command line will be in as follows...
>
> ant -compile="targetname" -buildfile buildtest.xml
>
>   is it correct???
>
Sorry I wasn't clear enough..
The commnand line would be:
 ant targetname -buildfile buildtest.xml

(compile was just the name of my target.!)

You can actualy include more than one target name, for options on running
ant from the command line type:

ant -help

:)

Ylan Segal.


Re: nested targets and calling a target from a command line?

Posted by Edgar S�nchez <ve...@yahoo.com>.
  Sorry Nico...

  I wanted to have targets within targets coz I want
some order in the things I'm doing, not for me, for
the people who is going to receive the xmls, is a way
to make them undestand how the xml is builded.

  They don't know xml and Ant, neither do I (at the
begining), but other people has never use and make an
xml.

  thas why, I was asking for it.

--- Nico Seessle <ni...@apache.org> wrote:
> ----- Original Message -----
> From: "Edgar S�nchez" <ve...@yahoo.com>
> To: <an...@jakarta.apache.org>
> Sent: Saturday, September 01, 2001 1:30 AM
> Subject: Re: nested targets and calling a target
> from a command line?
> 
> 
> > > [ Targets nested inside another Target not
> possible]
> > >
> > > >   Uhh thats bad :-)
> > >
> > > Do you mind to tell us: WHY?
> > >
> > Don't worry, is just a mexican meanning!! :-P
> >    it translate as..."uhh que mal"
> 
> Sorry, I still do not understand it. You asked about
> nesting targets inside
> targets, some people answered that it's not
> possible, but they would like to
> know why you need such a feature.
> 
> Have you found another way without nesting targets
> inside targets or do you
> still think it would be nice to be able to nest
> targets inside targets?
> 
> If so, it would be nice if you tell us what you
> would like accomplish with
> the use of nested targets, so that we can tell you a
> "workaround", or the
> "right way" to do it with Ant.
> 
> Nico
> 
> 


=====

_________________________________________________________________

"Puedes sentirte desilusionado si fallas, pero est�s condenado si no lo intentas."

"You can get disappointed if you fail down, but you are doomed if you do not try it."

ICQ #  22338121


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

Re: nested targets and calling a target from a command line?

Posted by Nico Seessle <ni...@apache.org>.
----- Original Message -----
From: "Edgar Sánchez" <ve...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Saturday, September 01, 2001 1:30 AM
Subject: Re: nested targets and calling a target from a command line?


> > [ Targets nested inside another Target not possible]
> >
> > >   Uhh thats bad :-)
> >
> > Do you mind to tell us: WHY?
> >
> Don't worry, is just a mexican meanning!! :-P
>    it translate as..."uhh que mal"

Sorry, I still do not understand it. You asked about nesting targets inside
targets, some people answered that it's not possible, but they would like to
know why you need such a feature.

Have you found another way without nesting targets inside targets or do you
still think it would be nice to be able to nest targets inside targets?

If so, it would be nice if you tell us what you would like accomplish with
the use of nested targets, so that we can tell you a "workaround", or the
"right way" to do it with Ant.

Nico



Re: nested targets and calling a target from a command line?

Posted by Edgar S�nchez <ve...@yahoo.com>.
Don't worry, is just a mexican meanning!! :-P
   it translate as..."uhh que mal"

--- Nico Seessle <ni...@apache.org> wrote:
> 
> ----- Original Message -----
> From: "Edgar S�nchez" <ve...@yahoo.com>
> To: <an...@jakarta.apache.org>
> Sent: Friday, August 31, 2001 7:36 PM
> Subject: RE: nested targets and calling a target
> from a command line?
> 
> [ Targets nested inside another Target not possible]
> 
> >   Uhh thats bad :-)
> >
> 
> Do you mind to tell us: WHY?
> 
> Thanks,
> Nico
> 
> 


=====

_________________________________________________________________

"Puedes sentirte desilusionado si fallas, pero est�s condenado si no lo intentas."

"You can get disappointed if you fail down, but you are doomed if you do not try it."

ICQ #  22338121


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

Re: nested targets and calling a target from a command line?

Posted by Nico Seessle <ni...@apache.org>.
----- Original Message -----
From: "Edgar Sánchez" <ve...@yahoo.com>
To: <an...@jakarta.apache.org>
Sent: Friday, August 31, 2001 7:36 PM
Subject: RE: nested targets and calling a target from a command line?

[ Targets nested inside another Target not possible]

>   Uhh thats bad :-)
>

Do you mind to tell us: WHY?

Thanks,
Nico



RE: nested targets and calling a target from a command line?

Posted by Edgar S�nchez <ve...@yahoo.com>.
  Uhh thats bad :-)

   You are right, antcall will work fine.

--- Diane Holt <ho...@yahoo.com> wrote:
> --- Edgar S�nchez <ve...@yahoo.com> wrote:
> >   and for the second thing, I asked the nested
> > targets, because i want to keep an order of
> modules
> > I'm using, and also use the dependencies from
> > principals targets... but as I said, is a little
> > crazy.
> 
> You can't nest a target within another target, but
> you could use the
> <antcall> task.
> 
> Diane
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant
> messaging with Yahoo! Messenger
> http://im.yahoo.com


=====

_________________________________________________________________

"Puedes sentirte desilusionado si fallas, pero est�s condenado si no lo intentas."

"You can get disappointed if you fail down, but you are doomed if you do not try it."

ICQ #  22338121


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

RE: nested targets and calling a target from a command line?

Posted by Diane Holt <ho...@yahoo.com>.
--- Edgar S�nchez <ve...@yahoo.com> wrote:
>   and for the second thing, I asked the nested
> targets, because i want to keep an order of modules
> I'm using, and also use the dependencies from
> principals targets... but as I said, is a little
> crazy.

You can't nest a target within another target, but you could use the
<antcall> task.

Diane

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



__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

RE: nested targets and calling a target from a command line?

Posted by Edgar S�nchez <ve...@yahoo.com>.
  Thanks Ylan...

  so, the command line will be in as follows...

ant -compile="targetname" -buildfile buildtest.xml

  is it correct???

  and for the second thing, I asked the nested
targets, because i want to keep an order of modules
I'm using, and also use the dependencies from
principals targets... but as I said, is a little
crazy.

 Thanks

VES

--- Ylan Segal <yl...@digiworks.tv> wrote:
> In answer to your second queastion.. sure!!!!
> You can call a target from the commando prompt:
> $> ant compile
> 
> (assuming that you have the ant script for your
> system in the path).
> That will run ant and execute the compile target. If
> that target has any
> dependencies it will run those targets first, and if
> those targets in turn
> have dependencies, it will run them also, and so on.
> 
> as for setting a target within a target, I don't
> believe it is possible, but
> I also don't see why you need it. Dependencies take
> care of that, don't
> they?
> 
> Ylan Segal
> ylan@digworks.tv
> 
> 
> > -----Original Message-----
> > From: Edgar Sanchez [mailto:vesanchez@yahoo.com]
> > Sent: Friday, August 31, 2001 11:01 AM
> > To: ant-user@jakarta.apache.org
> > Subject: nested targets and calling a target from
> a command line?
> >
> >
> >   Hi everyone.. as I told you the questions are
> not
> > finished yet :-)
> >
> >    This time a come with 2 more... :-P
> >
> >   Is there a chance to nest targets, I mean, can I
> > have a main target and inside of it, keep 3, 4 or
> n
> > targets??? this guide us to the next question.....
> is
> > it possible to call a target from a command line??
> >
> >   all this could be more especific with an
> example.
> >
> >   <target name="main1">
> >       <target name="in1ofmain1">
> >       </target>
> >       <target name="in2ofmain1">
> >       </target>
> >       <target name="in3ofmain1">
> >       </target>
> >       <target name="inNofmain1">
> >       </target>
> >   </target>
> >
> >   <target name="main2" depens="main1">
> >       <target name="in1ofmain2">
> >       </target>
> >       <target name="in2ofmain2">
> >       </target>
> >       <target name="in3ofmain2">
> >       </target>
> >       <target name="inNofmain2">
> >       </target>
> >   </target>
> >
> >   <target name="main3" depens="main2">
> >       <target name="in1ofmain3">
> >       </target>
> >       <target name="in2ofmain3">
> >       </target>
> >       <target name="in3ofmain3">
> >       </target>
> >       <target name="inNofmain3">
> >       </target>
> >   </target>
> >
> >
> >   So, from the command line I would like to call
> > main2, and the dependency would check which target
> > goes first
> >
> >    ant -target="main2" -buildfile testtarget.xml
> >
> >   I do not know if is this too crazy, but, is it
> > possible??
> >
> >   Thanks
> > VES
> >
> > =====
> >
> >
>
_________________________________________________________________
> >
> > "Puedes sentirte desilusionado si fallas, pero
> estas condenado si
> > no lo intentas."
> >
> > "You can get disappointed if you fail down, but
> you are doomed if
> > you do not try it."
> >
> > ICQ #  22338121
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Get email alerts & NEW webcam video instant
> messaging with Yahoo!
> > Messenger
> > http://im.yahoo.com
> >
> >
> 


=====

_________________________________________________________________

"Puedes sentirte desilusionado si fallas, pero est�s condenado si no lo intentas."

"You can get disappointed if you fail down, but you are doomed if you do not try it."

ICQ #  22338121


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

RE: nested targets and calling a target from a command line?

Posted by Ylan Segal <yl...@digiworks.tv>.
In answer to your second queastion.. sure!!!!
You can call a target from the commando prompt:
$> ant compile

(assuming that you have the ant script for your system in the path).
That will run ant and execute the compile target. If that target has any
dependencies it will run those targets first, and if those targets in turn
have dependencies, it will run them also, and so on.

as for setting a target within a target, I don't believe it is possible, but
I also don't see why you need it. Dependencies take care of that, don't
they?

Ylan Segal
ylan@digworks.tv


> -----Original Message-----
> From: Edgar Sanchez [mailto:vesanchez@yahoo.com]
> Sent: Friday, August 31, 2001 11:01 AM
> To: ant-user@jakarta.apache.org
> Subject: nested targets and calling a target from a command line?
>
>
>   Hi everyone.. as I told you the questions are not
> finished yet :-)
>
>    This time a come with 2 more... :-P
>
>   Is there a chance to nest targets, I mean, can I
> have a main target and inside of it, keep 3, 4 or n
> targets??? this guide us to the next question..... is
> it possible to call a target from a command line??
>
>   all this could be more especific with an example.
>
>   <target name="main1">
>       <target name="in1ofmain1">
>       </target>
>       <target name="in2ofmain1">
>       </target>
>       <target name="in3ofmain1">
>       </target>
>       <target name="inNofmain1">
>       </target>
>   </target>
>
>   <target name="main2" depens="main1">
>       <target name="in1ofmain2">
>       </target>
>       <target name="in2ofmain2">
>       </target>
>       <target name="in3ofmain2">
>       </target>
>       <target name="inNofmain2">
>       </target>
>   </target>
>
>   <target name="main3" depens="main2">
>       <target name="in1ofmain3">
>       </target>
>       <target name="in2ofmain3">
>       </target>
>       <target name="in3ofmain3">
>       </target>
>       <target name="inNofmain3">
>       </target>
>   </target>
>
>
>   So, from the command line I would like to call
> main2, and the dependency would check which target
> goes first
>
>    ant -target="main2" -buildfile testtarget.xml
>
>   I do not know if is this too crazy, but, is it
> possible??
>
>   Thanks
> VES
>
> =====
>
> _________________________________________________________________
>
> "Puedes sentirte desilusionado si fallas, pero estas condenado si
> no lo intentas."
>
> "You can get disappointed if you fail down, but you are doomed if
> you do not try it."
>
> ICQ #  22338121
>
>
> __________________________________________________
> Do You Yahoo!?
> Get email alerts & NEW webcam video instant messaging with Yahoo!
> Messenger
> http://im.yahoo.com
>
>