ºìÁªLinuxÃÅ»§
Linux°ïÖú

AntµÄѧϰ

·¢²¼Ê±¼ä:2008-09-26 20:59:05À´Ô´:ºìÁª×÷Õß:radio
AntµÄ¸ÅÄî
¿ÉÄÜÓÐЩ¶ÁÕß²¢²»Á¬½ÓʲôÊÇAntÒÔ¼°Èë¿ÉʹÓÃËü£¬µ«Ö»ÒªÊ¹ÓÃͨ¹ýLinuxϵͳµÃ¶ÁÕߣ¬Ó¦¸ÃÖªµÀmakeÕâ¸öÃüÁî¡£µ±±àÒëLinuxÄں˼°Ò»Ð©Èí¼þµÄÔ´³ÌÐòʱ£¬¾­³£ÒªÓÃÕâ¸öÃüÁî¡£MakeÃüÁîÆäʵ¾ÍÊÇÒ»¸öÏîÄ¿¹ÜÀí¹¤¾ß£¬¶øAntËùʵÏÖ¹¦ÄÜÓë´ËÀàËÆ¡£Ïñmake£¬gnumakeºÍnmakeÕâЩ±àÒ빤¾ß¶¼ÓÐÒ»¶¨µÄȱÏÝ£¬µ«ÊÇAntÈ´¿Ë·þÁËÕâЩ¹¤¾ßµÄȱÏÝ¡£×î³õAnt¿ª·¢ÕßÔÚ¿ª·¢¿çƽ̨µÄÓ¦ÓÃʱ£¬ÓÃÑùÒ²ÊÇ»ùÓÚÕâЩȱÏݶÔAnt×öÁ˸üºÃµÄÉè¼Æ¡£
Ant Óë makefile
MakefileÓÐһЩ²»×ãÖ®´¦£¬±ÈÈçºÜ¶àÈ˶¼»áÅöµ½µÄ·³È˵ÄTabÎÊÌâ¡£×î³õµÄAnt¿ª·¢Õ߶à´ÎÇ¿µ÷¡±Ö»ÊÇÎÒÔÚTabÇ°Ãæ¼ÓÁËÒ»¸ö¿Õ¸ñ£¬ËùÒÔÎÒµÄÃüÁî¾Í²»ÄÜÖ´ÐС±¡£ÓÐһЩ¹¤¾ßÔÚÒ»¶¨³Ì¶ÈÉϽâ¾öÁËÕâ¸öÎÊÌ⣬µ«»¹ÊÇÓкܶàÆäËûµÄÎÊÌâ¡£AntÔòÓëÒ»°ã»ùÓÚÃüÁîµÄ¹¤¾ßÓÐËù²»Í¬£¬ËüÊÇJavaÀàµÄÀ©Õ¹¡£AntÔËÐÐÐèÒªµÄXML¸ñʽµÄÎļþ²»ÊÇShellÃüÁîÎļþ¡£ËüÊÇÓÉÒ»¸öProject×é³ÉµÄ£¬¶øÒ»¸öProjectÓֿɷֳɿɶàtarget£¬targetÔÙϸ·ÖÓֳַɺܶàtask£¬Ã¿Ò»¸ötask¶¼ÊÇͨ¹ýÒ»¸öʵÏÖÌض¨½Ó¿ÚµÄjavaÀàÀ´Íê³ÉµÄ¡£

AntµÄÓŵã

AntÊÇApacheÈí¼þ»ù½ð»áJAKARTAĿ¼ÖеÄÒ»¸ö×ÓÏîÄ¿£¬ËüÓÐÒÔϵÄÓŵ㡣
¿çƽ̨ÐÔ¡£AntÊÇ´æJavaÓïÑÔ±àдµÄ£¬Ëùʾ¾ßÓкܺõĿçƽ̨ÐÔ¡£
²Ù×÷¼òµ¥¡£AntÊÇÓÉÒ»¸öÄÚÖÃÈÎÎñºÍ¿ÉÑ¡ÈÎÎñ×é³ÉµÄ¡£AntÔËÐÐʱÐèÒªÒ»¸öXMLÎļþ(¹¹½¨Îļþ)¡£Antͨ¹ýµ÷ÓÃtargetÊ÷£¬¾Í¿ÉÒÔÖ´Ðи÷ÖÖ task¡£Ã¿¸ötaskʵÏÖÁËÌض¨½Ó¿Ú¶ÔÏó¡£ÓÉÓÚAnt¹¹½¨ÎļþʱXML¸ñʽµÄÎļþ£¬ËùÒÔºÍÈÝÒ×ά»¤ºÍÊéд£¬¶øÇҽṹºÜÇåÎú¡£
Ant¿ÉÒÔ¼¯³Éµ½¿ª·¢»·¾³ÖС£ÓÉÓÚAntµÄ¿çƽ̨ÐԺͲÙ×÷¼òµ¥µÄÌص㣬ËüºÜÈÝÒ×¼¯³Éµ½Ò»Ð©¿ª·¢»·¾³ÖÐÈ¥¡£

