You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Echlin, Robert" <Ro...@windriver.com> on 2011/08/08 17:59:42 UTC

Are multiple targets run in order, or in parallel?

Hi
If I run
   "ant target1 target2 target3"
Will target1 be guaranteed to be complete before target2 is run?
The docs don't say.

Thanks,
Rob

--
Rob Echlin, Documentation Systems Architect, Wind River
direct: +1.613.270.5796 | Skype video: rob.echlin.wr | robert.echlin@windriver.com<ma...@windriver.com>


Re: Are multiple targets run in order, or in parallel?

Posted by kasim ahmed <ma...@googlemail.com>.
yes.

On Mon, Aug 8, 2011 at 5:59 PM, Echlin, Robert
<Ro...@windriver.com>wrote:

> Hi
> If I run
>   "ant target1 target2 target3"
> Will target1 be guaranteed to be complete before target2 is run?
> The docs don't say.
>
> Thanks,
> Rob
>
> --
> Rob Echlin, Documentation Systems Architect, Wind River
> direct: +1.613.270.5796 | Skype video: rob.echlin.wr |
> robert.echlin@windriver.com<ma...@windriver.com>
>
>

RE: Are multiple targets run in order, or in parallel?

Posted by "Echlin, Robert" <Ro...@windriver.com>.
Ooops.
Spelling correction below caused by the spell checker - I clicked "change" by mistake.
wk. should have been "wc"

--
Rob Echlin, Documentation Systems Architect, Wind River
direct: +1.613.270.5796 | Skype video: rob.echlin.wr | robert.echlin@windriver.com


> -----Original Message-----
> From: Echlin, Robert [mailto:Robert.Echlin@windriver.com]
> Sent: Monday, August 08, 2011 1:34 PM
> To: Ant Users List
> Subject: RE: Are multiple targets run in order, or in parallel?
> 
> Hi guys,
> Thanks, Dominique, for the reminder about order of execution being
> dependent on dependencies.
> I remember that about dependencies declared in a target.
> I am surprised that there isn't a line in the "Running Ant" page referring to
> the targets page if the same ordering information applies.
> 
> Responses:
> No, I don't know what executors are.
> Unrelated: Reading the "targets" docs page just now told me of a new
> feature called "extension points", which sounds valuable.
> 
> In my situation:
> - target 1 removes all files from the output folders
> - target 2 generates link catalogs for the current document set
> - target 3 builds the output (HTML, PDF, and Eclipse plugins) using the link
> catalogs
> 
> So at least the first one can't possibly depend on later ones directly. :-)
> And it doesn't depend on anything, actually.
> My concern is that it takes several seconds to run, so it could kill the first link
> catalog, (or maybe parts of it?) and I might not know.
> 
> Regarding complexity of dependencies, I ran:
>    grep "<target " *.xml | wk. -l
grep "<target " *.xml | wc -l
>  It says we have 233  targets in the system at the moment, so more complex
> analysis would not be done by visual inspection.
> :-)
> 
> Thanks to Dominique and Scot  for the suggestions to try it  myself - I would
> do that with a simplified build.
> 
> Rob
> 
> 
> 
> 
> --
> Rob Echlin, Documentation Systems Architect, Wind River
> direct: +1.613.270.5796 | Skype video: rob.echlin.wr
> | robert.echlin@windriver.com
> 
> > -----Original Message-----
> > From: Dominique Devienne [mailto:ddevienne@gmail.com]
> > Sent: Monday, August 08, 2011 1:03 PM
> > To: Ant Users List
> > Subject: Re: Are multiple targets run in order, or in parallel?
> >
> > On Mon, Aug 8, 2011 at 10:59 AM, Echlin, Robert
> > <Ro...@windriver.com> wrote:
> > >   "ant target1 target2 target3"
> > > Will target1 be guaranteed to be complete before target2 is run?
> >
> > Yes, with two "but"s:
> > 1) If you use the default executor. If you don't know what an executor
> > is, you most likely are :)
> > 2) If target1 declared a dependency on target2 or target3, directly or
> > not, they could execute in a different order.
> >
> > Note running "ant t1 t2 t3" is almost equivalent to running "ant t1",
> > "ant t2", "ant t3", in the sense that the dependencies of t1 are
> > executed before t1 itself, then the dependencies of t2 before t2, *as
> > if* t1 hasn't been run before (modulo properties/references set by
> > t1), which means that some dependent targets (e.g. init) may execute
> > several times (unless "protected" from multiple executions by a
> > property). So if target1 depends on target2, order of execution would
> > be target2 (from the target1 dependency), target1, target2 (from the
> > explicit cli invocation), target3. At least that's how I recall this
> > works, but you should double-check it yourself. --DD
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Are multiple targets run in order, or in parallel?

