diff --git a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java index 6cde7b4f9..e06c16ea6 100644 --- a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java +++ b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java @@ -176,5 +176,14 @@ public class CoreExecService implements ExecService { public String getProjectName() { return frame.getProjectName(); } + + /** + * Get the base directory for this execution of this frame + * + * @return the base directory + */ + public File getBaseDir() { + return frame.getBaseDir(); + } } diff --git a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionContext.java b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionContext.java index 7c2c0a3af..40bf4f13d 100755 --- a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionContext.java +++ b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionContext.java @@ -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 * diff --git a/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java b/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java index da8a49b7a..53d0d77fa 100644 --- a/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java +++ b/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java @@ -381,6 +381,17 @@ public class Project implements org.apache.ant.common.event.BuildListener { 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 * @@ -441,7 +452,7 @@ public class Project implements org.apache.ant.common.event.BuildListener { * @return the baseDir */ public File getBaseDir() { - return context.getBaseDir(); + return execService.getBaseDir(); } /** diff --git a/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ant.java b/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ant.java index a6d2a1920..1613748b2 100644 --- a/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ant.java +++ b/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/Ant.java @@ -106,7 +106,9 @@ public class Ant extends AntBase { */ public void execute() throws ExecutionException { if (baseDir == null) { - baseDir = getAntContext().getBaseDir(); + ExecService execService + = (ExecService)getCoreService(ExecService.class); + baseDir = execService.getBaseDir(); } File antFile = null; diff --git a/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java b/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java index 6443d16b2..478ee976d 100644 --- a/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java +++ b/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntCall.java @@ -69,10 +69,10 @@ public class AntCall extends AntBase { * @exception ExecutionException if the build fails */ public void execute() throws ExecutionException { - setProperty(MagicProperties.BASEDIR, - getAntContext().getBaseDir().getAbsolutePath()); ExecService execService = (ExecService)getCoreService(ExecService.class); + setProperty(MagicProperties.BASEDIR, + execService.getBaseDir().getAbsolutePath()); execService.callTarget(getProperties(), getTargets()); } diff --git a/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java b/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java index fd9988f10..3699e21c1 100644 --- a/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java +++ b/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java @@ -87,14 +87,7 @@ public interface AntContext { 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 */ diff --git a/proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java b/proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java index df27aab5e..376eaff62 100644 --- a/proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java +++ b/proposal/mutant/src/java/common/org/apache/ant/common/service/ExecService.java @@ -114,5 +114,11 @@ public interface ExecService { */ String getProjectName(); + /** + * Get the basedir for the current execution + * + * @return the base directory for this execution of Ant + */ + File getBaseDir(); }