Ant ¿ª·¢

AntµÄ¹¹½¨Îļþ
µ±¿ªÊ¼Ò»¸öеÄÏîĿʱ£¬Ê×ÏÈÓ¦¸Ã±àдAnt¹¹½¨Îļþ¡£¹¹½¨Îļþ¶¨ÒåÁ˹¹½¨¹ý³Ì£¬²¢±»ÍŶӿª·¢ÖÐÿ¸öÈËʹÓá£Ant¹¹½¨ÎļþĬÈÏÃüÃûΪbuild.xml£¬Ò²¿ÉÒÔÈ¡ÆäËûµÄÃû×Ö¡£Ö»²»¹ýÔÚÔËÐеÄʱºò°ÑÕâ¸öÃüÃûµ±×÷²ÎÊý´«¸øAnt¡£¹¹½¨Îļþ¿ÉÒÔ·ÅÔÚÈκεÄλÖá£Ò»°ã×ö·¨ÊÇ·ÅÔÚÏîÄ¿¶¥²ãĿ¼ÖУ¬ÕâÑù¿ÉÒÔ±£³ÖÏîÄ¿µÄ¼ò½àºÍÇåÎú¡£ÏÂÃæÊÇÒ»¸öµäÐ͵ÄÏîÄ¿²ã´Î½á¹¹¡£
(1) src´æ·ÅÎļþ¡£
(2) class´æ·Å±àÒëºóµÄÎļþ¡£
(3) lib´æ·ÅµÚÈý·½JAR°ü¡£
(4) dist´æ·Å´ò°ü£¬·¢²¼ÒÔºóµÄ´úÂë¡£
Ant¹¹½¨ÎļþÊÇXMLÎļþ¡£Ã¿¸ö¹¹½¨Îļþ¶¨ÒåÒ»¸öΨһµÄÏîÄ¿(ProjectÔªËØ)¡£Ã¿¸öÏîÄ¿Ï¿ÉÒÔ¶¨ÒåºÜ¶àÄ¿±ê(targetÔªËØ)£¬ÕâЩĿ±êÖ®¼ä¿ÉÒÔÓÐÒÀÀµ¹Øϵ¡£µ±Ö´ÐÐÕâÀàÄ¿±êʱ£¬ÐèÒªÖ´ÐÐËûÃÇËùÒÀÀµµÄÄ¿±ê¡£Ã¿¸öÄ¿±êÖпÉÒÔ¶¨Òå¶à¸öÈÎÎñ£¬Ä¿±êÖл¹¶¨ÒåÁËËùÒªÖ´ÐеÄÈÎÎñÐòÁС£AntÔÚ¹¹½¨Ä¿±êʱ±ØÐëµ÷ÓÃËù¶¨ÒåµÄÈÎÎñ¡£ÈÎÎñ¶¨ÒåÁËAntʵ¼ÊÖ´ÐеÄÃüÁî¡£AntÖеÄÈÎÎñ¿ÉÒÔΪ3Àà¡£
£¨1£© ºËÐÄÈÎÎñ¡£ºËÐÄÈÎÎñÊÇAnt×Ô´øµÄÈÎÎñ¡£
£¨2£© ¿ÉÑ¡ÈÎÎñ¡£¿ÉÑ¡ÈÎÎñʵÀ´×ÔµÚÈý·½µÄÈÎÎñ£¬Òò´ËÐèÒªÒ»¸ö¸½¼ÓµÄJARÎļþ¡£
£¨3£© Óû§×Ô¶¨ÒåµÄÈÎÎñ¡£Óû§×Ô¶¨ÒåµÄÈÎÎñʵÓû§×Ô¼º¿ª·¢µÄÈÎÎñ¡£
1.±êÇ©
ÿ¸ö¹¹½¨Îļþ¶ÔÓ¦Ò»¸öÏîÄ¿¡£±êǩʱ¹¹½¨ÎļþµÄ¸ù±êÇ©¡£Ëü¿ÉÒÔÓжà¸öÄÚÔÚÊôÐÔ£¬