Posted by Dominique Devienne <dd...@gmail.com>.
On Mon, Aug 8, 2011 at 12:33 PM, Echlin, Robert
<Ro...@windriver.com> wrote:
> Hi guys,
> Thanks, Dominique, for the reminder about order of execution being dependent on dependencies.
> I remember that about dependencies declared in a target.
> I am surprised that there isn't a line in the "Running Ant" page referring to the targets page if the same ordering information applies.
>
> Responses:
> No, I don't know what executors are.

See 3rd entry in http://ant.apache.org/manual/running.html#sysprops

It allows you to change the way (like the order or parallelism)
targets are executed, to be parallel for example (here's one Google
found for http://code.google.com/p/parallel-ant/source/browse/trunk/src/java/org/codeaholics/tools/build/pant/ParallelExecutor.java?r=5).
It dependencies are stated correctly, a target shouldn't care which
order its dependencies are executed in, as long as they are satisfied.
I remember another executor that generated a "virtual" target than
depends on all targets on the CLI to avoid running their dependencies
multiple times for example.

> Unrelated: Reading the "targets" docs page just now told me of a new feature called "extension points", which sounds valuable.

It's fairly new. Was driven mainly by the EasyAnt authors.

> My concern is that it takes several seconds to run, so it could kill the first link catalog, (or maybe parts of it?) and I might not know.

There's no implicit parallelism in stock Ant, so they won't step on
each other's toes. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Are multiple targets run in order, or in parallel?

Posted by "Echlin, Robert" <Ro...@windriver.com>.
Hi guys,
Thanks, Dominique, for the reminder about order of execution being dependent on dependencies.
I remember that about dependencies declared in a target.
I am surprised that there isn't a line in the "Running Ant" page referring to the targets page if the same ordering information applies.

Responses:
No, I don't know what executors are.
Unrelated: Reading the "targets" docs page just now told me of a new feature called "extension points", which sounds valuable.

In my situation:
- target 1 removes all files from the output folders
- target 2 generates link catalogs for the current document set
- target 3 builds the output (HTML, PDF, and Eclipse plugins) using the link catalogs

So at least the first one can't possibly depend on later ones directly. :-)
And it doesn't depend on anything, actually.
My concern is that it takes several seconds to run, so it could kill the first link catalog, (or maybe parts of it?) and I might not know.

Regarding complexity of dependencies, I ran:
   grep "<target " *.xml | wk. -l
 It says we have 233  targets in the system at the moment, so more complex analysis would not be done by visual inspection. 
:-)

Thanks to Dominique and Scot  for the suggestions to try it  myself - I would do that with a simplified build.

Rob




--
Rob Echlin, Documentation Systems Architect, Wind River
direct: +1.613.270.5796 | Skype video: rob.echlin.wr | robert.echlin@windriver.com

> -----Original Message-----
> From: Dominique Devienne [mailto:ddevienne@gmail.com]
> Sent: Monday, August 08, 2011 1:03 PM
> To: Ant Users List
> Subject: Re: Are multiple targets run in order, or in parallel?
> 
> On Mon, Aug 8, 2011 at 10:59 AM, Echlin, Robert
> <Ro...@windriver.com> wrote:
> >   "ant target1 target2 target3"
> > Will target1 be guaranteed to be complete before target2 is run?
> 
> Yes, with two "but"s:
> 1) If you use the default executor. If you don't know what an executor
> is, you most likely are :)
> 2) If target1 declared a dependency on target2 or target3, directly or
> not, they could execute in a different order.
> 
> Note running "ant t1 t2 t3" is almost equivalent to running "ant t1",
> "ant t2", "ant t3", in the sense that the dependencies of t1 are
> executed before t1 itself, then the dependencies of t2 before t2, *as
> if* t1 hasn't been run before (modulo properties/references set by
> t1), which means that some dependent targets (e.g. init) may execute
> several times (unless "protected" from multiple executions by a
> property). So if target1 depends on target2, order of execution would
> be target2 (from the target1 dependency), target1, target2 (from the
> explicit cli invocation), target3. At least that's how I recall this
> works, but you should double-check it yourself. --DD
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Are multiple targets run in order, or in parallel?

