ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: basedir not set corretly in subant task...
Date Thu, 15 Jul 2004 12:06:40 GMT
Steve Loughran wrote:
> I have a problem w/ ant and subant that does not involve basedir being 
> set ; in CVS for people who are curious, but I havent 
> checked this stuff fully in yet because it doesnt work.
> Directory core/  at the base of things
>    <target name="diag2" depends="init" >
>     <ant dir="${components.project}" target="diag2" inheritAll="false" />
>   </target>

And if I declare a macro around subant that lets me switch between that 
and ant:

     <macrodef name="forward2">
      <attribute name="dir" />
      <attribute name="target" />
      <attribute name="inheritAll" default="false" />
         target="@{target}" inheritAll="@{inheritAll}"
         <buildpathelement location="@{dir}"/>

    <target name="diag2" depends="init" >
     <forward2 dir="${components.project}" target="diag2"  />

Then everything works as expected. So something in <ant> freezes too 
much state for subant to make head or tail of.

I am switching to my macro as we speak. I also note that <presetdef> and 
<macrodef> definitions are fixed once declared, so you have to use new 
names if you do things with different meanings. This makes sense, but it 
did just catch me out. It does mean that "use unique macro/preset def 
names for project-private definitions" should go in the style guide.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message