¾ÍÈç´úÂëÖÐËùʾ£¬Æä¸÷¸öÊôÐԵĺ¬Òå·Ö±ðÈçÏ¡£
(1) default±íʾĬÈϵÄÔËÐÐÄ¿±ê£¬Õâ¸öÊôÐÔÊDZØÐëµÄ¡£
(2) basedir±íʾÏîÄ¿µÄ»ù׼Ŀ¼¡£
(3) name±íʾÏîÄ¿Ãû¡£
(4) description±íʾÏîÄ¿µÄÃèÊö¡£
ÿ¸ö¹¹½¨Îļþ¶¼¶ÔÓ¦ÓÚÒ»¸öÏîÄ¿£¬µ«ÊÇ´óÐÍÏîÄ¿¾­³£°üº¬´óÁ¿µÄ×ÓÏîÄ¿£¬Ã¿Ò»¸ö×ÓÏîÄ¿¶¼¿ÉÒÔÓÐ×Ô¼ºµÄ¹¹½¨Îļþ¡£

2.±êÇ©
Ò»¸öÏîÄ¿±êÇ©Ï¿ÉÒÔÓÐÒ»¸ö»ò¶à¸ötarget±êÇ©¡£Ò»¸ötarget±êÇ©¿ÉÒÔÒÀÀµÆäËûµÄtarget±êÇ©¡£ÀýÈ磬ÓÐÒ»¸ötargetÓÃÓÚ±àÒë³ÌÐò£¬ÁíÒ»¸ö targetÓÃÓÚÉù³Æ¿ÉÖ´ÐÐÎļþ¡£ÔÚÉú³É¿ÉÖ´ÐÐÎļþ֮ǰ±ØÐëÏȱàÒë¸ÃÎļþ£¬Òò²ß¿ÉÖ´ÐÐÎļþµÄtargetÒÀÀµÓÚ±àÒë³ÌÐòµÄtarget¡£TargetµÄËùÓÐÊôÐÔÈçÏ¡£
(1).name±íʾ±êÃ÷£¬Õâ¸öÊôÐÔÊDZØÐëµÄ¡£
(2).depends±íʾÒÀÀµµÄÄ¿±ê¡£
(3)if±íʾ½öµ±ÊôÐÔÉèÖÃʱ²ÅÖ´ÐС£
(4)unless±íʾµ±ÊôÐÔûÓÐÉèÖÃʱ²ÅÖ´ÐС£
(5)description±íʾÏîÄ¿µÄÃèÊö¡£
AntµÄdependsÊôÐÔÖ¸¶¨ÁËtargetµÄÖ´ÐÐ˳Ðò¡£Ant»áÒÀÕÕdependsÊôÐÔÖÐtarget³öÏÖ˳ÐòÒÀ´ÎÖ´ÐÐÿ¸ötarget¡£ÔÚÖ´ÐÐ֮ǰ£¬Ê×ÏÈÐèÒªÖ´ÐÐËüËùÒÀÀµµÄtarget¡£³ÌÐòÖеÄÃûΪrunµÄtargetµÄ

dependsÊôÐÔcompile£¬¶øÃûΪcompileµÄtargetµÄdependsÊôÐÔÊÇprepare£¬ËùÒÔÕ⼸¸ötargetÖ´

ÐеÄ˳ÐòÊÇprepare->compile->run¡£
Ò»¸ötargetÖ»Äܱ»Ö´ÐÐÒ»´Î£¬¼´Ê¹Óжà¸ötargetÒÀÀµÓÚËü¡£Èç¹ûûÓÐif»òunlessÊôÐÔ£¬target×Ü

»á±»Ö´ÐС£

