I hope someone finds a simpler way, but I was able to work through it using the
report task and then parsing the xml file with xmltask:
<ivy:report xml="true" xsl="false" graph="false" dot="false"
todir="${basedir}/build/report" outputpattern="report.xml"/>
<ac:var name="report.directDependencies"/>
<ac:var name="report.allDependencies"/>
<xt:xmltask source="${basedir}/build/report/report.xml">
<xt:call path="ivy-report/dependencies/module">
<param name="reportModuleDependencyName"
path="@name"/>
<param name="reportModuleDependencyParent"
path="revision/caller/@name"/>
<xt:actions>
<ac:if>
<equals
arg1="@{reportModuleDependencyParent}" arg2="${ivy.module}"/>
<ac:then>
<ac:var
name="report.directDependencies" value="[EMAIL PROTECTED],"/>
</ac:then>
</ac:if>
<ac:var name="report.allDependencies"
value="[EMAIL PROTECTED],"/>
</xt:actions>
</xt:call>
</xt:xmltask>
<echo message="${report.directDependencies}"/>
<echo message="${report.allDependencies}"/>
---
Shawn Castrianni
-----Original Message-----
From: Shawn Castrianni [mailto:[EMAIL PROTECTED]
Sent: Monday, February 25, 2008 1:38 AM
To: '[email protected]'
Subject: printing out dependencies
I am trying to write an ant task that just prints out the direct and indirect
dependencies of my current ivy module. For example, if I had A depends on B
depends on C, then if I run this ant task on A, I want the following printed to
the console:
directDependencies=B
indirectDependencies=C
How can I do this? The info task doesn't look at dependencies and all of the
reporting tasks write to output files with a lot of extra resolve stuff I don't
care about. I just want some ant properties to be set so that I can echo them
to the console. Is this possible?
---
Shawn Castrianni
----------------------------------------------------------------------
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.