next up previous contents index
Next: AntCall Up: Ant Previous: Basedir of the new   Contents   Index

Examples

  <ant antfile="subproject/subbuild.xml" dir="subproject" target="compile"/>

  <ant dir="subproject"/>

  <ant antfile="subproject/property_based_subbuild.xml">
    <property name="param1" value="version 1.x"/>
    <property file="config/subproject/default.properties"/>
  </ant>

  <ant inheritAll="false" antfile="subproject/subbuild.xml">
    <property name="output.type" value="html"/>
  </ant>
The build file of the calling project defines some <path> elements like this:
  <path id="path1">
    ...
  </path>
  <path id="path2">
    ...
  </path>
and the called build file (subbuild.xml) also defines a <path> with the id path1, but path2 is not defined:
  <ant antfile="subbuild.xml" inheritrefs="true"/>
will not override subbuild's definition of path1, but make the parent's definition of path2 available in the subbuild.
  <ant antfile="subbuild.xml"/>
as well as
  <ant antfile="subbuild.xml" inheritrefs="false"/>
will neither override path1 nor copy path2.
  <ant antfile="subbuild.xml" inheritrefs="false">
    <reference refid="path1"/>
  </ant>
will override subbuild's definition of path1.
  <ant antfile="subbuild.xml" inheritrefs="false">
    <reference refid="path1" torefid="path2"/>
  </ant>
will copy the parent's definition of path1 into the new project using the id path2



Andrew Marlow 2003-07-08