Ant > Ant Property Task
|
Ant Property Task
The <property> task is used to set the Ant properties. The property value is immutable, once the value is set you cannot change it. To set a property to a specific value you use Name/value assignment.
<property> task 是用来设置Ant属性的. 属性的值是不可变,当你第一次设定它的时候就不能再更改了。给属性设置一个特殊的值用Name/value赋值.
<property name="project.name" value="AntExample2" />
To set a property to a location you use Name/location assignment.
用Name/location赋值来设置一个属性.
<property name="web.dir" location="WebContent"/>
<property name="web.lib.dir" location="${web.dir}/WEB-INF/lib"/>
<property name="build.classes.dir" location="build/classes"/>
<property name="dist.dir" location="dist"/>
To use the properties surround them with ${}.
用属性是要用到${属性名称}
The following build file shows how to set and use property values.
下面是build文件怎样设置和用属性值.
<?xml version="1.0" ?>
<project name="AntExample2" default="war">
<property name="web.dir" location="WebContent"/>
<property name="web.lib.dir" location="${web.dir}/WEB-INF/lib"/>
<property name="build.classes.dir" location="build/classes"/>
<property name="dist.dir" location="dist"/>
<property name="project.name" value="AntExample2" />
<path id="compile.classpath">
<fileset dir="${web.lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<target name="init">
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${dist.dir}" />
</target>
<target name="compile" depends="init" >
<javac destdir="${build.classes.dir}" debug="true" srcdir="src">
<classpath refid="compile.classpath"/>
</javac>
</target>
<target name="war" depends="compile">
<war destfile="${dist.dir}/${project.name}.war"webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}"/>
<lib dir="${web.lib.dir}"/>
<classes dir="${build.classes.dir}"/>
</war>
</target>
<target name="clean">
<delete dir="${dist.dir}" />
<delete dir="${build.classes.dir}" />
</target>
</project>
You can download the build file here.
|
分享到:
相关推荐
Imagine that you are working ...and hassle you are experiencing, OK, enough of the rhetoric, this tool exists, it is called ANT. For a nice definition of what Ant is, see http://jakarta.apache.org/ant/.
a simple ant tutorial. enjoy...
Tutorial
ANSYS Fluent Tutorial Guide 19.2 教程 官方案例 tutorial 典例 2积分
OpenGL ES Tutorial for Android – Part I – Setting up the view OpenGL ES Tutorial for Android – Part II – Building a polygon OpenGL ES Tutorial for Android – Part III – Transformations OpenGL ES ...
FLUENT 2020R2 tutorial guide PDF及案例源文件 1.What’s In This Manual The ANSYS Fluent Tutorial Guide contains a number of tutorials that teach you how to use ANSYS Flu- ent to solve different types ...
spring tutorial 教程
operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_tutorial.pdf operating_system_...
Sun权威教程--《J2EE Tutorial中文版》 作者:Stephanie Bodoff,Dale Green,Kim Haase,Eric Jendrock,Monica Pawlan,Beth Stearns 翻译参与人员:sharetop,worldheart,zhaoy,bruce等 出版商:铁道出版社...
TUTORIAL
tutorial代码
gtk+ 2.0 tutorial.pdf gtk+ 2.0 tutorial.pdf gtk+ 2.0 tutorial.pdf
java tutorialjava tutorial.chm
opencv tutorial code
J2EE tutorial 中文版
Computational Fourier Optics a MATLAB tutorial
Tutorial3D-master