Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Ant vs Batch files

 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
  • 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: 40035
809
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • 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
    • 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: 22256
    151
    Android Eclipse IDE Tomcat Server Redhat Java Linux
    • Mark post as helpful
    • send pies
    • 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.
     
    Your mother is a hamster and your father smells of tiny ads!
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
      Bookmark Topic Watch Topic
    • New Topic