ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
Subject Re: retrieving project names with subant
Date Thu, 14 Jul 2005 15:34:23 GMT
Hello,

--- hind.lwahhabi@accenture.com 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: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message