ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Haas <>
Subject Proposal: Nested classpath definitoons (with PATCH)
Date Mon, 03 Apr 2000 09:30:37 GMT

A week ago I made a proposal for an object handling nested classpath
definitions. Using your feedback and learning more on nested element
definitions in Ant I come up here with a followup on my first proposal.

Stefan Bodewig <> and I are currently developing a target
to run unit tests using the JUnit framework. We wanted to provide nested
classpath definitions. As other task could reuse our work, I want first
to make shure, everyone agrees on how it is done, so it can go in
together with the JUnit task.

The JavaC, Javadoc and Java task would profit immediatly from this work.

The object is leaner and cleaner. The XML definiton got simpler.

An XML definiton using nested classpath definitions looks like the

        <path defintion="/some/dir;/some/fil.jar:/some/other/path" />
        <element location="/a/file.jar" />
        <element location="/a/path" />
definition="/another/path/classes:/mor/classes;/another/file.jar" />

In a task "sometask" define a classpath callled "somepath". A classpath
consists of any numbers of "element" and "path" element definitions. An
element adds a single location either file or directory. A path adds a
list of locations described by a string using the separators ";" and
":". Path definitions use th code from Project.translatePath to parse
and split the definitions. There primary use is the inclusion of some
predefined classpath property (like the CLASSPATH environment variable
or other).

Elements and Pathes are distinguished to allow the developer clearly
express, if she adds a single location or a predefined and to be parsed
list of locations to the classpath defintion in any sequence she may

Sometask must provide a method creatSomepath which returns an instance
of Path. The Path object implements the createPath (whic returns this),
setLocation and createElement methods.
setLocation uses Path.translatePath to parse the given argument.
createElement returns an instance of PathElement, which provides the
setLocation method to add a location to the classpath definition.
The classpath definition is stored as a list of File objects, which is
build by the setLocation and SetDefintion methods.

Let me know, if you are willing to include this into main ant
dirstribution so we can build our JUnit task using it. I am willing to
provide patches for other tasks to use the Path facility.

My last proposal did not get any votes, so please speak up this time.
Thank you!!

- tom

* Thomas Haas                    <>
* SoftWired AG                   <>
* Technoparkstr. 1  ***  CH-8005 Zurich  ***  +41-1-4452370

View raw message