Browse code

Added phing plugin

Claus Witt authored on 09/11/2010 at 13:56:26
Showing 1 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,20 @@
0
+_phing_does_target_list_need_generating () {
1
+  if [ ! -f .phing_targets ]; then return 0;
2
+  else
3
+    accurate=$(stat -f%m .phing_targets)
4
+    changed=$(stat -f%m build.xml)
5
+    return $(expr $accurate '>=' $changed)
6
+  fi
7
+}
8
+
9
+_phing () {
10
+  if [ -f build.xml ]; then
11
+    if _phing_does_target_list_need_generating; then
12
+      echo "\nGenerating .phing_targets..." > /dev/stderr
13
+      phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets
14
+    fi
15
+    compadd `cat .phing_targets`
16
+  fi
17
+}
18
+
19
+compdef _phing phing