ant.plugin.zsh 383 B

12345678910111213141516
  1. _ant_does_target_list_need_generating () {
  2. [ ! -f .ant_targets ] && return 0;
  3. [ build.xml -nt .ant_targets ] && return 0;
  4. return 1;
  5. }
  6. _ant () {
  7. if [ -f build.xml ]; then
  8. if _ant_does_target_list_need_generating; then
  9. ant -p | awk -F " " 'NR > 5 { print lastTarget }{lastTarget = $1}' > .ant_targets
  10. fi
  11. compadd -- `cat .ant_targets`
  12. fi
  13. }
  14. compdef _ant ant