phing.plugin.zsh 438 Bytes
Newer Older
Claus Witt's avatar
Claus Witt committed
1
_phing_does_target_list_need_generating () {
2
  [ ! -f .phing_targets ] && return 0;
frantzmiccoli's avatar
frantzmiccoli committed
3
  [ build.xml -nt .phing_targets ] && return 0;
4
  return 1;
Claus Witt's avatar
Claus Witt committed
5
6
7
8
9
}

_phing () {
  if [ -f build.xml ]; then
    if _phing_does_target_list_need_generating; then
10
      phing -l|grep -v "\[property\]"|grep -v "Buildfile"|sed 1d|grep -v ":$" |grep -v "^\-*$"|awk '{print $1}' > .phing_targets
Claus Witt's avatar
Claus Witt committed
11
12
13
14
15
16
    fi
    compadd `cat .phing_targets`
  fi
}

compdef _phing phing