ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Russell Stocum" <bsto...@paychex.com>
Subject HELP!!! Scripting in ANT
Date Thu, 05 Jul 2001 12:55:41 GMT
I have been writing an ANT build script for compiling Java files into
another tree structure.

source dir:
/java/source/com/mycompany/newproject/

destination dir:
/java/classes/com/mycompany/newproject/

I use the string  "../../../.." to append to the beginning of the
location of the destdir in the <javac/> tag so that I can keep the
current dir "." as my working dir.  I am in a clearcase VOB the whole
time, and since the company I work for has their own modified version of
the clearcase commands I didn't use the default tag set that came with
ANT for clearcase.  The clearcase commands I run through the <exec/>
tag. It would seem that I have to have the default dir as the same dir
that the files you are working with are in, when run from ANT, otherwise
it will not run my modified clearcase commands right.

Question#1:  from past experience does anyone know if its worth the time
to rewrite the clearcase classes to run the commands that I use for
clearcase?  Would it be better to set up aliases in the ksh environment
that mimmic the commands called by the current clearcase classes (or at
least I believe that the classes exec the commands..)?

Question#2:  I seem to have an over abundance of <antcall/> tags in my
build.xml file, is there anyway to cut down on the bulk of these tags?
I have many cases in which I just use <antcall/> as a call to a function
and pass in a single parameter to exec the redundant code.  <antcall/>
seems rather bulky, I would much rather something like <antcall
target="a-target" param="fileName=new.java, location=../sub/"/>  then to
what I seem to have:
<antcall target="a-target">
    <param name="fileName" value="new.java"/>
    <param name="location" value="../sub/"/>
</antcall>

Am I going about this the correct way?  It would seem that I could
benefit from using a scripting language like Javascript.  Which brings
me to my third question:

Question3# Is there any documentation on how to use Javascript or
another scripting language in ANT or is it better to simply code a new
functionality into a class file?  When is the case that you use
scripting over a new class and XML tag?

Right now my build.xml file is functional... but it is rather bulky and
non elegant... Which I was hoping that XML would remedy...

Thanks for your time,
-Ben

Mime
View raw message