• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

ANT Task vs Shell script

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Certain jobs like moving files can be achieved by ANt or by shel script.Can anyone tell me which approach is better performance wise and why.

Thanks in advance.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ignore performance. Can you write a shell script that runs on both Unix and Windows?
 
Bobby Benjamin
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for you inputs Paul !
I agree that ANT is platform independent and can run on any OS. But for the sake of argument, if I have to write a task to move /ftp files around on Unix for automation, which approach should I be taking.

Cheers !
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ultimately Ant will be calling native code for any file operation - all processes have to. Since Ant is another layer on top of this code you could casually assume it will perform worse. However, I'll bet the performance differences will be negligable. Of course I have no proof for that statement, you could write some tests and try to prove me right/wrong?

However, I'd suggest how a build performs is less of a concern (unless it is too poor to use on a day to day basis). Maintaining more than one build script is a recipe for bugs: more than one build script inevitably ends up with more than one artifact being built as developers forget to update all scripts, or a script goes a while without being tested on a particular platform etc.

If you know your build task is Unix only (and will remain that way) then a shell script is a fine solution; it will give you more funtionality than Ant out the box and you don't need to install things like a JRE to get the shell script to run.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My typical rule of thumb is if it's not part of building/deploying a java project, don't use Ant.
 
Their achilles heel is the noogie! Give them noogies tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic