锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美久久久久免费,中文一区二区,一区二区三区视频在线看http://www.aygfsteel.com/chinarefers/category/8301.html鎴戠殑鍗氬鏃ュ織錛侊紒錛?/description>zh-cnFri, 02 Mar 2007 09:37:50 GMTFri, 02 Mar 2007 09:37:50 GMT60杞?浜や簰寮忕殑ant 璋冪敤涓庤嚜鍐欑殑Ant Taskhttp://www.aygfsteel.com/chinarefers/articles/34559.html鍚瑙傚獎鍚瑙傚獎Thu, 09 Mar 2006 14:33:00 GMThttp://www.aygfsteel.com/chinarefers/articles/34559.htmlhttp://www.aygfsteel.com/chinarefers/comments/34559.htmlhttp://www.aygfsteel.com/chinarefers/articles/34559.html#Feedback0http://www.aygfsteel.com/chinarefers/comments/commentRss/34559.htmlhttp://www.aygfsteel.com/chinarefers/services/trackbacks/34559.html涓銆併夾nt--The Definitive Guide 2nd銆嬫槸鏈笉閿欑殑cookbook

浜屻佷笌鐢ㄦ埛榪涜浜や簰寮忚緭鍏ヨ屼笉鏄肩潃鐢ㄦ埛鏀筨uild.xml

涓嬮潰鐨勪唬鐮佽繍琛屾椂錛宎nt浼氭彁闂?What is the name of your POJO?"錛岃鐢ㄦ埛杈撳叆灞炴ojoName鐨勫箋?BR>
<input message="What is the name of your POJO (i.e. Person)?" addproperty="PojoName"/>
涓夛紝鍐橝nt Task

鍐橝nt Task鍏跺疄寰堢畝鍗曪紝鐪嬬湅涓嬮潰榪欑瘒Turtorial灝卞彲浠ヤ簡銆?BR>
http://ant.apache.org/manual/tutorial-writing-tasks.html

涓婃枃鍙祿緙╁埌涓夊彞璇濋噷錛?BR>1.鍐欎竴涓狫ava綾伙紝緇ф壙浜巓rg.apache.tools.ant.Task銆?BR>2.瀹炵幇execute()鏂規硶錛孉nt灝變細榪涜璋冪敤銆?BR>3.鍙傛暟瑕佷粠build.xml浼犲叆鏃訛紝Task綾誨彧闇鎷ユ湁鍚屽悕鐨勫彉閲忓拰setter鍑芥暟錛孉nt灝變細涓轟綘娉ㄥ叆銆?BR>
1.Ant Task鐨勬爣鍑嗗疄鐜?BR>
import org.apache.tools.ant.Task;public class HelloWorld extends Task{String msg;public void execute(){  System.out.println(msg);}public void setMsg(String msg){    this.msg = msg;}}
灝嗕笂闈㈢殑鏂囦歡緙栬瘧鎵撳寘鎴恏elloworld.jar

build.xml璋冪敤濡備笅

<target description="Use the Task">  
<taskdef name="helloworld" classname="HelloWorld" classpath="helloworld.jar"/>  
<helloworld msg="Hello World"/>
</target>

鍙﹀錛?
1.鍙栧緱build.xml涓殑鍏叡鍙橀噺鍜孴arget鍚嶇О

String myProperty = getProject().getProperty("myProperty ");
String targetName = getOwningTarget().getName();                     
           
2.鍙栧緱澶嶅悎鐨勫睘鎬у氨瑕佸鏉備竴鐐癸紝璇ユā寮忓彲浠ユ墿灞曞埌姣斾笅闈㈠鏉傚緱澶氱殑鎯呭喌銆?BR><target>  
<helloworld>     
<message msg="Hello "/>     
<message msg="World"/>  
</helloworld>
</target>

1.鍏堝畾涔夊彨Message鐨勫唴閮ㄧ被浠ヨ〃紺篗essage鑺傜偣錛岃綾繪湁涓涓猰sg灞炴э紝鍚屾牱鏈変竴涓猻etter鍑芥暟錛屼嬌鍏跺彲浠ュ湪build.xml涓祴鍊?BR>
public class Message extends Object{   
public Message()  {}  
String msg;  
public void setMsg(String msg)  {   
this.msg = msg;  
}  
public String getMsg() {    return msg;  }
}

2.鍐嶆牴鎹瓵nt鐨勬鏋訛紝瀹氫箟緇橦elloworld娉ㄥ叆message鐨刢reateXXX鍑芥暟鍜屾寔鏈塎essage鍒楄〃鐨刴essages瀵硅薄錛宎nt灝變細涓轟綘瀹屾垚鑷姩娉ㄥ叆銆?BR>
Vector msgs = new Vector();
public Message createMessage(){   
Message msg = new Message();
messages.add(msg);  
return msg;
}


]]>
主站蜘蛛池模板: 崇左市| 旬阳县| 鄯善县| 五寨县| 禄劝| 娄底市| 那坡县| 思茅市| 高平市| 石台县| 绍兴县| 昆山市| 博爱县| 罗田县| 巨野县| 南京市| 大悟县| 图们市| 金乡县| 阿尔山市| 蛟河市| 拉萨市| 南通市| 克拉玛依市| 诸暨市| 泽库县| 齐河县| 固阳县| 双峰县| 潼关县| 喀喇沁旗| 临沧市| 维西| 常州市| 福安市| 江安县| 靖边县| 镇巴县| 城口县| 普格县| 德保县|