1. <target name="checksw_path" depends="if_windows, if_unix"/>
  2.  
  3. <target name="checkos">
  4. <condition property="isWindows">
  5. <os family="windows" />
  6. </condition>
  7.  
  8. <condition property="isLinux">
  9. <os family="unix" />
  10. </condition>
  11. </target>
  12.  
  13. <target name="if_windows" depends="checkos" if="isWindows">
  14. <property name="sw.root" value="c:flag" />
  15. <echo message="${sw.root}"/>
  16. </target>
  17.  
  18. <target name="if_unix" depends="checkos" if="isLinux">
  19. <property name="sw.root" value="/opt/flag" />
  20. <echo message="${sw.root}"/>
  21. </target>
  22.  
  23. <condition property="isWindows">
  24. <os family="windows" />
  25. </condition>
  26.  
  27. <condition property="isLinux">
  28. <os family="unix" />
  29. </condition>
  30.  
  31. <target name="checkos">
  32. <condition property="isWindows" value="true">
  33. <os family="windows" />
  34. </condition>
  35.  
  36. <condition property="isLinux" value="true">
  37. <os family="unix" />
  38. </condition>
  39. </target>