FooTask.java:
/*
* Created on 2004-4-17
*
*/
import org.apache.tools.ant.Task;
/**
* FooTask.java
*
Copyright: Copyright (c) 2003 你可以对本程序随意修改,复制,使用,但请保留这里注释声明!!!
* @author 李尚强 blundblade@sina.com
*/
public class FooTask extends Task {
private String name = "";
/**
* @return
*/
public String getName() {
return name;
}
/**
* @param string
*/
public void setName(String string) {
name = string;
}
public String toString() {
return name;
}
}
build.xml:
< SPAN> name="testTimer" default="test" basedir=".">
< SPAN> name= "timer" classname= "TimerTask" classpath= "." />
< SPAN> name= "foo" classname= "FooTask" classpath= "." />
< SPAN> name= "test" >
< SPAN> action= "init" >
< SPAN> name= "F1" />
< SPAN> name= "F2" />
< SPAN> name= "F3" />
< SPAN> name= "F4" />
< SPAN> action= "print" />
< SPAN> message= "You have use time :${timer.passed}" />