您好,欢迎访问三七文档
E_mailhk_sz@163.comPDF()yj780210For:=1.0?projectname=testdefault=upload!----propertyname=dest_drivevalue=D:/propertyname=dest_dirvalue=${dest_drive}test2test/!----targetname=create_dirmkdirdir=${dest_dir}//target!--copytaskbuild.xml--targetname=uploaddepends=create_dircopytodir=${dest_dir}filesetdir=.excludename=**build.xml//fileset/copy/target/project2DOSD:test1anttest2testtest1build.xmlantupload:1.2AntjavaAnt1.2AntjavaHelloWord1D:testsrcclassesclassDtestsrc2srcHelloWord.javapublicclassHelloWord{publicstaticvoidmain(Stringargs[]){System.out.println(HelloWorld!);}}3testbuild.xml?xmlversion=1.0?projectdefault=buildbasedir=.propertyname=appnamevalue=HelloWord/propertyname=basevalue=D:test/propertyname=srcvalue=src/propertyname=buildvalue=classes/propertyname=myclasspathvalue=${base}${build}/targetname=buildmkdirdir=${build}/javacsrcdir=${src}destdir=${build}includename=**/*.java//javac/targettargetname=rundepends=buildexecexecutable=javaargline=-classpath${myclasspath}${appname}//exec/targettargetname=cleandeleteincludeEmptyDirs=truefilesetdir=${build}//delete/target/projectpropertybuild.propertiesbuild.xmlbuild.propertiesbuild.propertiesappname=HelloWordsrc=srcbuild=classesmyclasspath=${basedir}${build}build.xmlpropertyfilebuild.properties?xmlversion=1.0?projectdefault=buildbasedir=.propertyfile=build.properties/targetname=buildmkdirdir=${build}/javacsrcdir=${src}destdir=${build}includename=**/*.java//javac/targettargetname=rundepends=buildexecexecutable=javaargline=-classpath${myclasspath}${appname}//exec/targettargetname=cleandeleteincludeEmptyDirs=truefilesetdir=${build}//delete/target/project4testantantrunantclean1.3antjunitAnt1.3antjunit1antjunitJUnitXMLXSLHTMLXML2D:carsrcclassesclassetcxslXSLDcarsrcetc%ANT_HOME%etcjunit-noframes.xslD:caretcxsl3{publicintgetWheels(){return3;}}testCar.java//importjunit.framework.*;publicclasstestCarextendsTestCase{protectedintexpectedWheels;protectedCarmyCar;publictestCar(Stringname){super(name);}protectedvoidsetUp(){expectedWheels=4;myCar=newCar();}publicstaticTestsuite(){returnnewTestSuite(testCar.class);}publicvoidtestGetWheels(){assertEquals(expectedWheels,myCar.getWheels());}}5build.xmlbuild.propertiesbuil.propertiessrc.dir=srcbuild.dir=classesxsl.dir=etc/xslreport.dir=reportbuild.xml?xmlversion=1.0?projectdefault=buildbasedir=.propertyfile=build.propertiesdescription=Transferpropertyfrom.propertiesfile/targetname=builddescription=Buildtheworkdirectorymkdirdir=${build.dir}/mkdirdir=${report.dir}/javacsrcdir=${src.dir}destdir=${build.dir}includename=**/*.java//javac/targettargetname=junitdepends=builddescription=ExecuteUnitTestststamp/junitprintsummary=yesclasspathpathelementlocation=${build.dir}//classpathformattertype=xml/batchtesttodir=${report.dir}filesetdir=${src.dir}includename=**/testCar.java//fileset/batchtest/junitjunitreporttodir=${report.dir}filesetdir=${report.dir}includename=TEST-*.xml//filesetreportformat=noframesstyledir=${xsl.dir}todir=${report.dir}//junitreport/targettargetname=cleandescription=DeletetheworkdirectorydeleteincludeEmptyDirs=truefilesetdir=${build.dir}/filesetdir=${report.dir}//delete/target/project6D:carantjunitcarreportjunit-noframes.htmlTESTS-TestSuites.xmlTEST-testCar.xmljunit-noframes.htmlantclean1.4antwebAnt1.4antweb1JBuilder9+Weblogic7FilterFilterDJbuilderclassesFilter.warD:FiltersrcjavaFilterJSPWEB-INF2JbuilderCLASSPATHservlet://java.sun.com/webapps/download/Redirect/103537442/5847479377282807053505607246086069333228938633594669477228720286350602472859339008063305596058473206-4908/servlet-2_3-fcs-classfiles.zipservlet-2_3-fcs-classfiles.zipCLASSPATH3D:Filterbuild.propertiesFilter.xmlbuild.propertiesWebLogic.user_projects.mydomain.applications=C:/bea/user_projects/mydomain/applicationsfilter=Filterdest=classes.antsrc=srcFilter.xml?xmlversion=1.0?projectdefault=initbasedir=.propertyfile=build.properties/targetname=initdescription=initializationmkdirdir=${dest}/javacdestdir=${dest}srcpath=${src}//javac/targettargetname=wardepends=initwardestfile=Filter.warwebxml=${filter}/WEB-INF/web.xmlcompress=falseclassesdir=${dest}includename=**/*.*//classesfilesetdir=${filter}includename=**/*.*//fileset/war/targettargetname=deploydepends=warcopytodir=${WebLogic.user_projects.mydomain.applications}filesetdir=.includes=Filter.war//copy/targettargetname=rebuilddepends=clean,warcopytodir=${WebLogic.user_projects.mydomain.applications}filesetdir=.includes=Filter.war//copy/targettargetname=cleandeleteincludeEmptyDirs=truefilesetdir=${des
本文标题:ant实用实例
链接地址:https://www.777doc.com/doc-6372746 .html