62,614
社区成员
发帖
与我相关
我的任务
分享
<taskdef name="aaa" classname="com.ibm.rpx.ant.AAA" classpathref="rpx.specific.classpath"/>
<target name="aaa_test" description="Runs aaa class to do pseudo translation">
<aaaclasspath="${aaa.path};${aaa.path}\aaa.jar;${ant.path}\ant.jar" config="${config}" target="${basedir}/target" >
<fileset dir="${basedir}/src">
<include name="**/*.properties"/>
</fileset>
</aaa>
</target>
<target>
<javac>
<classpath refid="class.path"/>
</javac>
</target>
<taskdef name="rpx" classname="com.ibm.rpx.ant.Rpx" classpathref="rpx.specific.classpath">
<classpath>
<pathelement location="${rpx.path}"/>
<fileset dir="${rpx.path}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</taskdef>
<target name="rpx_test" description="Runs RPX class to do pseudo translation">
<rpx classpath="${rpx.path};${rpx.path}\rpx.jar;${ant.path}\ant.jar" config="${config}" target="${basedir}/target" >
<fileset dir="${basedir}/src">
<include name="**/*.properties"/>
</fileset>
</rpx>
</target>
package com.test;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
public class Test extends Task{
public void execute() throws BuildException
{
String [] classPaths = System.getProperty("java.class.path").toString().split(System.getProperty("path.separator"));
System.out.println("output classpath:");
for(String str:classPaths){
System.out.println(str);
}
}
}
<path id="show.specific.classpath">
<pathelement location="c:/Test"/>
</path>
<taskdef name="showclasspath" classname="com.test.Test" classpathref="show.specific.classpath" classpath="c:\Test"/>
<target name="show" description="show classpath">
<showclasspath>
</showclasspath>
</target>