You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "KARR, DAVID" <dk...@att.com> on 2012/03/19 17:48:00 UTC

How do I trace where a target was called from in a complicated build?

I'm working with a complex build that calls the "clean" target at some point.  I need to figure out how/where that target is referenced.  I've turned on Ant verbose output, but none of the additional information that produces helps me understand why "clean" was called.  How can I trace how/where this target was called?

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


RE: How do I trace where a target was called from in a complicated build?

Posted by "Echlin, Robert" <Ro...@windriver.com>.
Hi
I see that it does that indeed.
I apparently didn't notice those lines at the end.
Of course I had no way of knowing they would be at the end, or what they would look like.
:-)

Thanks for the info! 
I should be able to use this.

Rob

Rob Echlin, 1.613.270.5796 | Skype: rob.echlin.wr | robert.echlin@windriver.com

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Tuesday, March 20, 2012 11:44 AM
To: user@ant.apache.org
Subject: Re: How do I trace where a target was called from in a complicated build?

On 2012-03-20, Echlin, Robert wrote:

> I tried "ant -p -debug" on my own project.

> It generated 840 lines of output, but did not show the dependencies of
> targets.  Maybe Stefan was thinking of a different parameter?

It has been added in 1.8.2, maybe you are using an older version of Ant.

On Ant's own buildfile you get something like (only showing the last few
lines):

,----
|  probe-offline
|  run-which
|    depends on: check_for_optional_packages
|  ssh-mkdirs
|    depends on: init-upload
|  test-init
|    depends on: probe-offline, check_for_optional_packages
|  xml-check
|    depends on: check_for_optional_packages
| Default target: main
`----

Stefan

---------------------------------------------------------------------
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: How do I trace where a target was called from in a complicated build?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2012-03-20, Echlin, Robert wrote:

> I tried "ant -p -debug" on my own project.

> It generated 840 lines of output, but did not show the dependencies of
> targets.  Maybe Stefan was thinking of a different parameter?

It has been added in 1.8.2, maybe you are using an older version of Ant.

On Ant's own buildfile you get something like (only showing the last few
lines):

,----
|  probe-offline
|  run-which
|    depends on: check_for_optional_packages
|  ssh-mkdirs
|    depends on: init-upload
|  test-init
|    depends on: probe-offline, check_for_optional_packages
|  xml-check
|    depends on: check_for_optional_packages
| Default target: main
`----

Stefan

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


RE: How do I trace where a target was called from in a complicated build?

Posted by "Echlin, Robert" <Ro...@windriver.com>.
Hi David,
I tried "ant -p -debug" on my own project.
It generated 840 lines of output, but did not show the dependencies of targets.
Maybe Stefan was thinking of a different parameter?

So I tried doing it the hard way.
I ran this grep command on all the ant xml files (30):
  grep -e "depends=" -e "<target"
Most of the "target" elements have the depends on the same line, but not all, so I specify both to grep.
Unfortunately that includes all the targets that have no dependencies, as well.

Since we have so many different builds that overwrite parts of the build with their own stuff, there is a  lot of redundancy, but this only gave 257 lines to deal with and I can follow a chain of 'depends' backwards from that information.

Maybe this will help.
Rob


-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Monday, March 19, 2012 1:03 PM
To: user@ant.apache.org
Subject: Re: How do I trace where a target was called from in a complicated build?

On 2012-03-19, KARR, DAVID wrote:

> I'm working with a complex build that calls the "clean" target at some
> point.  I need to figure out how/where that target is referenced.
> I've turned on Ant verbose output, but none of the additional
> information that produces helps me understand why "clean" was called.
> How can I trace how/where this target was called?

ant -p -debug

gives you the dependencies of each target without actually running the
build.  We don't have the opposite of it, unfortunately.

If all else fails, Vizant[1] may help, I'm not sure whether it
understands <import>/<include>, though.

Stefan

[1] http://vizant.sourceforge.net/

---------------------------------------------------------------------
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: How do I trace where a target was called from in a complicated build?

Posted by Stefan Bodewig <bo...@apache.org>.
On 2012-03-19, KARR, DAVID wrote:

> I'm working with a complex build that calls the "clean" target at some
> point.  I need to figure out how/where that target is referenced.
> I've turned on Ant verbose output, but none of the additional
> information that produces helps me understand why "clean" was called.
> How can I trace how/where this target was called?

ant -p -debug

gives you the dependencies of each target without actually running the
build.  We don't have the opposite of it, unfortunately.

If all else fails, Vizant[1] may help, I'm not sure whether it
understands <import>/<include>, though.

Stefan

[1] http://vizant.sourceforge.net/

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


RE: How do I trace where a target was called from in a complicated build?

Posted by Justin Georgeson <JG...@lgc.com>.
> -----Original Message-----
> From: KARR, DAVID [mailto:dk068x@att.com]
> Sent: Monday, March 19, 2012 11:48 AM
> To: user@ant.apache.org
> Subject: How do I trace where a target was called from in a complicated
> build?
> 
> I'm working with a complex build that calls the "clean" target at some point.  I
> need to figure out how/where that target is referenced.  I've turned on Ant
> verbose output, but none of the additional information that produces helps
> me understand why "clean" was called.  How can I trace how/where this
> target was called?

I have good luck with grand (http://www.ggtools.net/grand/),  our Ant dependency graph is denser than our code dependency graphs, and it seems to traverse includes just fine (each source module has an Ant build file that includes the master build file and then overrides only what is necessary and I can run the inherited graph generating target from any of the individual modules' build file)

----------------------------------------------------------------------
This e-mail, including any attached files, may contain confidential and privileged information for the sole use of the intended recipient.  Any review, use, distribution, or disclosure by others is strictly prohibited.  If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.

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


Re: How do I trace where a target was called from in a complicated build?

Posted by Chris Green <ch...@gmail.com>.
Hi David

Can you provide the scipt and I'll have a look and see if I can spot it.

chris

On 19 March 2012 16:48, KARR, DAVID <dk...@att.com> wrote:

> I'm working with a complex build that calls the "clean" target at some
> point.  I need to figure out how/where that target is referenced.  I've
> turned on Ant verbose output, but none of the additional information that
> produces helps me understand why "clean" was called.  How can I trace
> how/where this target was called?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>


-- 
Regards
Chris Green
E-Mail : Chris.green100@gmail.com
Mob : 07779 157247