git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272170 13f79535-47bb-0310-9956-ffa450edef68master
@@ -176,5 +176,14 @@ public class CoreExecService implements ExecService { | |||||
public String getProjectName() { | public String getProjectName() { | ||||
return frame.getProjectName(); | return frame.getProjectName(); | ||||
} | } | ||||
/** | |||||
* Get the base directory for this execution of this frame | |||||
* | |||||
* @return the base directory | |||||
*/ | |||||
public File getBaseDir() { | |||||
return frame.getBaseDir(); | |||||
} | |||||
} | } | ||||
@@ -115,15 +115,6 @@ public class ExecutionContext implements AntContext { | |||||
} | } | ||||
/** | |||||
* Get the base directory for this execution of this frame | |||||
* | |||||
* @return the base directory | |||||
*/ | |||||
public File getBaseDir() { | |||||
return frame.getBaseDir(); | |||||
} | |||||
/** | /** | ||||
* Gets the location associated with the ExecutionContext | * Gets the location associated with the ExecutionContext | ||||
* | * | ||||
@@ -381,6 +381,17 @@ public class Project implements org.apache.ant.common.event.BuildListener { | |||||
return description; | return description; | ||||
} | } | ||||
/** | |||||
* Get the Project's default Target, if any | |||||
* | |||||
* @return the project's default target or null if there is no default. | |||||
* @deprecated | |||||
*/ | |||||
public String getDefaultTarget() { | |||||
throw new BuildException("The default project target is no longer " | |||||
+ "available through this method."); | |||||
} | |||||
/** | /** | ||||
* Get a project property | * Get a project property | ||||
* | * | ||||
@@ -441,7 +452,7 @@ public class Project implements org.apache.ant.common.event.BuildListener { | |||||
* @return the baseDir | * @return the baseDir | ||||
*/ | */ | ||||
public File getBaseDir() { | public File getBaseDir() { | ||||
return context.getBaseDir(); | |||||
return execService.getBaseDir(); | |||||
} | } | ||||
/** | /** | ||||
@@ -106,7 +106,9 @@ public class Ant extends AntBase { | |||||
*/ | */ | ||||
public void execute() throws ExecutionException { | public void execute() throws ExecutionException { | ||||
if (baseDir == null) { | if (baseDir == null) { | ||||
baseDir = getAntContext().getBaseDir(); | |||||
ExecService execService | |||||
= (ExecService)getCoreService(ExecService.class); | |||||
baseDir = execService.getBaseDir(); | |||||
} | } | ||||
File antFile = null; | File antFile = null; | ||||
@@ -69,10 +69,10 @@ public class AntCall extends AntBase { | |||||
* @exception ExecutionException if the build fails | * @exception ExecutionException if the build fails | ||||
*/ | */ | ||||
public void execute() throws ExecutionException { | public void execute() throws ExecutionException { | ||||
setProperty(MagicProperties.BASEDIR, | |||||
getAntContext().getBaseDir().getAbsolutePath()); | |||||
ExecService execService | ExecService execService | ||||
= (ExecService)getCoreService(ExecService.class); | = (ExecService)getCoreService(ExecService.class); | ||||
setProperty(MagicProperties.BASEDIR, | |||||
execService.getBaseDir().getAbsolutePath()); | |||||
execService.callTarget(getProperties(), getTargets()); | execService.callTarget(getProperties(), getTargets()); | ||||
} | } | ||||
@@ -87,14 +87,7 @@ public interface AntContext { | |||||
throws ExecutionException; | throws ExecutionException; | ||||
/** | /** | ||||
* Get the basedir for the current execution | |||||
* | |||||
* @return the base directory for this execution of Ant | |||||
*/ | |||||
File getBaseDir(); | |||||
/** | |||||
* Gets the location associated witj the AntContext | |||||
* Gets the location associated with the AntContext | |||||
* | * | ||||
* @return the location | * @return the location | ||||
*/ | */ | ||||
@@ -114,5 +114,11 @@ public interface ExecService { | |||||
*/ | */ | ||||
String getProjectName(); | String getProjectName(); | ||||
/** | |||||
* Get the basedir for the current execution | |||||
* | |||||
* @return the base directory for this execution of Ant | |||||
*/ | |||||
File getBaseDir(); | |||||
} | } | ||||