@@ -112,7 +112,7 @@ public class Classloader extends Task {
public static final String SYSTEM_LOADER_REF="ant.coreLoader";
public static final String SYSTEM_LOADER_REF="ant.coreLoader";
private String name=null;
private String name=null;
private Path path;
private Path class path;
private boolean reset=false;
private boolean reset=false;
private boolean reverse=false;
private boolean reverse=false;
private String parentName=null;
private String parentName=null;
@@ -156,8 +156,28 @@ public class Classloader extends Task {
* and is an AntClassLoader ( or any other loader we can extend ),
* and is an AntClassLoader ( or any other loader we can extend ),
* the path will be added to the loader.
* the path will be added to the loader.
*/
*/
public void setPathRef( Reference pathRef ) throws BuildException {
path=(Path)pathRef.getReferencedObject(project);
public void setClasspathRef( Reference pathRef ) throws BuildException {
classpath=(Path)pathRef.getReferencedObject(project);
}
/**
* Set the classpath to be used when searching for component being defined
*
* @param classpath an Ant Path object containing the classpath.
*/
public void setClasspath(Path classpath) {
if (this.classpath == null) {
this.classpath = classpath;
} else {
this.classpath.append(classpath);
}
}
public Path createClasspath() {
if (this.classpath == null) {
this.classpath = new Path(null);
}
return this.classpath.createPath();
}
}
@@ -204,7 +224,7 @@ public class Classloader extends Task {
}
}
acl=new AntClassLoader( (ClassLoader)parent,
acl=new AntClassLoader( (ClassLoader)parent,
project, path, reverse );
project, class path, reverse );
project.addReference( loaderName, acl );
project.addReference( loaderName, acl );
if( name==null ) {
if( name==null ) {
// This allows the core loader to load optional tasks
// This allows the core loader to load optional tasks
@@ -213,8 +233,8 @@ public class Classloader extends Task {
project.setCoreLoader(acl);
project.setCoreLoader(acl);
}
}
}
}
if( path != null ) {
String list[]=path.list();
if( class path != null ) {
String list[]=class path.list();
for( int i=0; i<list.length; i++ ) {
for( int i=0; i<list.length; i++ ) {
File f= new File( list[i] );
File f= new File( list[i] );
if( f.exists() ) {
if( f.exists() ) {