3.±êÇ©
¸Ã±êÇ©ÓÃÓÚ´´½¨Ò»¸öĿ¼£¬ËüÓÐÒ»¸öÊôÐÔdirÓÃÀ´Ö¸¶¨Ëù´´½¨µÄĿ¼Ãû£¬Æä´úÂëÈçÏ£º

ͨ¹ýÒÔÉÏ´úÂë¾Í´´½¨ÁËÒ»¸öĿ¼£¬Õâ¸öĿ¼ÒѾ­±»Ç°ÃæµÄproperty±êÇ©ËùÖ¸¶¨¡£

4±êÇ©
¸Ã±êÇ©ÓÃÀ´Éú³ÉÒ»¸öJARÎļþ£¬ÆäÊôÐÔÈçÏ¡£
(1) destfile±íʾJARÎļþÃû¡£
(2) basedir±íʾ±»¹éµµµÄÎļþÃû¡£
(3) includes±íʾ±ð¹éµµµÄÎļþģʽ¡£
(4) exchudes±íʾ±»ÅųýµÄÎļþģʽ¡£

5£®
¸Ã±êÇ©ÓÃÓÚ±àÒëÒ»¸ö»òÒ»×éjavaÎļþ£¬ÆäÊôÐÔÈçÏ¡£
(1).srcdir±íʾԴ³ÌÐòµÄĿ¼¡£
(2).destdir±íʾclassÎļþµÄÊä³öĿ¼¡£
(3).include±íʾ±»±àÒëµÄÎļþµÄģʽ¡£
(4).excludes±íʾ±»ÅųýµÄÎļþµÄģʽ¡£
(5).classpath±íʾËùʹÓõÄÀà·¾¶¡£
(6).debug±íʾ°üº¬µÄµ÷ÊÔÐÅÏ¢¡£
(7).optimize±íʾÊÇ·ñʹÓÃÓÅ»¯¡£
(8).verbose ±íʾÌṩÏêϸµÄÊä³öÐÅÏ¢¡£
(9).fileonerror±íʾµ±Åöµ½´íÎó¾Í×Ô¶¯Í£Ö¹¡£

6£®±êÇ©
¸Ã±êÇ©ÓÃÀ´Ö´ÐбàÒëÉú³ÉµÄ.classÎļþ£¬ÆäÊôÐÔÈçÏ¡£
(1).classname ±íʾ½«Ö´ÐеÄÀàÃû¡£
(2).jar±íʾ°üº¬¸ÃÀàµÄJARÎļþÃû¡£
(3).classpathËù±íʾÓõ½µÄÀà·¾¶¡£
(4).fork±íʾÔÚÒ»¸öеÄÐéÄâ»úÖÐÔËÐиÃÀà¡£
(5).failonerror±íʾµ±³öÏÖ´íÎóʱ×Ô¶¯Í£Ö¹¡£
(6).output ±íʾÊä³öÎļþ¡£
(7).append±íʾ׷¼Ó»òÕ߸²¸ÇĬÈÏÎļþ¡£

7.±êÇ©
¸Ã±êÇ©ÓÃÓÚɾ³ýÒ»¸öÎļþ»òÒ»×éÎļþ£¬È¥ÊôÐÔÈçÏ¡£
(1)/file±íʾҪɾ³ýµÄÎļþ¡£
(2).dir±íʾҪɾ³ýµÄĿ¼¡£
(3).includeEmptyDirs ±íʾָ¶¨ÊÇ·ñҪɾ³ý¿ÕĿ¼£¬Ä¬ÈÏÖµÊÇɾ³ý¡£
(4).failonerror ±íʾָ¶¨µ±Åöµ½´íÎóÊÇ·ñÍ£Ö¹£¬Ä¬ÈÏÖµÊÇ×Ô¶¯Í£Ö¹¡£
(5).verbose±íʾָ¶¨ÊÇ·ñÁгöËùɾ³ýµÄÎļþ£¬Ä¬ÈÏֵΪ²»Áгö¡£

