OpenMake Meister

Modifying the Input or Output File Locations with Ant for Java Builds

By default the output of Build Tasks that use the Javac compile will be placed directly under the Build Directory as determined by the compiler.  There are situations where this is not the desired approach.  Certain IDEs such as Eclipse and IBM Rational Application Developer place source code under intermediate directories that add extra directories above the package structure.

 

Listed in the Table BD-11 are the Ant options within Build Tasks that can be used to control the location of files.

 

Table BD-11 Ant Options within Build Task

Task

Ant Option

Comment

Ant Javac

destdir=

Location within the build directory to place the class files.  Typically set to the "intermediate" directory as created by the IDE.  E.g.
destdir="Webproject/Java Source".

Ant Jar – Default option group

basedir=

Location from where to get files (either classes or resource files).  In the case of compiled classes, usually equal to the value of "destdir" from the Ant Javac task.

Ant Jar – Custom option group

Dir=

Location from where to get files (either classes or resource files).  In the case of compiled classes, usually equal to the value of "destdir" from the Ant Javac task.  This is different from the "Ant Jar – Default option group" because it is implemented with an Ant "zipfileset" that takes the "dir=" option.

Ant War

basedir=

Same as the Ant Jar – Default option group.

Ant War – Custom option group

Dir=

Same as the Ant Jar – Custom option group.

Ant War – Custom option group

prefix=

Location to place resource within the war file.  E.g. prefix="WEB-INF/classes" is typical for compiled classes

Ant Ear

basedir=

Same as "basedir" in the Ant Jar Task.