git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270424 13f79535-47bb-0310-9956-ffa450edef68master
@@ -96,7 +96,7 @@ public class Available | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -106,7 +106,7 @@ public class Available | |||||
{ | { | ||||
if( this.filepath == null ) | if( this.filepath == null ) | ||||
{ | { | ||||
this.filepath = new Path( getProject() ); | |||||
this.filepath = new Path(); | |||||
} | } | ||||
return this.filepath.createPath(); | return this.filepath.createPath(); | ||||
} | } | ||||
@@ -129,7 +129,6 @@ public class Available | |||||
if( classpath != null ) | if( classpath != null ) | ||||
{ | { | ||||
classpath.setProject( getProject() ); | |||||
this.loader = new AntClassLoader( getProject(), classpath ); | this.loader = new AntClassLoader( getProject(), classpath ); | ||||
} | } | ||||
@@ -122,7 +122,7 @@ public class ExecuteOn extends ExecTask | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( getProject() ); | |||||
mapperElement = new Mapper(); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -658,7 +658,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( getProject() ); | |||||
bootclasspath = new Path(); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -673,7 +673,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( getProject() ); | |||||
compileClasspath = new Path(); | |||||
} | } | ||||
return compileClasspath.createPath(); | return compileClasspath.createPath(); | ||||
} | } | ||||
@@ -701,7 +701,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( extdirs == null ) | if( extdirs == null ) | ||||
{ | { | ||||
extdirs = new Path( getProject() ); | |||||
extdirs = new Path(); | |||||
} | } | ||||
return extdirs.createPath(); | return extdirs.createPath(); | ||||
} | } | ||||
@@ -716,7 +716,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( src == null ) | if( src == null ) | ||||
{ | { | ||||
src = new Path( getProject() ); | |||||
src = new Path(); | |||||
} | } | ||||
return src.createPath(); | return src.createPath(); | ||||
} | } | ||||
@@ -146,7 +146,7 @@ public class PathConvert extends Task | |||||
if( path == null ) | if( path == null ) | ||||
{ | { | ||||
path = new Path( getProject() ); | |||||
path = new Path(); | |||||
} | } | ||||
return path.createPath(); | return path.createPath(); | ||||
} | } | ||||
@@ -162,7 +162,7 @@ public class PathConvert extends Task | |||||
// If we are a reference, the create a Path from the reference | // If we are a reference, the create a Path from the reference | ||||
if( isReference() ) | if( isReference() ) | ||||
{ | { | ||||
path = new Path( getProject() ).createPath(); | |||||
path = new Path().createPath(); | |||||
Object obj = refid.getReferencedObject( getProject() ); | Object obj = refid.getReferencedObject( getProject() ); | ||||
@@ -131,7 +131,7 @@ public class Property extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -369,7 +369,7 @@ public class SQLExec extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -96,7 +96,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( getProject() ); | |||||
mapperElement = new Mapper(); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -44,7 +44,7 @@ public class Gcj extends DefaultCompilerAdapter | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
Path classpath = new Path( m_project ); | |||||
Path classpath = new Path(); | |||||
// gcj doesn't support bootclasspath dir (-bootclasspath) | // gcj doesn't support bootclasspath dir (-bootclasspath) | ||||
// so we'll emulate it for compatibility and convenience. | // so we'll emulate it for compatibility and convenience. | ||||
@@ -42,7 +42,7 @@ public class Jikes | |||||
{ | { | ||||
getLogger().debug( "Using jikes compiler" ); | getLogger().debug( "Using jikes compiler" ); | ||||
Path classpath = new Path( m_project ); | |||||
Path classpath = new Path(); | |||||
// Jikes doesn't support bootclasspath dir (-bootclasspath) | // Jikes doesn't support bootclasspath dir (-bootclasspath) | ||||
// so we'll emulate it for compatibility and convenience. | // so we'll emulate it for compatibility and convenience. | ||||
@@ -77,7 +77,7 @@ public class Jikes | |||||
String jikesPath = System.getProperty( "jikes.class.path" ); | String jikesPath = System.getProperty( "jikes.class.path" ); | ||||
if( jikesPath != null ) | if( jikesPath != null ) | ||||
{ | { | ||||
classpath.append( new Path( m_project, jikesPath ) ); | |||||
classpath.append( new Path( jikesPath ) ); | |||||
} | } | ||||
Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
@@ -29,7 +29,7 @@ public class Jvc extends DefaultCompilerAdapter | |||||
{ | { | ||||
getLogger().debug( "Using jvc compiler" ); | getLogger().debug( "Using jvc compiler" ); | ||||
Path classpath = new Path( m_project ); | |||||
Path classpath = new Path(); | |||||
// jvc doesn't support bootclasspath dir (-bootclasspath) | // jvc doesn't support bootclasspath dir (-bootclasspath) | ||||
// so we'll emulate it for compatibility and convenience. | // so we'll emulate it for compatibility and convenience. | ||||
@@ -84,7 +84,7 @@ public class Kjc extends DefaultCompilerAdapter | |||||
// generate the clsspath | // generate the clsspath | ||||
cmd.createArgument().setValue( "-classpath" ); | cmd.createArgument().setValue( "-classpath" ); | ||||
Path cp = new Path( m_project ); | |||||
Path cp = new Path(); | |||||
// kjc don't have bootclasspath option. | // kjc don't have bootclasspath option. | ||||
if( m_bootclasspath != null ) | if( m_bootclasspath != null ) | ||||
@@ -199,11 +199,6 @@ public abstract class ConditionBase extends ProjectComponent | |||||
{ | { | ||||
throw new NoSuchElementException(); | throw new NoSuchElementException(); | ||||
} | } | ||||
if( o instanceof ProjectComponent ) | |||||
{ | |||||
( (ProjectComponent)o ).setProject( getProject() ); | |||||
} | |||||
return o; | return o; | ||||
} | } | ||||
} | } | ||||
@@ -75,7 +75,7 @@ public class DocletInfo | |||||
{ | { | ||||
if( m_path == null ) | if( m_path == null ) | ||||
{ | { | ||||
m_path = new Path( null ); | |||||
m_path = new Path(); | |||||
} | } | ||||
return m_path.createPath(); | return m_path.createPath(); | ||||
} | } | ||||
@@ -674,7 +674,7 @@ public class IContract extends MatchingTask | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath; | return classpath; | ||||
} | } | ||||
@@ -738,29 +738,29 @@ public class IContract extends MatchingTask | |||||
// Create the classpath required to compile the sourcefiles BEFORE instrumentation | // Create the classpath required to compile the sourcefiles BEFORE instrumentation | ||||
Path beforeInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | Path beforeInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | ||||
beforeInstrumentationClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
beforeInstrumentationClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
// Create the classpath required to compile the sourcefiles AFTER instrumentation | // Create the classpath required to compile the sourcefiles AFTER instrumentation | ||||
Path afterInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | Path afterInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | ||||
afterInstrumentationClasspath.append( new Path( getProject(), instrumentDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( getProject(), repositoryDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( instrumentDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( repositoryDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( buildDir.getAbsolutePath() ) ); | |||||
// Create the classpath required to automatically compile the repository files | // Create the classpath required to automatically compile the repository files | ||||
Path repositoryClasspath = ( (Path)baseClasspath.clone() ); | Path repositoryClasspath = ( (Path)baseClasspath.clone() ); | ||||
repositoryClasspath.append( new Path( getProject(), instrumentDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( getProject(), repositoryDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( instrumentDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( repositoryDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( buildDir.getAbsolutePath() ) ); | |||||
// Create the classpath required for iContract itself | // Create the classpath required for iContract itself | ||||
Path iContractClasspath = ( (Path)baseClasspath.clone() ); | Path iContractClasspath = ( (Path)baseClasspath.clone() ); | ||||
iContractClasspath.append( new Path( getProject(), System.getProperty( "java.home" ) + File.separator + ".." + File.separator + "lib" + File.separator + "tools.jar" ) ); | |||||
iContractClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( getProject(), repositoryDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( getProject(), instrumentDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( System.getProperty( "java.home" ) + File.separator + ".." + File.separator + "lib" + File.separator + "tools.jar" ) ); | |||||
iContractClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( repositoryDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( instrumentDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( buildDir.getAbsolutePath() ) ); | |||||
// Create a forked java process | // Create a forked java process | ||||
Java iContract = (Java)getProject().createTask( "java" ); | Java iContract = (Java)getProject().createTask( "java" ); | ||||
@@ -206,7 +206,7 @@ public class Javah extends Task | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( getProject() ); | |||||
bootclasspath = new Path(); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -222,7 +222,7 @@ public class Javah extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -101,7 +101,7 @@ public class Native2Ascii extends MatchingTask | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapper = new Mapper( getProject() ); | |||||
mapper = new Mapper(); | |||||
return mapper; | return mapper; | ||||
} | } | ||||
@@ -197,7 +197,8 @@ public class ReplaceRegExp extends Task | |||||
} | } | ||||
else if( file != null ) | else if( file != null ) | ||||
{ | { | ||||
final String message = "The following file is missing: '" + file.getAbsolutePath() + "'"; | |||||
final String message = | |||||
"The following file is missing: '" + file.getAbsolutePath() + "'"; | |||||
getLogger().error( message ); | getLogger().error( message ); | ||||
} | } | ||||
@@ -184,7 +184,7 @@ public class Depend extends MatchingTask | |||||
{ | { | ||||
if( dependClasspath == null ) | if( dependClasspath == null ) | ||||
{ | { | ||||
dependClasspath = new Path( getProject() ); | |||||
dependClasspath = new Path(); | |||||
} | } | ||||
return dependClasspath.createPath(); | return dependClasspath.createPath(); | ||||
} | } | ||||
@@ -422,7 +422,7 @@ public class CSharp | |||||
{ | { | ||||
//demand create pathlist | //demand create pathlist | ||||
if( _referenceFiles == null ) | if( _referenceFiles == null ) | ||||
_referenceFiles = new Path( this.getProject() ); | |||||
_referenceFiles = new Path(); | |||||
_referenceFiles.append( path ); | _referenceFiles.append( path ); | ||||
} | } | ||||
@@ -274,17 +274,18 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exec | |||||
*/ | */ | ||||
protected void addVendorFiles( Hashtable ejbFiles, String ddPrefix ) | protected void addVendorFiles( Hashtable ejbFiles, String ddPrefix ) | ||||
{ | { | ||||
File borlandDD = new File( getConfig().descriptorDir, ddPrefix + BAS_DD ); | |||||
final File borlandDD = new File( getConfig().descriptorDir, ddPrefix + BAS_DD ); | |||||
if( borlandDD.exists() ) | if( borlandDD.exists() ) | ||||
{ | { | ||||
getLogger().debug( "Borland specific file found " + borlandDD ); | |||||
final String message = "Borland specific file found " + borlandDD; | |||||
getLogger().debug( message ); | |||||
ejbFiles.put( META_DIR + BAS_DD, borlandDD ); | ejbFiles.put( META_DIR + BAS_DD, borlandDD ); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
log( "Unable to locate borland deployment descriptor. It was expected to be in " + | |||||
borlandDD.getPath(), Project.MSG_WARN ); | |||||
final String message = "Unable to locate borland deployment descriptor. " + | |||||
"It was expected to be in " + borlandDD.getPath(); | |||||
getLogger().warn( message ); | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
@@ -97,7 +97,7 @@ public class BorlandGenerateClient extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -124,7 +124,7 @@ public class DDCreator extends MatchingTask | |||||
ddCreatorTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper" ); | ddCreatorTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper" ); | ||||
Argument arguments = ddCreatorTask.createArg(); | Argument arguments = ddCreatorTask.createArg(); | ||||
arguments.setLine( args ); | arguments.setLine( args ); | ||||
ddCreatorTask.setClasspath( new Path( getProject(), execClassPath ) ); | |||||
ddCreatorTask.setClasspath( new Path( execClassPath ) ); | |||||
if( ddCreatorTask.executeJava() != 0 ) | if( ddCreatorTask.executeJava() != 0 ) | ||||
{ | { | ||||
throw new TaskException( "Execution of ddcreator helper failed" ); | throw new TaskException( "Execution of ddcreator helper failed" ); | ||||
@@ -254,7 +254,7 @@ public class EjbJar extends MatchingTask | |||||
{ | { | ||||
if( config.classpath == null ) | if( config.classpath == null ) | ||||
{ | { | ||||
config.classpath = new Path( getProject() ); | |||||
config.classpath = new Path(); | |||||
} | } | ||||
return config.classpath.createPath(); | return config.classpath.createPath(); | ||||
} | } | ||||
@@ -183,7 +183,7 @@ public class Ejbc extends MatchingTask | |||||
Argument arguments = helperTask.createArg(); | Argument arguments = helperTask.createArg(); | ||||
arguments.setLine( args ); | arguments.setLine( args ); | ||||
helperTask.setClasspath( new Path( getProject(), execClassPath ) ); | |||||
helperTask.setClasspath( new Path( execClassPath ) ); | |||||
if( helperTask.executeJava() != 0 ) | if( helperTask.executeJava() != 0 ) | ||||
{ | { | ||||
throw new TaskException( "Execution of ejbc helper failed" ); | throw new TaskException( "Execution of ejbc helper failed" ); | ||||
@@ -198,7 +198,7 @@ public class GenericDeploymentTool | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( task.getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -672,11 +672,6 @@ public class GenericDeploymentTool | |||||
*/ | */ | ||||
} | } | ||||
protected void log( String message, int level ) | |||||
{ | |||||
getTask().log( message, level ); | |||||
} | |||||
/** | /** | ||||
* This method checks the timestamp on each file listed in the <code> | * This method checks the timestamp on each file listed in the <code> | ||||
* ejbFiles</code> and compares them to the timestamp on the <code>jarFile | * ejbFiles</code> and compares them to the timestamp on the <code>jarFile | ||||
@@ -176,7 +176,7 @@ public class IPlanetEjbcTask extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -237,7 +237,7 @@ public class WLRun extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -251,7 +251,7 @@ public class WLRun extends Task | |||||
{ | { | ||||
if( weblogicClasspath == null ) | if( weblogicClasspath == null ) | ||||
{ | { | ||||
weblogicClasspath = new Path( getProject() ); | |||||
weblogicClasspath = new Path(); | |||||
} | } | ||||
return weblogicClasspath.createPath(); | return weblogicClasspath.createPath(); | ||||
} | } | ||||
@@ -120,7 +120,7 @@ public class WLStop extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -296,7 +296,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||||
{ | { | ||||
if( wlClasspath == null ) | if( wlClasspath == null ) | ||||
{ | { | ||||
wlClasspath = new Path( getTask().getProject() ); | |||||
wlClasspath = new Path(); | |||||
} | } | ||||
return wlClasspath.createPath(); | return wlClasspath.createPath(); | ||||
} | } | ||||
@@ -323,7 +323,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||||
protected ClassLoader getClassLoaderFromJar( File classjar ) | protected ClassLoader getClassLoaderFromJar( File classjar ) | ||||
throws IOException, TaskException | throws IOException, TaskException | ||||
{ | { | ||||
Path lookupPath = new Path( getTask().getProject() ); | |||||
Path lookupPath = new Path(); | |||||
lookupPath.setLocation( classjar ); | lookupPath.setLocation( classjar ); | ||||
Path classpath = getCombinedClasspath(); | Path classpath = getCombinedClasspath(); | ||||
@@ -740,7 +740,6 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||||
* @param sourceJar java.io.File representing the source (EJB1.1) jarfile. | * @param sourceJar java.io.File representing the source (EJB1.1) jarfile. | ||||
* @param destJar java.io.File representing the destination, WebLogic | * @param destJar java.io.File representing the destination, WebLogic | ||||
* jarfile. | * jarfile. | ||||
* @param publicId Description of Parameter | |||||
*/ | */ | ||||
private void buildWeblogicJar( File sourceJar, File destJar, String publicId ) | private void buildWeblogicJar( File sourceJar, File destJar, String publicId ) | ||||
throws TaskException | throws TaskException | ||||
@@ -376,7 +376,7 @@ public class WebsphereDeploymentTool | |||||
{ | { | ||||
if( wasClasspath == null ) | if( wasClasspath == null ) | ||||
{ | { | ||||
wasClasspath = new Path( getTask().getProject() ); | |||||
wasClasspath = new Path(); | |||||
} | } | ||||
return wasClasspath.createPath(); | return wasClasspath.createPath(); | ||||
} | } | ||||
@@ -403,7 +403,7 @@ public class WebsphereDeploymentTool | |||||
protected ClassLoader getClassLoaderFromJar( File classjar ) | protected ClassLoader getClassLoaderFromJar( File classjar ) | ||||
throws IOException, TaskException | throws IOException, TaskException | ||||
{ | { | ||||
Path lookupPath = new Path( getTask().getProject() ); | |||||
Path lookupPath = new Path(); | |||||
lookupPath.setLocation( classjar ); | lookupPath.setLocation( classjar ); | ||||
Path classpath = getCombinedClasspath(); | Path classpath = getCombinedClasspath(); | ||||
if( classpath != null ) | if( classpath != null ) | ||||
@@ -0,0 +1,27 @@ | |||||
/* | |||||
* Copyright (C) The Apache Software Foundation. All rights reserved. | |||||
* | |||||
* This software is published under the terms of the Apache Software License | |||||
* version 1.1, a copy of which has been included with this distribution in | |||||
* the LICENSE.txt file. | |||||
*/ | |||||
package org.apache.tools.ant.taskdefs.optional.ide; | |||||
/** | |||||
* Adaption of VAJLocalUtil to Task context. | |||||
*/ | |||||
class VAJLocalToolUtil | |||||
extends VAJLocalUtil | |||||
{ | |||||
private VAJTask m_task; | |||||
public VAJLocalToolUtil( final VAJTask task ) | |||||
{ | |||||
m_task = task; | |||||
} | |||||
public void log( final String msg, final int level ) | |||||
{ | |||||
m_task.log( msg, level ); | |||||
} | |||||
} |
@@ -28,7 +28,8 @@ import org.apache.tools.ant.DirectoryScanner; | |||||
* | * | ||||
* @author Wolf Siberski, TUI Infotec GmbH | * @author Wolf Siberski, TUI Infotec GmbH | ||||
*/ | */ | ||||
abstract class VAJLocalUtil implements VAJUtil | |||||
abstract class VAJLocalUtil | |||||
implements VAJUtil | |||||
{ | { | ||||
// singleton containing the VAJ workspace | // singleton containing the VAJ workspace | ||||
private static Workspace workspace; | private static Workspace workspace; | ||||
@@ -46,7 +46,7 @@ public class VAJTask extends Task | |||||
{ | { | ||||
if( remoteServer == null ) | if( remoteServer == null ) | ||||
{ | { | ||||
util = new VAJLocalToolUtil(); | |||||
util = new VAJLocalToolUtil( this ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -56,16 +56,4 @@ public class VAJTask extends Task | |||||
return util; | return util; | ||||
} | } | ||||
/** | |||||
* Adaption of VAJLocalUtil to Task context. | |||||
* | |||||
* @author RT | |||||
*/ | |||||
class VAJLocalToolUtil extends VAJLocalUtil | |||||
{ | |||||
public void log( String msg, int level ) | |||||
{ | |||||
VAJTask.this.log( msg, level ); | |||||
} | |||||
} | |||||
} | } |
@@ -14,16 +14,15 @@ import javax.servlet.http.HttpServletRequest; | |||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import org.apache.avalon.framework.ExceptionUtil; | import org.apache.avalon.framework.ExceptionUtil; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.util.StringUtils; | |||||
/** | /** | ||||
* Abstract base class to provide common services for the VAJ tool API servlets | * Abstract base class to provide common services for the VAJ tool API servlets | ||||
* | * | ||||
* @author Wolf Siberski, based on servlets written by Glenn McAllister | * @author Wolf Siberski, based on servlets written by Glenn McAllister | ||||
*/ | */ | ||||
public abstract class VAJToolsServlet extends HttpServlet | |||||
public abstract class VAJToolsServlet | |||||
extends HttpServlet | |||||
{ | { | ||||
// constants for servlet param names | // constants for servlet param names | ||||
public final static String DIR_PARAM = "dir"; | public final static String DIR_PARAM = "dir"; | ||||
public final static String INCLUDE_PARAM = "include"; | public final static String INCLUDE_PARAM = "include"; | ||||
@@ -197,10 +196,9 @@ public abstract class VAJToolsServlet extends HttpServlet | |||||
/** | /** | ||||
* Adaptation of VAJUtil for servlet context. | * Adaptation of VAJUtil for servlet context. | ||||
* | |||||
* @author RT | |||||
*/ | */ | ||||
class VAJLocalServletUtil extends VAJLocalUtil | |||||
class VAJLocalServletUtil | |||||
extends VAJLocalUtil | |||||
{ | { | ||||
public void log( String msg, int level ) | public void log( String msg, int level ) | ||||
{ | { | ||||
@@ -118,7 +118,7 @@ public class JlinkTask extends MatchingTask | |||||
{ | { | ||||
if( this.addfiles == null ) | if( this.addfiles == null ) | ||||
{ | { | ||||
this.addfiles = new Path( getProject() ); | |||||
this.addfiles = new Path(); | |||||
} | } | ||||
return this.addfiles.createPath(); | return this.addfiles.createPath(); | ||||
} | } | ||||
@@ -134,7 +134,7 @@ public class JlinkTask extends MatchingTask | |||||
{ | { | ||||
if( this.mergefiles == null ) | if( this.mergefiles == null ) | ||||
{ | { | ||||
this.mergefiles = new Path( getProject() ); | |||||
this.mergefiles = new Path(); | |||||
} | } | ||||
return this.mergefiles.createPath(); | return this.mergefiles.createPath(); | ||||
} | } | ||||
@@ -314,7 +314,7 @@ public class JspC extends MatchingTask | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -126,7 +126,7 @@ public class WLJspc extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( getProject() ); | |||||
compileClasspath = new Path(); | |||||
} | } | ||||
return compileClasspath; | return compileClasspath; | ||||
} | } | ||||
@@ -160,7 +160,7 @@ public class WLJspc extends MatchingTask | |||||
//use the systemclasspath as well, to include the ant jar | //use the systemclasspath as well, to include the ant jar | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( getProject() ); | |||||
compileClasspath = new Path(); | |||||
} | } | ||||
compileClasspath.append( Path.systemClasspath ); | compileClasspath.append( Path.systemClasspath ); | ||||
@@ -158,7 +158,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
{ | { | ||||
if( classPath == null ) | if( classPath == null ) | ||||
{ | { | ||||
classPath = new Path( getProject() ); | |||||
classPath = new Path(); | |||||
} | } | ||||
return classPath; | return classPath; | ||||
} | } | ||||
@@ -182,7 +182,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
{ | { | ||||
if( sourcePath == null ) | if( sourcePath == null ) | ||||
{ | { | ||||
sourcePath = new Path( getProject() ); | |||||
sourcePath = new Path(); | |||||
} | } | ||||
return sourcePath; | return sourcePath; | ||||
} | } | ||||
@@ -187,7 +187,7 @@ public abstract class DefaultRmicAdapter | |||||
{ | { | ||||
// add dest dir to classpath so that previously compiled and | // add dest dir to classpath so that previously compiled and | ||||
// untouched classes are on classpath | // untouched classes are on classpath | ||||
Path classpath = new Path( attributes.getProject() ); | |||||
Path classpath = new Path(); | |||||
classpath.setLocation( attributes.getBase() ); | classpath.setLocation( attributes.getBase() ); | ||||
// Combine the build classpath with the system classpath, in an | // Combine the build classpath with the system classpath, in an | ||||
@@ -228,7 +228,7 @@ public class CommandlineJava implements Cloneable | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( p ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath; | return classpath; | ||||
} | } | ||||
@@ -38,7 +38,6 @@ public class FileList extends DataType | |||||
{ | { | ||||
this.dir = filelist.dir; | this.dir = filelist.dir; | ||||
this.filenames = filelist.filenames; | this.filenames = filelist.filenames; | ||||
setProject( filelist.getProject() ); | |||||
} | } | ||||
public void setDir( File dir ) | public void setDir( File dir ) | ||||
@@ -50,7 +50,6 @@ public class FileSet | |||||
this.additionalPatterns = fileset.additionalPatterns; | this.additionalPatterns = fileset.additionalPatterns; | ||||
this.useDefaultExcludes = fileset.useDefaultExcludes; | this.useDefaultExcludes = fileset.useDefaultExcludes; | ||||
this.isCaseSensitive = fileset.isCaseSensitive; | this.isCaseSensitive = fileset.isCaseSensitive; | ||||
setProject( getProject() ); | |||||
} | } | ||||
/** | /** | ||||
@@ -62,7 +62,7 @@ public class Path | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
return new Path( null, System.getProperty( "java.class.path" ) ); | |||||
return new Path( System.getProperty( "java.class.path" ) ); | |||||
} | } | ||||
catch( final TaskException te ) | catch( final TaskException te ) | ||||
{ | { | ||||
@@ -73,20 +73,16 @@ public class Path | |||||
/** | /** | ||||
* Invoked by IntrospectionHelper for <code>setXXX(Path p)</code> attribute | * Invoked by IntrospectionHelper for <code>setXXX(Path p)</code> attribute | ||||
* setters. | * setters. | ||||
* | |||||
* @param p Description of Parameter | |||||
* @param path Description of Parameter | |||||
*/ | */ | ||||
public Path( Project p, String path ) | |||||
public Path( final String path ) | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
this( p ); | |||||
this(); | |||||
createPathElement().setPath( path ); | createPathElement().setPath( path ); | ||||
} | } | ||||
public Path( Project project ) | |||||
public Path() | |||||
{ | { | ||||
setProject( project ); | |||||
elements = new ArrayList(); | elements = new ArrayList(); | ||||
} | } | ||||
@@ -113,10 +109,6 @@ public class Path | |||||
/** | /** | ||||
* Splits a PATH (with : or ; as separators) into its parts. | * Splits a PATH (with : or ; as separators) into its parts. | ||||
* | |||||
* @param project Description of Parameter | |||||
* @param source Description of Parameter | |||||
* @return Description of the Returned Value | |||||
*/ | */ | ||||
public String[] translatePath( Project project, String source ) | public String[] translatePath( Project project, String source ) | ||||
{ | { | ||||
@@ -298,7 +290,7 @@ public class Path | |||||
String extProp = System.getProperty( "java.ext.dirs" ); | String extProp = System.getProperty( "java.ext.dirs" ); | ||||
if( extProp != null ) | if( extProp != null ) | ||||
{ | { | ||||
extdirs = new Path( getProject(), extProp ); | |||||
extdirs = new Path( extProp ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -363,38 +355,32 @@ public class Path | |||||
} | } | ||||
else if( Project.getJavaVersion() == Project.JAVA_1_1 ) | else if( Project.getJavaVersion() == Project.JAVA_1_1 ) | ||||
{ | { | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + "lib" | |||||
+ File.separator | |||||
+ "classes.zip" ) ); | |||||
final String classes = System.getProperty( "java.home" ) + | |||||
File.separator + "lib" + File.separator + "classes.zip"; | |||||
addExisting( new Path( classes ) ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
// JDK > 1.1 seems to set java.home to the JRE directory. | // JDK > 1.1 seems to set java.home to the JRE directory. | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + "lib" | |||||
+ File.separator + "rt.jar" ) ); | |||||
final String rt = System.getProperty( "java.home" ) + | |||||
File.separator + "lib" + File.separator + "rt.jar"; | |||||
addExisting( new Path( rt ) ); | |||||
// Just keep the old version as well and let addExisting | // Just keep the old version as well and let addExisting | ||||
// sort it out. | // sort it out. | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + "jre" | |||||
+ File.separator + "lib" | |||||
+ File.separator + "rt.jar" ) ); | |||||
final String rt2 = System.getProperty( "java.home" ) + | |||||
File.separator + "jre" + File.separator + "lib" + | |||||
File.separator + "rt.jar"; | |||||
addExisting( new Path( rt2 ) ); | |||||
// Added for MacOS X | // Added for MacOS X | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + ".." | |||||
+ File.separator + "Classes" | |||||
+ File.separator + "classes.jar" ) ); | |||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + ".." | |||||
+ File.separator + "Classes" | |||||
+ File.separator + "ui.jar" ) ); | |||||
final String classes = System.getProperty( "java.home" ) + | |||||
File.separator + ".." + File.separator + "Classes" + | |||||
File.separator + "classes.jar"; | |||||
addExisting( new Path( classes ) ); | |||||
final String ui = System.getProperty( "java.home" ) + | |||||
File.separator + ".." + File.separator + "Classes" + | |||||
File.separator + "ui.jar"; | |||||
addExisting( new Path( ui ) ); | |||||
} | } | ||||
} | } | ||||
@@ -427,7 +413,7 @@ public class Path | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
Path p = new Path( getProject() ); | |||||
Path p = new Path(); | |||||
p.append( this ); | p.append( this ); | ||||
return p; | return p; | ||||
} | } | ||||
@@ -461,7 +447,7 @@ public class Path | |||||
public Path concatSystemClasspath( String defValue ) | public Path concatSystemClasspath( String defValue ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
Path result = new Path( getProject() ); | |||||
Path result = new Path(); | |||||
String order = defValue; | String order = defValue; | ||||
if( getProject() != null ) | if( getProject() != null ) | ||||
@@ -521,7 +507,7 @@ public class Path | |||||
{ | { | ||||
throw noChildrenAllowed(); | throw noChildrenAllowed(); | ||||
} | } | ||||
Path p = new Path( getProject() ); | |||||
Path p = new Path(); | |||||
elements.add( p ); | elements.add( p ); | ||||
checked = false; | checked = false; | ||||
return p; | return p; | ||||
@@ -597,10 +583,6 @@ public class Path | |||||
else if( o instanceof Path ) | else if( o instanceof Path ) | ||||
{ | { | ||||
Path p = (Path)o; | Path p = (Path)o; | ||||
if( p.getProject() == null ) | |||||
{ | |||||
p.setProject( getProject() ); | |||||
} | |||||
String[] parts = p.list(); | String[] parts = p.list(); | ||||
for( int j = 0; j < parts.length; j++ ) | for( int j = 0; j < parts.length; j++ ) | ||||
{ | { | ||||
@@ -96,7 +96,7 @@ public class Available | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -106,7 +106,7 @@ public class Available | |||||
{ | { | ||||
if( this.filepath == null ) | if( this.filepath == null ) | ||||
{ | { | ||||
this.filepath = new Path( getProject() ); | |||||
this.filepath = new Path(); | |||||
} | } | ||||
return this.filepath.createPath(); | return this.filepath.createPath(); | ||||
} | } | ||||
@@ -129,7 +129,6 @@ public class Available | |||||
if( classpath != null ) | if( classpath != null ) | ||||
{ | { | ||||
classpath.setProject( getProject() ); | |||||
this.loader = new AntClassLoader( getProject(), classpath ); | this.loader = new AntClassLoader( getProject(), classpath ); | ||||
} | } | ||||
@@ -122,7 +122,7 @@ public class ExecuteOn extends ExecTask | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( getProject() ); | |||||
mapperElement = new Mapper(); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -658,7 +658,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( getProject() ); | |||||
bootclasspath = new Path(); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -673,7 +673,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( getProject() ); | |||||
compileClasspath = new Path(); | |||||
} | } | ||||
return compileClasspath.createPath(); | return compileClasspath.createPath(); | ||||
} | } | ||||
@@ -701,7 +701,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( extdirs == null ) | if( extdirs == null ) | ||||
{ | { | ||||
extdirs = new Path( getProject() ); | |||||
extdirs = new Path(); | |||||
} | } | ||||
return extdirs.createPath(); | return extdirs.createPath(); | ||||
} | } | ||||
@@ -716,7 +716,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( src == null ) | if( src == null ) | ||||
{ | { | ||||
src = new Path( getProject() ); | |||||
src = new Path(); | |||||
} | } | ||||
return src.createPath(); | return src.createPath(); | ||||
} | } | ||||
@@ -146,7 +146,7 @@ public class PathConvert extends Task | |||||
if( path == null ) | if( path == null ) | ||||
{ | { | ||||
path = new Path( getProject() ); | |||||
path = new Path(); | |||||
} | } | ||||
return path.createPath(); | return path.createPath(); | ||||
} | } | ||||
@@ -162,7 +162,7 @@ public class PathConvert extends Task | |||||
// If we are a reference, the create a Path from the reference | // If we are a reference, the create a Path from the reference | ||||
if( isReference() ) | if( isReference() ) | ||||
{ | { | ||||
path = new Path( getProject() ).createPath(); | |||||
path = new Path().createPath(); | |||||
Object obj = refid.getReferencedObject( getProject() ); | Object obj = refid.getReferencedObject( getProject() ); | ||||
@@ -131,7 +131,7 @@ public class Property extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -369,7 +369,7 @@ public class SQLExec extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -96,7 +96,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( getProject() ); | |||||
mapperElement = new Mapper(); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -44,7 +44,7 @@ public class Gcj extends DefaultCompilerAdapter | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
Path classpath = new Path( m_project ); | |||||
Path classpath = new Path(); | |||||
// gcj doesn't support bootclasspath dir (-bootclasspath) | // gcj doesn't support bootclasspath dir (-bootclasspath) | ||||
// so we'll emulate it for compatibility and convenience. | // so we'll emulate it for compatibility and convenience. | ||||
@@ -42,7 +42,7 @@ public class Jikes | |||||
{ | { | ||||
getLogger().debug( "Using jikes compiler" ); | getLogger().debug( "Using jikes compiler" ); | ||||
Path classpath = new Path( m_project ); | |||||
Path classpath = new Path(); | |||||
// Jikes doesn't support bootclasspath dir (-bootclasspath) | // Jikes doesn't support bootclasspath dir (-bootclasspath) | ||||
// so we'll emulate it for compatibility and convenience. | // so we'll emulate it for compatibility and convenience. | ||||
@@ -77,7 +77,7 @@ public class Jikes | |||||
String jikesPath = System.getProperty( "jikes.class.path" ); | String jikesPath = System.getProperty( "jikes.class.path" ); | ||||
if( jikesPath != null ) | if( jikesPath != null ) | ||||
{ | { | ||||
classpath.append( new Path( m_project, jikesPath ) ); | |||||
classpath.append( new Path( jikesPath ) ); | |||||
} | } | ||||
Commandline cmd = new Commandline(); | Commandline cmd = new Commandline(); | ||||
@@ -29,7 +29,7 @@ public class Jvc extends DefaultCompilerAdapter | |||||
{ | { | ||||
getLogger().debug( "Using jvc compiler" ); | getLogger().debug( "Using jvc compiler" ); | ||||
Path classpath = new Path( m_project ); | |||||
Path classpath = new Path(); | |||||
// jvc doesn't support bootclasspath dir (-bootclasspath) | // jvc doesn't support bootclasspath dir (-bootclasspath) | ||||
// so we'll emulate it for compatibility and convenience. | // so we'll emulate it for compatibility and convenience. | ||||
@@ -84,7 +84,7 @@ public class Kjc extends DefaultCompilerAdapter | |||||
// generate the clsspath | // generate the clsspath | ||||
cmd.createArgument().setValue( "-classpath" ); | cmd.createArgument().setValue( "-classpath" ); | ||||
Path cp = new Path( m_project ); | |||||
Path cp = new Path(); | |||||
// kjc don't have bootclasspath option. | // kjc don't have bootclasspath option. | ||||
if( m_bootclasspath != null ) | if( m_bootclasspath != null ) | ||||
@@ -199,11 +199,6 @@ public abstract class ConditionBase extends ProjectComponent | |||||
{ | { | ||||
throw new NoSuchElementException(); | throw new NoSuchElementException(); | ||||
} | } | ||||
if( o instanceof ProjectComponent ) | |||||
{ | |||||
( (ProjectComponent)o ).setProject( getProject() ); | |||||
} | |||||
return o; | return o; | ||||
} | } | ||||
} | } | ||||
@@ -75,7 +75,7 @@ public class DocletInfo | |||||
{ | { | ||||
if( m_path == null ) | if( m_path == null ) | ||||
{ | { | ||||
m_path = new Path( null ); | |||||
m_path = new Path(); | |||||
} | } | ||||
return m_path.createPath(); | return m_path.createPath(); | ||||
} | } | ||||
@@ -674,7 +674,7 @@ public class IContract extends MatchingTask | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath; | return classpath; | ||||
} | } | ||||
@@ -738,29 +738,29 @@ public class IContract extends MatchingTask | |||||
// Create the classpath required to compile the sourcefiles BEFORE instrumentation | // Create the classpath required to compile the sourcefiles BEFORE instrumentation | ||||
Path beforeInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | Path beforeInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | ||||
beforeInstrumentationClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
beforeInstrumentationClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
// Create the classpath required to compile the sourcefiles AFTER instrumentation | // Create the classpath required to compile the sourcefiles AFTER instrumentation | ||||
Path afterInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | Path afterInstrumentationClasspath = ( (Path)baseClasspath.clone() ); | ||||
afterInstrumentationClasspath.append( new Path( getProject(), instrumentDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( getProject(), repositoryDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( instrumentDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( repositoryDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
afterInstrumentationClasspath.append( new Path( buildDir.getAbsolutePath() ) ); | |||||
// Create the classpath required to automatically compile the repository files | // Create the classpath required to automatically compile the repository files | ||||
Path repositoryClasspath = ( (Path)baseClasspath.clone() ); | Path repositoryClasspath = ( (Path)baseClasspath.clone() ); | ||||
repositoryClasspath.append( new Path( getProject(), instrumentDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( getProject(), repositoryDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( instrumentDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( repositoryDir.getAbsolutePath() ) ); | |||||
repositoryClasspath.append( new Path( buildDir.getAbsolutePath() ) ); | |||||
// Create the classpath required for iContract itself | // Create the classpath required for iContract itself | ||||
Path iContractClasspath = ( (Path)baseClasspath.clone() ); | Path iContractClasspath = ( (Path)baseClasspath.clone() ); | ||||
iContractClasspath.append( new Path( getProject(), System.getProperty( "java.home" ) + File.separator + ".." + File.separator + "lib" + File.separator + "tools.jar" ) ); | |||||
iContractClasspath.append( new Path( getProject(), srcDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( getProject(), repositoryDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( getProject(), instrumentDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( System.getProperty( "java.home" ) + File.separator + ".." + File.separator + "lib" + File.separator + "tools.jar" ) ); | |||||
iContractClasspath.append( new Path( srcDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( repositoryDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( instrumentDir.getAbsolutePath() ) ); | |||||
iContractClasspath.append( new Path( buildDir.getAbsolutePath() ) ); | |||||
// Create a forked java process | // Create a forked java process | ||||
Java iContract = (Java)getProject().createTask( "java" ); | Java iContract = (Java)getProject().createTask( "java" ); | ||||
@@ -206,7 +206,7 @@ public class Javah extends Task | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( getProject() ); | |||||
bootclasspath = new Path(); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -222,7 +222,7 @@ public class Javah extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -101,7 +101,7 @@ public class Native2Ascii extends MatchingTask | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapper = new Mapper( getProject() ); | |||||
mapper = new Mapper(); | |||||
return mapper; | return mapper; | ||||
} | } | ||||
@@ -197,7 +197,8 @@ public class ReplaceRegExp extends Task | |||||
} | } | ||||
else if( file != null ) | else if( file != null ) | ||||
{ | { | ||||
final String message = "The following file is missing: '" + file.getAbsolutePath() + "'"; | |||||
final String message = | |||||
"The following file is missing: '" + file.getAbsolutePath() + "'"; | |||||
getLogger().error( message ); | getLogger().error( message ); | ||||
} | } | ||||
@@ -184,7 +184,7 @@ public class Depend extends MatchingTask | |||||
{ | { | ||||
if( dependClasspath == null ) | if( dependClasspath == null ) | ||||
{ | { | ||||
dependClasspath = new Path( getProject() ); | |||||
dependClasspath = new Path(); | |||||
} | } | ||||
return dependClasspath.createPath(); | return dependClasspath.createPath(); | ||||
} | } | ||||
@@ -422,7 +422,7 @@ public class CSharp | |||||
{ | { | ||||
//demand create pathlist | //demand create pathlist | ||||
if( _referenceFiles == null ) | if( _referenceFiles == null ) | ||||
_referenceFiles = new Path( this.getProject() ); | |||||
_referenceFiles = new Path(); | |||||
_referenceFiles.append( path ); | _referenceFiles.append( path ); | ||||
} | } | ||||
@@ -274,17 +274,18 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exec | |||||
*/ | */ | ||||
protected void addVendorFiles( Hashtable ejbFiles, String ddPrefix ) | protected void addVendorFiles( Hashtable ejbFiles, String ddPrefix ) | ||||
{ | { | ||||
File borlandDD = new File( getConfig().descriptorDir, ddPrefix + BAS_DD ); | |||||
final File borlandDD = new File( getConfig().descriptorDir, ddPrefix + BAS_DD ); | |||||
if( borlandDD.exists() ) | if( borlandDD.exists() ) | ||||
{ | { | ||||
getLogger().debug( "Borland specific file found " + borlandDD ); | |||||
final String message = "Borland specific file found " + borlandDD; | |||||
getLogger().debug( message ); | |||||
ejbFiles.put( META_DIR + BAS_DD, borlandDD ); | ejbFiles.put( META_DIR + BAS_DD, borlandDD ); | ||||
} | } | ||||
else | else | ||||
{ | { | ||||
log( "Unable to locate borland deployment descriptor. It was expected to be in " + | |||||
borlandDD.getPath(), Project.MSG_WARN ); | |||||
final String message = "Unable to locate borland deployment descriptor. " + | |||||
"It was expected to be in " + borlandDD.getPath(); | |||||
getLogger().warn( message ); | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
@@ -97,7 +97,7 @@ public class BorlandGenerateClient extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( getProject() ); | |||||
this.classpath = new Path(); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -124,7 +124,7 @@ public class DDCreator extends MatchingTask | |||||
ddCreatorTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper" ); | ddCreatorTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper" ); | ||||
Argument arguments = ddCreatorTask.createArg(); | Argument arguments = ddCreatorTask.createArg(); | ||||
arguments.setLine( args ); | arguments.setLine( args ); | ||||
ddCreatorTask.setClasspath( new Path( getProject(), execClassPath ) ); | |||||
ddCreatorTask.setClasspath( new Path( execClassPath ) ); | |||||
if( ddCreatorTask.executeJava() != 0 ) | if( ddCreatorTask.executeJava() != 0 ) | ||||
{ | { | ||||
throw new TaskException( "Execution of ddcreator helper failed" ); | throw new TaskException( "Execution of ddcreator helper failed" ); | ||||
@@ -254,7 +254,7 @@ public class EjbJar extends MatchingTask | |||||
{ | { | ||||
if( config.classpath == null ) | if( config.classpath == null ) | ||||
{ | { | ||||
config.classpath = new Path( getProject() ); | |||||
config.classpath = new Path(); | |||||
} | } | ||||
return config.classpath.createPath(); | return config.classpath.createPath(); | ||||
} | } | ||||
@@ -183,7 +183,7 @@ public class Ejbc extends MatchingTask | |||||
Argument arguments = helperTask.createArg(); | Argument arguments = helperTask.createArg(); | ||||
arguments.setLine( args ); | arguments.setLine( args ); | ||||
helperTask.setClasspath( new Path( getProject(), execClassPath ) ); | |||||
helperTask.setClasspath( new Path( execClassPath ) ); | |||||
if( helperTask.executeJava() != 0 ) | if( helperTask.executeJava() != 0 ) | ||||
{ | { | ||||
throw new TaskException( "Execution of ejbc helper failed" ); | throw new TaskException( "Execution of ejbc helper failed" ); | ||||
@@ -198,7 +198,7 @@ public class GenericDeploymentTool | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( task.getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -672,11 +672,6 @@ public class GenericDeploymentTool | |||||
*/ | */ | ||||
} | } | ||||
protected void log( String message, int level ) | |||||
{ | |||||
getTask().log( message, level ); | |||||
} | |||||
/** | /** | ||||
* This method checks the timestamp on each file listed in the <code> | * This method checks the timestamp on each file listed in the <code> | ||||
* ejbFiles</code> and compares them to the timestamp on the <code>jarFile | * ejbFiles</code> and compares them to the timestamp on the <code>jarFile | ||||
@@ -176,7 +176,7 @@ public class IPlanetEjbcTask extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -237,7 +237,7 @@ public class WLRun extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -251,7 +251,7 @@ public class WLRun extends Task | |||||
{ | { | ||||
if( weblogicClasspath == null ) | if( weblogicClasspath == null ) | ||||
{ | { | ||||
weblogicClasspath = new Path( getProject() ); | |||||
weblogicClasspath = new Path(); | |||||
} | } | ||||
return weblogicClasspath.createPath(); | return weblogicClasspath.createPath(); | ||||
} | } | ||||
@@ -120,7 +120,7 @@ public class WLStop extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -296,7 +296,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||||
{ | { | ||||
if( wlClasspath == null ) | if( wlClasspath == null ) | ||||
{ | { | ||||
wlClasspath = new Path( getTask().getProject() ); | |||||
wlClasspath = new Path(); | |||||
} | } | ||||
return wlClasspath.createPath(); | return wlClasspath.createPath(); | ||||
} | } | ||||
@@ -323,7 +323,7 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||||
protected ClassLoader getClassLoaderFromJar( File classjar ) | protected ClassLoader getClassLoaderFromJar( File classjar ) | ||||
throws IOException, TaskException | throws IOException, TaskException | ||||
{ | { | ||||
Path lookupPath = new Path( getTask().getProject() ); | |||||
Path lookupPath = new Path(); | |||||
lookupPath.setLocation( classjar ); | lookupPath.setLocation( classjar ); | ||||
Path classpath = getCombinedClasspath(); | Path classpath = getCombinedClasspath(); | ||||
@@ -740,7 +740,6 @@ public class WeblogicDeploymentTool extends GenericDeploymentTool | |||||
* @param sourceJar java.io.File representing the source (EJB1.1) jarfile. | * @param sourceJar java.io.File representing the source (EJB1.1) jarfile. | ||||
* @param destJar java.io.File representing the destination, WebLogic | * @param destJar java.io.File representing the destination, WebLogic | ||||
* jarfile. | * jarfile. | ||||
* @param publicId Description of Parameter | |||||
*/ | */ | ||||
private void buildWeblogicJar( File sourceJar, File destJar, String publicId ) | private void buildWeblogicJar( File sourceJar, File destJar, String publicId ) | ||||
throws TaskException | throws TaskException | ||||
@@ -376,7 +376,7 @@ public class WebsphereDeploymentTool | |||||
{ | { | ||||
if( wasClasspath == null ) | if( wasClasspath == null ) | ||||
{ | { | ||||
wasClasspath = new Path( getTask().getProject() ); | |||||
wasClasspath = new Path(); | |||||
} | } | ||||
return wasClasspath.createPath(); | return wasClasspath.createPath(); | ||||
} | } | ||||
@@ -403,7 +403,7 @@ public class WebsphereDeploymentTool | |||||
protected ClassLoader getClassLoaderFromJar( File classjar ) | protected ClassLoader getClassLoaderFromJar( File classjar ) | ||||
throws IOException, TaskException | throws IOException, TaskException | ||||
{ | { | ||||
Path lookupPath = new Path( getTask().getProject() ); | |||||
Path lookupPath = new Path(); | |||||
lookupPath.setLocation( classjar ); | lookupPath.setLocation( classjar ); | ||||
Path classpath = getCombinedClasspath(); | Path classpath = getCombinedClasspath(); | ||||
if( classpath != null ) | if( classpath != null ) | ||||
@@ -0,0 +1,27 @@ | |||||
/* | |||||
* Copyright (C) The Apache Software Foundation. All rights reserved. | |||||
* | |||||
* This software is published under the terms of the Apache Software License | |||||
* version 1.1, a copy of which has been included with this distribution in | |||||
* the LICENSE.txt file. | |||||
*/ | |||||
package org.apache.tools.ant.taskdefs.optional.ide; | |||||
/** | |||||
* Adaption of VAJLocalUtil to Task context. | |||||
*/ | |||||
class VAJLocalToolUtil | |||||
extends VAJLocalUtil | |||||
{ | |||||
private VAJTask m_task; | |||||
public VAJLocalToolUtil( final VAJTask task ) | |||||
{ | |||||
m_task = task; | |||||
} | |||||
public void log( final String msg, final int level ) | |||||
{ | |||||
m_task.log( msg, level ); | |||||
} | |||||
} |
@@ -28,7 +28,8 @@ import org.apache.tools.ant.DirectoryScanner; | |||||
* | * | ||||
* @author Wolf Siberski, TUI Infotec GmbH | * @author Wolf Siberski, TUI Infotec GmbH | ||||
*/ | */ | ||||
abstract class VAJLocalUtil implements VAJUtil | |||||
abstract class VAJLocalUtil | |||||
implements VAJUtil | |||||
{ | { | ||||
// singleton containing the VAJ workspace | // singleton containing the VAJ workspace | ||||
private static Workspace workspace; | private static Workspace workspace; | ||||
@@ -46,7 +46,7 @@ public class VAJTask extends Task | |||||
{ | { | ||||
if( remoteServer == null ) | if( remoteServer == null ) | ||||
{ | { | ||||
util = new VAJLocalToolUtil(); | |||||
util = new VAJLocalToolUtil( this ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -56,16 +56,4 @@ public class VAJTask extends Task | |||||
return util; | return util; | ||||
} | } | ||||
/** | |||||
* Adaption of VAJLocalUtil to Task context. | |||||
* | |||||
* @author RT | |||||
*/ | |||||
class VAJLocalToolUtil extends VAJLocalUtil | |||||
{ | |||||
public void log( String msg, int level ) | |||||
{ | |||||
VAJTask.this.log( msg, level ); | |||||
} | |||||
} | |||||
} | } |
@@ -14,16 +14,15 @@ import javax.servlet.http.HttpServletRequest; | |||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import org.apache.avalon.framework.ExceptionUtil; | import org.apache.avalon.framework.ExceptionUtil; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.util.StringUtils; | |||||
/** | /** | ||||
* Abstract base class to provide common services for the VAJ tool API servlets | * Abstract base class to provide common services for the VAJ tool API servlets | ||||
* | * | ||||
* @author Wolf Siberski, based on servlets written by Glenn McAllister | * @author Wolf Siberski, based on servlets written by Glenn McAllister | ||||
*/ | */ | ||||
public abstract class VAJToolsServlet extends HttpServlet | |||||
public abstract class VAJToolsServlet | |||||
extends HttpServlet | |||||
{ | { | ||||
// constants for servlet param names | // constants for servlet param names | ||||
public final static String DIR_PARAM = "dir"; | public final static String DIR_PARAM = "dir"; | ||||
public final static String INCLUDE_PARAM = "include"; | public final static String INCLUDE_PARAM = "include"; | ||||
@@ -197,10 +196,9 @@ public abstract class VAJToolsServlet extends HttpServlet | |||||
/** | /** | ||||
* Adaptation of VAJUtil for servlet context. | * Adaptation of VAJUtil for servlet context. | ||||
* | |||||
* @author RT | |||||
*/ | */ | ||||
class VAJLocalServletUtil extends VAJLocalUtil | |||||
class VAJLocalServletUtil | |||||
extends VAJLocalUtil | |||||
{ | { | ||||
public void log( String msg, int level ) | public void log( String msg, int level ) | ||||
{ | { | ||||
@@ -118,7 +118,7 @@ public class JlinkTask extends MatchingTask | |||||
{ | { | ||||
if( this.addfiles == null ) | if( this.addfiles == null ) | ||||
{ | { | ||||
this.addfiles = new Path( getProject() ); | |||||
this.addfiles = new Path(); | |||||
} | } | ||||
return this.addfiles.createPath(); | return this.addfiles.createPath(); | ||||
} | } | ||||
@@ -134,7 +134,7 @@ public class JlinkTask extends MatchingTask | |||||
{ | { | ||||
if( this.mergefiles == null ) | if( this.mergefiles == null ) | ||||
{ | { | ||||
this.mergefiles = new Path( getProject() ); | |||||
this.mergefiles = new Path(); | |||||
} | } | ||||
return this.mergefiles.createPath(); | return this.mergefiles.createPath(); | ||||
} | } | ||||
@@ -314,7 +314,7 @@ public class JspC extends MatchingTask | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
classpath = new Path( getProject() ); | |||||
classpath = new Path(); | |||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -126,7 +126,7 @@ public class WLJspc extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( getProject() ); | |||||
compileClasspath = new Path(); | |||||
} | } | ||||
return compileClasspath; | return compileClasspath; | ||||
} | } | ||||
@@ -160,7 +160,7 @@ public class WLJspc extends MatchingTask | |||||
//use the systemclasspath as well, to include the ant jar | //use the systemclasspath as well, to include the ant jar | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( getProject() ); | |||||
compileClasspath = new Path(); | |||||
} | } | ||||
compileClasspath.append( Path.systemClasspath ); | compileClasspath.append( Path.systemClasspath ); | ||||
@@ -158,7 +158,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
{ | { | ||||
if( classPath == null ) | if( classPath == null ) | ||||
{ | { | ||||
classPath = new Path( getProject() ); | |||||
classPath = new Path(); | |||||
} | } | ||||
return classPath; | return classPath; | ||||
} | } | ||||
@@ -182,7 +182,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
{ | { | ||||
if( sourcePath == null ) | if( sourcePath == null ) | ||||
{ | { | ||||
sourcePath = new Path( getProject() ); | |||||
sourcePath = new Path(); | |||||
} | } | ||||
return sourcePath; | return sourcePath; | ||||
} | } | ||||
@@ -187,7 +187,7 @@ public abstract class DefaultRmicAdapter | |||||
{ | { | ||||
// add dest dir to classpath so that previously compiled and | // add dest dir to classpath so that previously compiled and | ||||
// untouched classes are on classpath | // untouched classes are on classpath | ||||
Path classpath = new Path( attributes.getProject() ); | |||||
Path classpath = new Path(); | |||||
classpath.setLocation( attributes.getBase() ); | classpath.setLocation( attributes.getBase() ); | ||||
// Combine the build classpath with the system classpath, in an | // Combine the build classpath with the system classpath, in an | ||||
@@ -228,7 +228,7 @@ public class CommandlineJava implements Cloneable | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( p ); | |||||
classpath = new Path(); | |||||
} | } | ||||
return classpath; | return classpath; | ||||
} | } | ||||
@@ -38,7 +38,6 @@ public class FileList extends DataType | |||||
{ | { | ||||
this.dir = filelist.dir; | this.dir = filelist.dir; | ||||
this.filenames = filelist.filenames; | this.filenames = filelist.filenames; | ||||
setProject( filelist.getProject() ); | |||||
} | } | ||||
public void setDir( File dir ) | public void setDir( File dir ) | ||||
@@ -50,7 +50,6 @@ public class FileSet | |||||
this.additionalPatterns = fileset.additionalPatterns; | this.additionalPatterns = fileset.additionalPatterns; | ||||
this.useDefaultExcludes = fileset.useDefaultExcludes; | this.useDefaultExcludes = fileset.useDefaultExcludes; | ||||
this.isCaseSensitive = fileset.isCaseSensitive; | this.isCaseSensitive = fileset.isCaseSensitive; | ||||
setProject( getProject() ); | |||||
} | } | ||||
/** | /** | ||||
@@ -62,7 +62,7 @@ public class Path | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
return new Path( null, System.getProperty( "java.class.path" ) ); | |||||
return new Path( System.getProperty( "java.class.path" ) ); | |||||
} | } | ||||
catch( final TaskException te ) | catch( final TaskException te ) | ||||
{ | { | ||||
@@ -73,20 +73,16 @@ public class Path | |||||
/** | /** | ||||
* Invoked by IntrospectionHelper for <code>setXXX(Path p)</code> attribute | * Invoked by IntrospectionHelper for <code>setXXX(Path p)</code> attribute | ||||
* setters. | * setters. | ||||
* | |||||
* @param p Description of Parameter | |||||
* @param path Description of Parameter | |||||
*/ | */ | ||||
public Path( Project p, String path ) | |||||
public Path( final String path ) | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
this( p ); | |||||
this(); | |||||
createPathElement().setPath( path ); | createPathElement().setPath( path ); | ||||
} | } | ||||
public Path( Project project ) | |||||
public Path() | |||||
{ | { | ||||
setProject( project ); | |||||
elements = new ArrayList(); | elements = new ArrayList(); | ||||
} | } | ||||
@@ -113,10 +109,6 @@ public class Path | |||||
/** | /** | ||||
* Splits a PATH (with : or ; as separators) into its parts. | * Splits a PATH (with : or ; as separators) into its parts. | ||||
* | |||||
* @param project Description of Parameter | |||||
* @param source Description of Parameter | |||||
* @return Description of the Returned Value | |||||
*/ | */ | ||||
public String[] translatePath( Project project, String source ) | public String[] translatePath( Project project, String source ) | ||||
{ | { | ||||
@@ -298,7 +290,7 @@ public class Path | |||||
String extProp = System.getProperty( "java.ext.dirs" ); | String extProp = System.getProperty( "java.ext.dirs" ); | ||||
if( extProp != null ) | if( extProp != null ) | ||||
{ | { | ||||
extdirs = new Path( getProject(), extProp ); | |||||
extdirs = new Path( extProp ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -363,38 +355,32 @@ public class Path | |||||
} | } | ||||
else if( Project.getJavaVersion() == Project.JAVA_1_1 ) | else if( Project.getJavaVersion() == Project.JAVA_1_1 ) | ||||
{ | { | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + "lib" | |||||
+ File.separator | |||||
+ "classes.zip" ) ); | |||||
final String classes = System.getProperty( "java.home" ) + | |||||
File.separator + "lib" + File.separator + "classes.zip"; | |||||
addExisting( new Path( classes ) ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
// JDK > 1.1 seems to set java.home to the JRE directory. | // JDK > 1.1 seems to set java.home to the JRE directory. | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + "lib" | |||||
+ File.separator + "rt.jar" ) ); | |||||
final String rt = System.getProperty( "java.home" ) + | |||||
File.separator + "lib" + File.separator + "rt.jar"; | |||||
addExisting( new Path( rt ) ); | |||||
// Just keep the old version as well and let addExisting | // Just keep the old version as well and let addExisting | ||||
// sort it out. | // sort it out. | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + "jre" | |||||
+ File.separator + "lib" | |||||
+ File.separator + "rt.jar" ) ); | |||||
final String rt2 = System.getProperty( "java.home" ) + | |||||
File.separator + "jre" + File.separator + "lib" + | |||||
File.separator + "rt.jar"; | |||||
addExisting( new Path( rt2 ) ); | |||||
// Added for MacOS X | // Added for MacOS X | ||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + ".." | |||||
+ File.separator + "Classes" | |||||
+ File.separator + "classes.jar" ) ); | |||||
addExisting( new Path( null, | |||||
System.getProperty( "java.home" ) | |||||
+ File.separator + ".." | |||||
+ File.separator + "Classes" | |||||
+ File.separator + "ui.jar" ) ); | |||||
final String classes = System.getProperty( "java.home" ) + | |||||
File.separator + ".." + File.separator + "Classes" + | |||||
File.separator + "classes.jar"; | |||||
addExisting( new Path( classes ) ); | |||||
final String ui = System.getProperty( "java.home" ) + | |||||
File.separator + ".." + File.separator + "Classes" + | |||||
File.separator + "ui.jar"; | |||||
addExisting( new Path( ui ) ); | |||||
} | } | ||||
} | } | ||||
@@ -427,7 +413,7 @@ public class Path | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
Path p = new Path( getProject() ); | |||||
Path p = new Path(); | |||||
p.append( this ); | p.append( this ); | ||||
return p; | return p; | ||||
} | } | ||||
@@ -461,7 +447,7 @@ public class Path | |||||
public Path concatSystemClasspath( String defValue ) | public Path concatSystemClasspath( String defValue ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
Path result = new Path( getProject() ); | |||||
Path result = new Path(); | |||||
String order = defValue; | String order = defValue; | ||||
if( getProject() != null ) | if( getProject() != null ) | ||||
@@ -521,7 +507,7 @@ public class Path | |||||
{ | { | ||||
throw noChildrenAllowed(); | throw noChildrenAllowed(); | ||||
} | } | ||||
Path p = new Path( getProject() ); | |||||
Path p = new Path(); | |||||
elements.add( p ); | elements.add( p ); | ||||
checked = false; | checked = false; | ||||
return p; | return p; | ||||
@@ -597,10 +583,6 @@ public class Path | |||||
else if( o instanceof Path ) | else if( o instanceof Path ) | ||||
{ | { | ||||
Path p = (Path)o; | Path p = (Path)o; | ||||
if( p.getProject() == null ) | |||||
{ | |||||
p.setProject( getProject() ); | |||||
} | |||||
String[] parts = p.list(); | String[] parts = p.list(); | ||||
for( int j = 0; j < parts.length; j++ ) | for( int j = 0; j < parts.length; j++ ) | ||||
{ | { | ||||