ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
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 smartfrog.org 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" />
      <sequential>
       <subant
         antfile="build.xml"
         target="@{target}" inheritAll="@{inheritAll}"
         inheritrefs="false">
         <buildpathelement location="@{dir}"/>
       </subant>
      </sequential>
     </macrodef>
   </target>

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

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.

-steve

-steve

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message