Write a custom task and easily extend Ant (3) code

zhaozj2021-02-16  46

Footask.java:

/ *

* CREATED ON 2004-4-17

*

* /

Import org.apache.tools.ant.task;

/ **

* Footask.java

*

Copyright: Copyright (c) 2003 You can modify, copy, use this program, but please keep the annotation statement here! ! !

* @Author Li Shangqiang 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:

Name = "Testtimer" default = "beed" based "based" based ","

Name =

"Timer"

ClassName =

"TIMERTASK"

Classpath =

"."

/>

Name =

"foo"

ClassName =

FOOTASK

Classpath =

"."

/>

Name =

"TEST"

>

Action =

"init"

>

Name =

"F1"

/>

Name =

"F2"

/>

Name =

"F3"

/>

Name =

"F4"

/>

Action =

"print"

/>

Message =

"You Have Uses" $ {Timer.Passed} "

/>

转载请注明原文地址:https://www.9cbs.com/read-25266.html

New Post(0)