ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Haas <>
Subject [PATCH]: nested Classpath definitions
Date Wed, 05 Apr 2000 11:38:20 GMT
Dear Committer

The nested classpath definition got votes. My response to one question
asked did not get any follow ups, therefor I beleive it is time to
include this into ANT. Below you find a description what this patch is
all about.

After this patch has been commited, I hope some volunters will help
adding the feature to the tasks using classpath definitions. I'll
certainly help, but the JUnit task got higher priority right now.

Thank you

- tom


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

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.

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.

- tom

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