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.

case.xml 1.0 kB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?xml version="1.0"?>
  2. <project name="case-test" default="test" basedir=".">
  3. <property name="value" value="task.xml" />
  4. <target name="init">
  5. <taskdef name="antlib" classname="org.apache.tools.ant.taskdefs.Antlib" />
  6. <antlib file="../../build/case_contrib.jar" />
  7. </target>
  8. <target name="test" depends="init,case,test1,test2,test3">
  9. <echo message="Value=${value}" />
  10. </target>
  11. <target name="case" >
  12. <case property="value" >
  13. <when value="task.xml" property="value.xml" />
  14. </case>
  15. <case property="location" >
  16. <when value="loc" property="location.fail" />
  17. <when value="" property="location.fail" />
  18. <else property="location.unset" />
  19. </case>
  20. </target>
  21. <target name="test1" if="value.xml">
  22. <echo message="Value equals to itself" />
  23. </target>
  24. <target name="test2" if="location.fail">
  25. <fail message="Location passed" />
  26. </target>
  27. <target name="test3" if="location.unset">
  28. <echo message="Location does not exists" />
  29. </target>
  30. </project>