ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill.J.Fell...@mail.sprint.com
Subject RE: newbie - subproject question -- followup question
Date Mon, 07 May 2001 23:26:17 GMT
Ok, in addition to my first question, here's my next 
observation/question.  Given the following xml, if invoked like 
`build`
I get what I expect - the main of MasterBuild executes.  It depends on 
SubBuild1 which calls sub.xml  When it enters sub.xml, it looks at the 
project stuff, sees its default and goes to it.  It was my original 
assumption that it'd look for the same target that called it (i.e. 
target SubBuild1 invokes sub.xml telling it to start with SubBuild1)  
This was an erroneous assumption.  To make it do that, the ant call 
would have to have a target defined (see SubWorks)  
What I'd love to hear is that I can know what target I'm in.  Anybody 
want to tell me that?  ;)  I'd like to be able to say <ant 
antfile="z.xml" target="${ant.current.target}" />  

Any suggestions?

/bill


<project name="MasterBuild" default="main" basedir=".">
  <target name="main" depends="SubBuild1">
  </target>

  <target name="SubBuild1">
    <ant antfile="sub.xml" />
  </target>

  <target name="Sub">
    <ant antfile="sub.xml" />
  </target>

  <target name="SubWorks">
    <ant antfile="sub.xml" target="Sub"/>
  </target>

</project>

<project name="SubBuild1" default="main" basedir=".">
  <target name="main" depends="SubBuild1">
  </target>

  <target name="SubBuild1">
    <echo message="I am SubBuild1" />
  </target>

  <target name="Sub">
    <echo message="I am not SubBuild1" />
  </target>
</project>

Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message