Fixed an issue with the phing plugin
Robby Russell authored on 26/05/2011 at 08:04:231 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,19 @@ |
0 |
+_ant_does_target_list_need_generating () { |
|
1 |
+ if [ ! -f .ant_targets ]; then return 0; |
|
2 |
+ else |
|
3 |
+ accurate=$(stat -f%m .ant_targets) |
|
4 |
+ changed=$(stat -f%m build.xml) |
|
5 |
+ return $(expr $accurate '>=' $changed) |
|
6 |
+ fi |
|
7 |
+} |
|
8 |
+ |
|
9 |
+_ant () { |
|
10 |
+ if [ -f build.xml ]; then |
|
11 |
+ if _ant_does_target_list_need_generating; then |
|
12 |
+ sed -n '/<target/s/<target.*name="\([^"]*\).*$/\1/p' build.xml > .ant_targets |
|
13 |
+ fi |
|
14 |
+ compadd `cat .ant_targets` |
|
15 |
+ fi |
|
16 |
+} |
|
17 |
+ |
|
18 |
+compdef _ant ant |
... | ... |
@@ -10,7 +10,6 @@ _phing_does_target_list_need_generating () { |
10 | 10 |
_phing () { |
11 | 11 |
if [ -f build.xml ]; then |
12 | 12 |
if _phing_does_target_list_need_generating; then |
13 |
- echo "\nGenerating .phing_targets..." > /dev/stderr |
|
14 | 13 |
phing -l |grep -v ":" |grep -v "^$"|grep -v "\-" > .phing_targets |
15 | 14 |
fi |
16 | 15 |
compadd `cat .phing_targets` |