ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tharp, Joshua L, SOLGV" <>
Subject Testing for a path reference
Date Wed, 23 Apr 2003 13:54:22 GMT
There was an idea in the book _Java_Deveopment_with_ANT_ to create what
they called library build files. They were building block build files
that focus on one aspect of the build process (i.e. a javadoc.xml file
would specialize in building the javadocs). These library build files
could then be reused in several different projects by simply making sure
that certain properties were set or by using some set of default
properties if they were acceptable. I've started down the road of
building up a library of these build files for various tasks that I want
to reuse across several projects/components.


I have several questions:


1) While I've been working on these library build files, I've realized
there is nothing that really points to my particular development
environment other than a properties file that I include everywhere...
Has anyone else built a library of reusable build files or know of a
ready-made set of these library files (perhaps an ancillary ANT


2) Does anyone know of a way to use an attribute based on some
condition? For example, with javadoc, if you specify an overview.html
file that is not there, you get an error, if you don't use the
attribute, you don't get the feature. I would like to use the attribute
if the file exists, but not cause grief if it doesn't. My current
solution is to have two targets with a condition. It works fine for one
attribute, but that technique causes the number of targets to grow
exponentially with the number of optional attributes...


3) Path references do not seem to be immutable like properties... I
would like to have a default path reference, but only if one is not
already defined. Is there a way to test to see if a path reference is
defined that doesn't kill the build if it doesn't?


4) Does anyone know of a way to dynamically include a variable number of
nested elements? Returning to my javadoc example, if the build for
component A would like to "link" to several different URLs, but the
build for component B has a different list, is there a way to specify
those two lists and send them to the same javadoc building target?


My library files are basically stand-alone in that they have their own
init targets to create only the directories needed for their task, have
most (if not all) of the possible attributes for the target task exposed
as properties, then defines default values for all of those properties.
I also created a very small proxy target that I can use as an entity so
I can fake using the library build file as a dependency. The only path
information that is not defined as a property is the entity definitions
for the proxy targets. Which prompts me for another question:


5) Can a build file reference a DTD? That way I could specify the entity
definitions in one place and only have to specify the DTD instead of
having to list all of the entities in each of my build files.





  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message