• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant vs Batch files

 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Can anyone tell me what all we can do using Ant that can't be done using batch files? As I'm new to Ant tool, tell me the areas where Ant is powerful compared to batch files

Regards,
Narendranath
 
author & internet detective
Posts: 41878
909
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Naren,
A few advantages of Ant over batch files:
  • platform independence - you can develop on Windows and run a build on UNIX/LINUX
  • integrates into IDEs - you can run the build from the IDE or command line
  • knowledge - more people know Ant than advanced batch scripting
  • support - since Ant is standard, there are many extensions and custom tasks
  • more powerful tasks - how easy is it to send out an e-mail in a batch file?

  •  
    author
    Posts: 14112
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Originally posted by Naren Chivukula:
    Can anyone tell me what all we can do using Ant that can't be done using batch files?



    Nothing, in the same sense as that you can't do anything in Java that couldn't be done using Assembler instead.
     
    Saloon Keeper
    Posts: 27807
    196
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    More accurately, there's a whole raft of things that are trivial in Ant that are difficult or even impossible in that rather feeble scripting language used for Windows batch files (I'm assuming that's what you meant and not the more powerful Unix shell scripting, though Ant has advantages even there).

    Just aside from providing an intelligent and extensible build environment for Java, Ant scripts also have minimal OS dependency. If you want to create or delete a directory, for example, the same Ant task works under both Windows and Unix.

    I have, in fact, some ant buildfiles that allow me to do development under Windows, then export the entire project to Solaris, where I rerun them and they detect the Solaris OS and build Solaris install packages. One of my projects also understands that when it's running under Linux, it's supposed to build an RPM.
     
    Don't get me started about those stupid light bulbs.
    reply
      Bookmark Topic Watch Topic
    • New Topic