You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

test.xml 1.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <project name="embed-test" default="main" basedir=".">
  2. <property name="ant.src" location="../.." />
  3. <property name="junit.jar" location="${ant.src}/lib/junit.jar" />
  4. <import file="build.xml" />
  5. <target name="main" >
  6. <path id="myJars" >
  7. <pathelement path="${junit.jar}" />
  8. <pathelement path="${jxpath.jar}" />
  9. <pathelement path="${ant.home}/lib/ant-sax2.jar" />
  10. </path>
  11. <systemPath pathRef="myJars"/>
  12. <junit id="replacedJunit" />
  13. <echo message="toString sample: ${toString:replacedJunit}" />
  14. <!-- This is Taksdef2.java - it'll use the systemPath as parent loader
  15. -->
  16. <taskdef classname="org.apache.tools.ant.taskdefs.optional.JXPath"
  17. name="jxpath" />
  18. <!-- Init JxPath. '/' is the project -->
  19. <jxpath/>
  20. <echo message="jxPath /targets[1]: ${jxpath:/targets[1]}" />
  21. <echo message="jxPath /references: ${jxpath:/references}" />
  22. <echo message="jxPath /references[@name='myJars']: ${jxpath:/references[@name='myJars']}" />
  23. <echo message="jxPath /references/myJars: ${jxpath:/references/myJars}" />
  24. </target>
  25. <target name="test-import" >
  26. <antcall target="embed.main" />
  27. </target>
  28. </project>