]> git.rmz.io Git - dotfiles.git/blob - zsh/plugins/ant/ant.plugin.zsh
add xbindkeysrc
[dotfiles.git] / zsh / plugins / ant / ant.plugin.zsh
1 stat -f%m . > /dev/null 2>&1
2 if [ "$?" = 0 ]; then
3 stat_cmd=(stat -f%m)
4 else
5 stat_cmd=(stat -L --format=%Y)
6 fi
7
8 _ant_does_target_list_need_generating () {
9 if [ ! -f .ant_targets ]; then return 0;
10 else
11 accurate=$($stat_cmd .ant_targets)
12 changed=$($stat_cmd build.xml)
13 return $(expr $accurate '>=' $changed)
14 fi
15 }
16
17 _ant () {
18 if [ -f build.xml ]; then
19 if _ant_does_target_list_need_generating; then
20 sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets
21 fi
22 compadd `cat .ant_targets`
23 fi
24 }
25
26 compdef _ant ant