问题
I've been using Phing at work (it was set up when I got there), and thinking of using it for some personal projects. One thing I haven't got my head around yet though is what the big appeal is?
What, if any, are the killer features of Phing or Ant? What are the big reasons people choose to use them instead of (for example) just a collection of bash scripts that execute their build actions? I'm sure I'm missing the obvious, hopefully someone can help me. While I understand that some people may prefer not to use phing/ant, I'm hoping to hear from people who do prefer them about why they prefer them. Just so I can make a more informed decision.
Thanks for any direction or links.
回答1:
The main feature of Ant is to add frustration to your day, when you know you could achieve something in 30 seconds in a Makefile, but end up fighting with Ant for an hour :)
It was a fresh implementation without requiring a functional shell and all the other standard commands that you expect to be available with a shell. I think that's the real killer feature - you can use it on Windows OS.
Ant XML is far more structured and machine-readable - whereas Makefile+shell is essentially Turing complete and extremely generic. Your IDE has a hope of being able to understand Ant XML, the same can't be said in the general case for Makefiles.
Sadly, the reality after all this time seems to be that the IDEs don't make good use of this potential win. Case in point, opening build.xml in Eclipse just shows you XML.
Which I think just leaves the Windows OS rationale. If there was no Windows OS, probably there would be no Ant either.
来源:https://stackoverflow.com/questions/18564085/why-phing-ant-over-bash-and-make