8.±êÇ©
¸Ã±êÇ©ÓÃÓÚÎļþ»òÎļþ¼¯µÄ¿½±´£¬ÆäÊôÐÔÈçÏ¡£
(1).file ±íʾԴÎļþ¡£
(2).tofile ±íʾĿ±êÎļþ¡£
(3).todir ±íʾĿ±êĿ¼¡£
(4).overwrite ±íʾָ¶¨ÊÇ·ñ¸²¸ÇÄ¿±êÎļþ£¬Ä¬ÈÏÖµÊDz»¸²¸Ç¡£
(5).includeEmptyDirs ±íʾÖƶ¨ÊÇ·ñ¿½±´¿ÕĿ¼£¬Ä¬ÈÏֵΪ¿½±´¡£
(6).failonerror ±íʾָ¶¨ÈçÄ¿±êûÓз¢ÏÖÊÇ·ñ×Ô¶¯Í£Ö¹£¬Ä¬ÈÏÖµÊÇÍ£Ö¹¡£
(7).verbose ±íʾÖƶ¨ÊÇ·ñÏÔʾÏêϸÐÅÏ¢£¬Ä¬ÈÏÖµ²»ÏÔʾ¡£

AntµÄÊý¾ÝÀàÐÍ
ÔÚ¹¹½¨ÎļþÖÐΪÁ˱êʶÎļþ»òÎļþ×飬¾­³£ÐèҪʹÓÃÊý¾ÝÀàÐÍ¡£Êý¾ÝÀàÐÍ°üº¬ÔÚ

org.apache.tool.ant.types°üÖС£ÏÂÃæ¾µ¼òµ¥½éÉܹ¹½¨ÎļþÖÐһЩ³£ÓõÄÊý¾ÝÀàÐÍ¡£

1. argument ÀàÐÍ
ÓÉAnt¹¹½¨Îļþµ÷ÓõijÌÐò£¬¿ÉÒÔͨ¹ýÔªËØÏòÆä´«µÝÃüÁîÐвÎÊý£¬Èçapply,execºÍjavaÈÎÎñ¾ù¿É½ÓÊÜǶÌ×ÔªËØ£¬¿ÉÒÔΪ¸÷×ԵĹý³Ìµ÷ÓÃÖ¸¶¨²ÎÊý¡£ÒÔÏÂÊǵÄËùÓÐÊôÐÔ¡£
(1).values ÊÇÒ»¸öÃüÁî²ÎÊý¡£Èç¹û²ÎÊýÖÖÓпոñ£¬µ«ÓÖÏ뽫Ëü×÷Ϊµ¥¶ÀÒ»¸öÖµ£¬ÔòʹÓôËÊôÐÔ¡£
(2).file±íʾһ¸ö²ÎÊýµÄÎļþÃû¡£ÔÚ¹¹½¨ÎļþÖУ¬´ËÎļþÃûÏà¶ÔÓÚµ±Ç°µÄ¹¤×÷Ŀ¼¡£
(3).line±íʾÓÿոñ·Ö¸ôµÄ¶à¸ö²ÎÊýÁÐ±í¡£
(4).path±íʾ·¾¶¡£

2.ervironment ÀàÐÍ
ÓÉAnt¹¹½¨Îļþµ÷ÓõÄÍⲿÃüÁî»ò³ÌÐò£¬ÔªËØÖƶ¨ÁËÄÄЩ»·¾³±äÁ¿Òª´«µÝ¸øÕýÔÚÖ´ÐеÄϵͳÃüÁԪËØ¿ÉÒÔ½ÓÊÜÒÔÏÂÊôÐÔ¡£
(1).file±íʾ»·¾³±äÁ¿ÖµµÃÎļþÃû¡£´ËÎļþÃûÒª±»×ª»»Î»Ò»¸ö¾ø¶Ô·¾¶¡£
(2).path±íʾ»·¾³±äÁ¿µÄ·¾¶¡£Ant»á½«Ëüת»»ÎªÒ»¸ö±¾µØÔ¼¶¨¡£
(3).value ±íʾ»·¾³±äÁ¿µÄÒ»¸öÖ±½Ó±äÁ¿¡£
(4).key ±íʾ»·¾³±äÁ¿Ãû¡£
×¢Òâ file path »ò valueÖ»ÄÜÈ¡Ò»¸ö¡£

3.filelistÀàÐÍ
Filelist ÊÇÒ»¸öÖ§³ÖÃüÃûµÄÎļþÁбíµÄÊý¾ÝÀàÐÍ£¬°üº¬ÔÚÒ»¸öfilelistÀàÐÍÖеÄÎļþ²»Ò»¶¨ÊÇ