Posted by Dominique Devienne <dd...@gmail.com>.
On Mon, Aug 8, 2011 at 10:59 AM, Echlin, Robert
<Ro...@windriver.com> wrote:
>   "ant target1 target2 target3"
> Will target1 be guaranteed to be complete before target2 is run?

Yes, with two "but"s:
1) If you use the default executor. If you don't know what an executor
is, you most likely are :)
2) If target1 declared a dependency on target2 or target3, directly or
not, they could execute in a different order.

Note running "ant t1 t2 t3" is almost equivalent to running "ant t1",
"ant t2", "ant t3", in the sense that the dependencies of t1 are
executed before t1 itself, then the dependencies of t2 before t2, *as
if* t1 hasn't been run before (modulo properties/references set by
t1), which means that some dependent targets (e.g. init) may execute
several times (unless "protected" from multiple executions by a
property). So if target1 depends on target2, order of execution would
be target2 (from the target1 dependency), target1, target2 (from the
explicit cli invocation), target3. At least that's how I recall this
works, but you should double-check it yourself. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Are multiple targets run in order, or in parallel?

Posted by "Echlin, Robert" <Ro...@windriver.com>.
Thanks, Joe

Rob


> -----Original Message-----
> From: jattardi@gmail.com [mailto:jattardi@gmail.com] On Behalf Of Joe
> Attardi
> Sent: Monday, August 08, 2011 12:01 PM
> To: Ant Users List
> Subject: Re: Are multiple targets run in order, or in parallel?
> 
> They run sequentially.
> 
> On Mon, Aug 8, 2011 at 11:59 AM, Echlin, Robert
> <Robert.Echlin@windriver.com
> > wrote:
> 
> > Hi
> > If I run
> >   "ant target1 target2 target3"
> > Will target1 be guaranteed to be complete before target2 is run?
> > The docs don't say.
> >
> > Thanks,
> > Rob
> >
> > --
> > Rob Echlin, Documentation Systems Architect, Wind River
> > direct: +1.613.270.5796 | Skype video: rob.echlin.wr |
> > robert.echlin@windriver.com<ma...@windriver.com>
> >
> >
> 
> 
> --
> *Joe Attardi*
> joe@attardi.net

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Are multiple targets run in order, or in parallel?

Posted by Joe Attardi <jo...@attardi.net>.
They run sequentially.

On Mon, Aug 8, 2011 at 11:59 AM, Echlin, Robert <Robert.Echlin@windriver.com
> wrote:

> Hi
> If I run
>   "ant target1 target2 target3"
> Will target1 be guaranteed to be complete before target2 is run?
> The docs don't say.
>
> Thanks,
> Rob
>
> --
> Rob Echlin, Documentation Systems Architect, Wind River
> direct: +1.613.270.5796 | Skype video: rob.echlin.wr |
> robert.echlin@windriver.com<ma...@windriver.com>
>
>


-- 
*Joe Attardi*
joe@attardi.net

Re: Are multiple targets run in order, or in parallel?

Posted by "Scot P. Floess" <sf...@nc.rr.com>.
It should unless there is a failure...

Of course, you could test it yourself :)

On Mon, 8 Aug 2011, Echlin, Robert wrote:

> Hi
> If I run
>   "ant target1 target2 target3"
> Will target1 be guaranteed to be complete before target2 is run?
> The docs don't say.
>
> Thanks,
> Rob
>
> --
> Rob Echlin, Documentation Systems Architect, Wind River
> direct: +1.613.270.5796 | Skype video: rob.echlin.wr | robert.echlin@windriver.com<ma...@windriver.com>
>
>

Scot P. Floess             RHCT  (Certificate Number 605010084735240)
Chief Architect FlossWare  http://sourceforge.net/projects/flossware
                            http://flossware.sourceforge.net
                            https://github.com/organizations/FlossWare

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org