• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

common tasks in multiple build files

 
satish bodas
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
Have worked on couple of projects where have simply copy pasted build files for ant from other's / web .

Now there seems to be a common approach ::
compile / run Junit tests / war / jar / ear deploy

This seems to be repeated in my projects .

My question ::

Can I have a Master Build file and the other project specific build files which inherit from this .

I am thinking - if this is possible - than I would push common tasks in the project agnostic build file
The project build file will pass as a parameter the project name ( for creation of jar / war / ear etc )

Any pointers would be greatly appreciated
Thanks ,
~satish
 
Jan Cumps
Bartender
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I have a Master Build file and the other project specific build files which inherit from this
Yes.
You can create a master build file, and import it in your project specific build.xml:You could also use Ant's ANT task to call targets from your Master Build file, although that task is designed to allow you to build subprojects rather than to call targets from a master.
[ September 02, 2008: Message edited by: Jan Cumps ]
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34198
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Satish,
Also take a look at macrodefs. They let you call the same logic with different parameter values.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Jeanne Boyarsky:
Satish,
Also take a look at macrodefs. They let you call the same logic with different parameter values.


And presetdefs, for simpler cases. Use them a lot - great way to reduce duplication.
 
satish bodas
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jan , Jeanne and Ilja for the help .
Thanks ,
~satish
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic