Parameters
| Attribute | Description | Required |
| antfile | the buildfile to use. Defaults to "build.xml". This file is expected to be a filename relative to the dir attribute given. | No |
| dir | the directory to use as a basedir for the new Ant project. Defaults to the current project's basedir, unless inheritall has been set to false, in which case it doesn't have a default value. This will override the basedir setting of the called project. | No |
| target | the target of the new Ant project that should be executed. Defaults to the new project's default target. | No |
| output | Filename to write the ant output to. This is relative to the value of the dir attribute if it has been set or to the base directory of the current project otherwise. | No |
| inheritAll | If true, pass all properties to the
new Ant project. Defaults to true. |
No |
| inheritRefs | If true, pass all references to the
new Ant project. Defaults to false. |
No |
Parameters specified as nested elements
property
See the description of the property
task.
These properties become equivalent to properties you define on
the command line. These are special properties and they will always get passed
down, even through additional <*ant*> tasks with inheritall set to
false (see above).
Note that the refid attribute points to a
reference in the calling project, not in the new one.
reference
Used to choose references that shall be copied into the new project, optionally changing their id.
| Attribute | Description | Required |
| refid | The id of the reference in the calling project. | Yes |
| torefid | The id of the reference in the new project. | No, defaults to the value of refid. |
propertyset
You can specify a set of properties to be copied into the new project with propertysets.
since Ant 1.6.
target
You can specify multiple targets using nested <target> elements
instead of using the target attribute. These will be executed as if
Ant had been invoked with a single target whose dependencies are the
targets so specified, in the order specified.
| Attribute | Description | Required |
| name | The name of the called target. | Yes |
since Ant 1.6.3.
Basedir of the new project
The basedir value of the new project is affected by the two attributes dir and inheritall, see the following table for details:
| dir attribute | inheritAll attribute | new project's basedir |
| value provided | true | value of dir attribute |
| value provided | false | value of dir attribute |
| omitted | true | basedir of calling project (the one whose build
file contains the <ant> task). |
| omitted | false | basedir attribute of the <project> element
of the new project |
Examples
<ant antfile="subproject/subbuild.xml" 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>
These lines invoke the same build file:
<ant antfile="sub1/sub2/build.xml" />
<ant antfile="sub2/build.xml" dir="sub1" />
<ant antfile="build.xml" dir="sub1/sub2" />
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.
'IT 관련 > Java' 카테고리의 다른 글
| [ant] build.xml 에서 다른 build.xml 을 실행할려면.. (0) | 2008/09/08 |
|---|---|
| WEBLOGIC SERVER와 SPRING 통합 (0) | 2008/06/17 |
| J2EE Development without EJB (0) | 2008/06/17 |
| Subversion 에서 자동으로 Property 세팅 되게 하기 (0) | 2008/05/26 |
| (Vista + AMD 64bit + 4G Mem) + MySQL + ( JDK + Eclipse + WTP) (0) | 2008/05/11 |
| iBatis 꽤 맘에 드는 기능 sql 조합.. (0) | 2008/03/17 |


이올린에 북마크하기
이올린에 추천하기