Goog point:) i didn't think of this solution whereas i am passing properties to 
my subant indeed!


-----Original Message-----
From: RADEMAKERS Tanguy [mailto:[EMAIL PROTECTED]
Sent: Thu 7/14/2005 6:28 PM
To: Ant Users List
Subject: RE: retrieving project names with subant
 
according to the manual, you can pass a nested <property> to the subant
task. You could use this to propagate your own build name property down
the tree.

<project name="main" default="main" basedir=".">
    <target name="main">
        <echo>Main project name is ${ant.project.name}</echo>
        <subant antfile="sub.xml" target="sub" buildpath="${basedir}">
                 <property name="my.project.name"
value="${ant.project.name}"/>
        </subant>
    </target>
</project>

<project name="sub" default="sub">
    <target name="sub">
        <echo>Sub project name is ${ant.project.name}</echo>
        <echo>Sub project (my) name is ${my.project.name}</echo>
    </target>
</project>

/t

>-----Original Message-----
>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
>Sent: Thursday, July 14, 2005 5:58 PM
>To: [email protected]
>Subject: RE: retrieving project names with subant
>
>thanks ivan.
>I was aware of the ${ant.project.name}property, but indeed i 
>want the names of all sub projects in my main ant files that 
>iterates through these projects.
>
>
>-----Original Message-----
>From: Ivan Ivanov [mailto:[EMAIL PROTECTED]
>Sent: Thu 7/14/2005 5:34 PM
>To: Ant Users List
>Subject: Re: retrieving project names with subant
> 
>Hello,
>
>--- [EMAIL PROTECTED] wrote:
>> 
>> hello gentle people;
>> is there a way to retrieve the names of the project
>> being run when using subant?
>
>The name of the currenr project is stored in the
>built-in property ant.project.name. So you can use
>something like this:
><project name="main" default="main" basedir=".">
>    <target name="main">
>        <echo>Main project name is
>${ant.project.name}</echo>
>        <subant antfile="sub.xml" target="sub"
>buildpath="${basedir}"/>
>    </target>
></project>
>
><project name="sub" default="sub">
>    <target name="sub">
>        <echo>Sub project name is
>${ant.project.name}</echo>
>    </target>
></project>
>
>But if you want in your main file the names of all sub
>projects, it would be harder.
>
>Regards
>Ivan
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam?  Yahoo! Mail has the best spam protection around 
>http://mail.yahoo.com 
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
>This message is for the designated recipient only and may 
>contain privileged, proprietary, or otherwise private 
>information.  If you have received it in error, please notify 
>the sender immediately and delete the original.  Any other use 
>of the email by you is prohibited.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




This message is for the designated recipient only and may contain privileged, 
proprietary, or otherwise private information.  If you have received it in 
error, please notify the sender immediately and delete the original.  Any other 
use of the email by you is prohibited.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to