´æÔÚµÄÎļþ¡£ÒÔÏÂÊÇÆäËùÓеÄÊôÐÔ¡£
(1).dirÊÇÓÃÓÚ¼ÆËã¾ø¶ÔÎļþÃûµÄĿ¼¡£
(2).files ÊÇÓöººÅ·Ö¸ôµÄÎļþÃûÁÐ±í¡£
(3).refid ÊǶÔij´¦¶¨ÒåµÄÒ»¸öµÄÒýÓá£
×¢Òâ dir ºÍ files ¶¼ÊDZØÒªµÄ£¬³ý·ÇÖ¸¶¨ÁËrefid(ÕâÖÖÇé¿öÏ£¬dirºÍfiles¶¼²»ÔÊÐíʹÓÃ)¡£

4.filesetÀàÐÍ
Fileset Êý¾ÝÀàÐͶ¨ÒåÁËÒ»×éÎļþ£¬²¢Í¨³£±íʾΪԪËØ¡£²»¹ý£¬Ðí¶àantÈÎÎñ¹¹½¨³ÉÁËÒþʽµÄfileset,Õâ˵Ã÷ËûÃÇÖ§³ÖËùÓÐµÄ filesetÊôÐÔºÍǶÌ×ÔªËØ¡£ÒÔÏÂΪfileset µÄÊôÐÔÁÐ±í¡£ (1).dir±íʾfileset µÄ»ùĿ¼¡£
(2).casesensitiveµÄÖµÈç¹ûΪfalse£¬ÄÇôƥÅäÎļþÃûʱ£¬fileset²»ÊÇÇø·Ö´óСдµÄ£¬ÆäĬÈÏ

ֵΪtrue.
(3).defaultexcludes ÓÃÀ´È·¶¨ÊÇ·ñʹÓÃĬÈϵÄÅųýģʽ£¬Ä¬ÈÏΪtrue¡£
(4).excludes ÊÇÓöººÅ·Ö¸ôµÄÐèÒªÅɳöµÄÎļþģʽÁÐ±í¡£
(5).excludesfile ±íʾÿÐаüº¬Ò»¸öÅųýģʽµÄÎļþµÄÎļþÃû¡£
(6).includes ÊÇÓöººÅ·Ö¸ôµÄ£¬ÐèÒª°üº¬µÄÎļþģʽÁÐ±í¡£
(7).includesfile ±íʾÿÐаüÀ¨Ò»¸ö°üº¬Ä£Ê½µÄÎļþÃû¡£

5.patternset ÀàÐÍ
Fileset ÊǶÔÎļþµÄ·Ö×飬¶øpatternsetÊǶÔģʽµÄ·Ö×飬ËûÃÇÊǽôÃÜÏà¹ØµÄ¸ÅÄî¡£Ö§³Ö4¸öÊôÐÔ£ºincludes excludex includexfile ºÍ excludesfile,ÓëfilesetÏàͬ¡£Patternset »¹ÔÊÐíÒÔÏÂǶÌ×ÔªËØ£ºinclude,exclude,includefile ºÍ excludesfile.

6.filterset ÀàÐÍ
Filterset¶¨ÒåÁËÒ»×é¹ýÂËÆ÷£¬ÕâЩ¹ýÂËÆ÷½«ÔÚÎļþÒƶ¯»ò¸´ÖÆʱÍê³ÉÎļþµÄÎı¾Ìæ»»¡£
Ö÷ÒªÊôÐÔÈçÏ£º
(1).begintoken ±íʾǶÌ×¹ýÂËÆ÷ËùËÑË÷µÄ¼ÇºÅ£¬ÕâÊDZêʶÆ俪ʼµÄ×Ö·û´®¡£
(2).endtoken±íʾǶÌ×¹ýÂËÆ÷ËùËÑË÷µÄ¼ÇºÅÕâÊDZêʶÆä½áÊøµÄ×Ö·û´®¡£
(3).idÊǹýÂËÆ÷µÄΨһ±êÖ¾·û¡£
(4).refidÊǶԹ¹½¨ÎļþÖÐij´¦¶¨ÒåÒ»¸ö¹ýÂËÆ÷µÄÒýÓá£

