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 d55e358aa..6cde7b4f9 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 @@ -167,5 +167,14 @@ public class CoreExecService implements ExecService { frame.getEventSupport().fireTaskFinished(task, failureCause); } } + + /** + * get the name of the project associated with this execution. + * + * @return the project's name + */ + public String getProjectName() { + return frame.getProjectName(); + } } diff --git a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java index 20dc785ab..c29a8f495 100644 --- a/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java +++ b/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java @@ -200,6 +200,18 @@ public class Frame implements DemuxOutputReceiver { setMagicProperties(); } + /** + * get the name of the project associated with this frame. + * + * @return the project's name + */ + public String getProjectName() { + if (project != null) { + return project.getName(); + } + return null; + } + /** * Set a value in this frame or any of its imported frames. * 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 c0bfd5a5f..c1d227829 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 @@ -67,6 +67,7 @@ import org.apache.ant.common.antlib.AntLibFactory; import org.apache.ant.common.event.MessageLevel; import org.apache.ant.common.service.ComponentService; import org.apache.ant.common.service.DataService; +import org.apache.ant.common.service.ExecService; import org.apache.ant.common.service.FileService; import org.apache.ant.common.util.ExecutionException; import org.apache.ant.common.util.PropertyUtils; @@ -143,6 +144,9 @@ public class Project implements org.apache.ant.common.event.BuildListener { /** The core's DataService instance */ private DataService dataService; + /** Th ecore's execution service */ + private ExecService execService; + /** The core's Component Service instance */ private ComponentService componentService; @@ -715,6 +719,7 @@ public class Project implements org.apache.ant.common.event.BuildListener { this.context = context; fileService = (FileService)context.getCoreService(FileService.class); dataService = (DataService)context.getCoreService(DataService.class); + execService = (ExecService)context.getCoreService(ExecService.class); componentService = (ComponentService)context.getCoreService(ComponentService.class); @@ -1072,5 +1077,14 @@ public class Project implements org.apache.ant.common.event.BuildListener { listener.messageLogged(event); } } + + /** + * Get the name of the project. + * + * @return the project name + */ + public String getName() { + return execService.getProjectName(); + } } diff --git a/proposal/mutant/src/java/common/org/apache/ant/common/model/Project.java b/proposal/mutant/src/java/common/org/apache/ant/common/model/Project.java index b879f9e8d..53fe5da58 100644 --- a/proposal/mutant/src/java/common/org/apache/ant/common/model/Project.java +++ b/proposal/mutant/src/java/common/org/apache/ant/common/model/Project.java @@ -192,7 +192,15 @@ public class Project extends ModelElement { return base; } - + /** + * Get the name of the project element + * + * @return the project's name + */ + public String getName() { + return name; + } + /** * Get the targets in this project. * diff --git a/proposal/mutant/src/java/common/org/apache/ant/common/service/DataService.java b/proposal/mutant/src/java/common/org/apache/ant/common/service/DataService.java index ef4919207..6e5cd29d4 100644 --- a/proposal/mutant/src/java/common/org/apache/ant/common/service/DataService.java +++ b/proposal/mutant/src/java/common/org/apache/ant/common/service/DataService.java @@ -137,6 +137,5 @@ public interface DataService { * name. */ Map getAllProperties(); - } 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 f2e2759fd..df27aab5e 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 @@ -106,5 +106,13 @@ public interface ExecService { * @exception ExecutionException if there is a problem in execution. */ void executeTask(Task task) throws ExecutionException; + + /** + * get the name of the project associated with this execution. + * + * @return the project's name + */ + String getProjectName(); + }