[Ant存档] Demonstration Tips of Ant
来源:互联网 发布:js实现轮播思路 编辑:程序博客网 时间:2024/05/01 15:05
<project name="AntTest" default="main" basedir=".">
<!-- 定义path数据类型(datatype),并引用 -->
<path id="compile.classpath">
<pathelement location="${lucene.jar}"/>
<pathelement location="${tidy.jar}"/>
</path>
<path id="test.classpath">
<path refid="compile.classpath"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${build.dir}/classes"/>
<pathelement location="${build.dir}/test"/>
</path>
<path id="the.path">
<pathelement location="lib/ant.jar"/>
</path>
<property name="path.string" refid="the.path"/>
<echo message="${path.string}"/>
<!-- 引用环境变量 -->
<property name="classpath" value="${basedir}/bin"/>
<property environment="env." />
<echo message="Number of processors = ${env.NUMBER_OF_PROCESSORS}" />
<echo message="ANT_HOME = ${env.ANT_HOME}"/>
<echo message="ITS_HOME = ${env.ITS_HOME}" />
<echo message="Built-in Properties:"/>
<echo message="${ant.file}"/>
<echo message="${ant.java.version}"/>
<echo message="${ant.version}"/>
<property name="build.dir" location="build"/>
<echo message="${build.dir}" />
<echo message="${basedir}" />
<!-- demonstrate the immutability of ant's property -->
<property file="build.properties"/> <!-- ought to have an property named build.debug set to off in build.properties file-->
<property name="build.debug" value="on"/>
<echo message="build.debug = ${build.debug}"/>
<target name="init">
<property name="strip.comment" value="true"/>
<!-- demonstration of current time -->
<tstamp>
<format property="TODAY" pattern="yyyy-MM-dd hh:mm aa" />
</tstamp>
<!-- define self-made tasks -->
<taskdef name="simpletask" classname="org.xxx.anttest.SimpleTask" classpath="${classpath}" />
<taskdef name="proctask" classname="org.xxx.anttest.FileProcTask" classpath="${classpath}"/>
</target>
<!-- execute main program with external args -->
<target name="execute">
<echo level="warning" message="Executing Main Programme..."/>
<java classname="org.xxx.anttest.Test" classpath="bin">
<arg value="first arg"/>
<arg value="second arg"/>
<arg value="third arg"/>
</java>
</target>
<target name="simpletask" depends="init" >
<simpletask path="${env.ANT_HOME}:build/output" />
</target>
<target name="proctask" depends="init">
<echo message="Current Time is: ${TODAY}"></echo>
<proctask dir="${basedir}">
<include name="**/*.java"/>
</proctask>
</target>
<!--
1. strip comments in the file of config.properties when copying
2. demonstrate the useage of if attribute
-->
<target name="stripcomment" if="strip.comment" depends="init">
<copy file="config.properties" todir="config">
<filterchain>
<striplinecomments>
<comment value="#"/>
</striplinecomments>
</filterchain>
</copy>
</target>
<target name="main" depends="stripcomment" />
</project>
- [Ant存档] Demonstration Tips of Ant
- ant学习(存档)
- ant articles and tips
- Ant资料and tips
- [Ant存档] My First Hand-writing Ant script
- ant
- ant
- Ant
- ant
- ANT
- ANT
- ant
- ant
- ant
- ant
- ant
- ANT
- ant
- 订票
- asp.net2005里给控件重命名,提示“目录名无效”怎么解决
- C#中的面向对象概念
- ShaderSimpler(4) : 环境映射
- 家常菜
- [Ant存档] Demonstration Tips of Ant
- ASP.NET 中执行 URL 重写
- 父子Repeater
- January 11 2007 木曜日
- January 12 2007 金曜日
- 使用ASP.NET 2.0 Profile存储用户信息[翻译] Level 200
- 部署安装时写入SQL SERVER和Web.config
- January 15 2007 月曜日
- January 16 2007 火曜日