7.PathÀàÐÍ
PathÔªËØÓÃÀ´±íʾһ¸öÀà·¾¶£¬²»¹ýËü»¹¿ÉÒÔÓÃÓÚ±íʾÆäËûµÄ·¾¶¡£ÔÚÓÃ×÷Ò¾¸öÊôÐÔʱ£¬Â·¾­Öеĸ÷ÏîÓ÷ֺŻòðºÅ¸ô¿ª¡£ÔÚ¹¹½¨µÄʱºò£¬´Ë·Ö¸ô·û½«´úÌ浱ǰƽ̨ÖÐËùÓеÄ·¾¶·Ö¸ô·û£¬ÆäÓµÓеÄÊôÐÔÈçÏ¡£
(1).location ±íʾһ¸öÎļþ»òĿ¼¡£AntÔÚÄÚ²¿½«´ËÀ©Õ¹ÎªÒ»¸ö¾ø¶Ô·¾¶¡£
(2).refid ÊǶԵ±Ç°¹¹½¨ÎļþÖÐij´¦¶¨ÒåµÄÒ»¸öpathµÄÒýÓá£
(3).path±íʾһ¸öÎļþ»ò·¾¶ÃûÁÐ±í¡£

8.mapperÀàÐÍ
MapperÀàÐͶ¨ÒåÁËÒ»×éÊäÈëÎļþºÍÒ»×éÊä³öÎļþ¼äµÄ¹Øϵ£¬ÆäÊôÐÔÈçÏ¡£
(1).classname ±íʾʵÏÖmapperÀàµÄÀàÃû¡£µ±ÄÚÖÃmapper²»Âú×ãÒªÇóʱ£¬ÓÃÓÚ´´½¨¶¨ÖÆmapper.
(2).classpath±íʾ²éÕÒÒ»¸ö¶¨ÖÆmapperʱËùÓõÄÀàÐÍ·¾¶¡£
(3).classpathrefÊǶÔij´¦¶¨ÒåµÄÒ»¸öÀà·¾¶µÄÒýÓá£
(4).fromÊôÐԵĺ¬ÒåÈ¡¾öÓÚËùÓõÄmapper.
(5).toÊôÐԵĺ¬ÒåÈ¡¾öÓÚËùÓõÄmapper.
(6).typeÊôÐÔµÄȡֵΪidentity£¬flatten glob merge regexp ÆäÖÐÖ®Ò»£¬Ëü¶¨ÒåÁËÒªÊÇÓõÄÄÚÖÃmapperµÄÀàÐÍ¡£

Ant µÄÔËÐÐ
°²×°ºÃAnt²¢ÇÒÅäÖú÷¾¶Ö®ºó£¬ÔÚÃüÁîÐÐÖÐÇл»µ½¹¹½¨ÎļþµÄĿ¼£¬ÊäÈëAntÃüÁî¾Í¿ÉÒÔÔËÐÐAnt.ÈôûÓÐÖ¸¶¨ÈκβÎÊý£¬Ant»áÔÚµ±Ç°Ä¿Â¼Ï²éѯ build.xmlÎļþ¡£Èç¹ûÕÒµ½Á˾ÍÓøÃÎļþ×÷Ϊ¹¹½¨Îļþ¡£Èç¹ûʹÓÃÁË -find Ñ¡ÏAnt ¾Í»áÔÚÉϼ¶Ä¿Â¼ÖÐÕÒ¹¹½¨Îļþ£¬Ö±ÖÁµ½´ïÎļþϵͳµÃ¸úĿ¼¡£Èç¹û¹¹½¨ÎļþµÄÃû×Ö²»ÊÇbuild.xml £¬ÔòAntÔËÐеÄʱºò¾Í¿ÉÒÔʹÓà -buildfile file ,ÕâÀïfile Ö¸¶¨ÁËҪʹÓõĹ¹½¨ÎļþµÄÃû³Æ£¬Ê¾ÀýÈçÏ£º
Ant
ÈçÏÂ˵Ã÷Á˱íʾµ±Ç°Ä¿Â¼µÄ¹¹½¨ÎļþΪbuild.xml ÔËÐÐ ant Ö´ÐÐĬÈϵÄÄ¿±ê¡£

Ant -buildfile test.xml
ʹÓõ±Ç°Ä¿Â¼ÏµÄtest.xml ÎļþÔËÐÐAnt ,Ö´ÐÐĬÈϵÄÄ¿±ê¡£
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 0 ÌõÆÀÂÛ