<pathelement path="${classpath}"/> <fileset dir="lib"> <include name="**/*.jar"/> </fileset> <pathelement location="classes"/> </classpath> 上面的例子构造了一个路径值包括:${classpath}的路径,跟着lib目录下的所有jar文件,接着是classes目录。 如果你想在多个task中使用相同的path-like stru...
45. <pathconvert pathsep="${line.separator}| |-- " 46. property="echo.path.compile" 47. refid="project.classpath"> 48. </pathconvert> 49. 50. <!--打印日志信息--> 51. <target name="print_classpath"> 52. <echo message="|-- compile classpath"/> 53. <echo message="| |"/>...
JAVAH_CMD = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries/linux-amd64/bin/javah -bootclasspath /home/jdkbuild/classes JAVADOC_CMD = /NOT-SET/re/jdk/1.7.0/promoted/latest/binaries/linux-amd64/bin/javadoc -J-XX:-PrintVMOptions -J-XX:+UnlockDiagnosticVMOptions -J-XX:-LogVMOutput -J-...
如果你想在多个task中使用相同的path-like structure,你可以用<path>元素定义他们(与target同级),然后通过id属性引用--参考Referencs例子。 path-like structure可能包括对另一个path-like structurede的引用(通过嵌套<path>元素): <path id="base.path"> <pathelement path="${classpath}"/> <fileset dir="li...
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="classpath"/> </target> 自定义任务 如果内置任务不能满足你的需求,你可以编写自定义任务。自定义任务是通过扩展org.apache.tools.ant.Task类来实现的。然后,你可以在build.xml文件中注册并使用你的自定义任务。
下面是我用比较熟悉的beanshell脚本实现的一个自定义task。beanshell脚本基本就是java代码,对于熟悉java的人来说非常方便。 注意:必须将beanshell的相关jar包(如:bsh-core-2.0b4.jar),放到classpath中,我的做法是将jar包复制到$ANT_HOME/lib下 它的功能很简单,task的名字为”propertylist”,有”input”,”reverse...
java会基于提供的classpath(缩写成cp)路径去搜索。java -classpath bin com.tt.Hello 将bin/目录中的所有文件归档到 'classes.jar' 中: 方法一: 指定MANIFEST.MF文件的命令:jar vcfm classes.jar MANIFEST.MF -C bin/ . 方法二: 先直接生成jar vcf classes.jar -C bin/ .再winRAR直接修改MANIFEST.MF ...
-debug print debugging information -emacs produce logging information without adornments -logfile file use given file for log output -logger classname the class that is to perform logging -listener classname add an instance of class as a project listener ...
depends则定义了依赖关系,值为其他target的name。多个依赖关系用","隔开, 顺序执行完定义的依赖关系,才会执行这个target。 target在build.xml中定义的顺序无所谓,但是depends中的顺序必须正确。5.编译源代码: <javac srcdir="src" destdir="classes"> <classpat...
--测试--><targetname="test"depends="compile"description="run junit test"><mkdirdir="${report.dir}"/><junitprintsummary="on"haltonfailure="false"failureproperty="tests.failed"showoutput="true"><classpathrefid="master-classpath"/><formattertype="plain"/><batchtesttodir="${report.dir}"><...