You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Shawn Castrianni <Sh...@halliburton.com> on 2008/02/25 08:38:28 UTC

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.

RE: printing out dependencies

Posted by Shawn Castrianni <Sh...@halliburton.com>.
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="${report.directDependencies}@{reportModuleDependencyName},"/>
                                                </ac:then>
                                        </ac:if>
                                        <ac:var name="report.allDependencies" value="${report.allDependencies}@{reportModuleDependencyName},"/>
                                </xt:actions>
                        </xt:call>
                </xt:xmltask>
                <echo message="${report.directDependencies}"/>
                <echo message="${report.allDependencies}"/>

---
Shawn Castrianni

-----Original Message-----
From: Shawn Castrianni [mailto:Shawn.Castrianni@halliburton.com]
Sent: Monday, February 25, 2008 1:38 AM
To: 'ivy-user@ant.apache.org'
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.