ant.plugin.zsh 376 B

12345678910111213141516
  1. _ant_does_target_list_need_generating () {
  2. [ ! -f .ant_targets ] && return 0;
  3. [ .ant_targets -nt build.xml ] && return 0;
  4. return 1;
  5. }
  6. _ant () {
  7. if [ -f build.xml ]; then
  8. if _ant_does_target_list_need_generating; then
  9. sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
  10. fi
  11. compadd `cat .ant_targets`
  12. fi
  13. }
  14. compdef _ant ant