From 23337b50631c2cd2ae5bde469a6b36b86bee6c09 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Mon, 8 Apr 2002 06:34:10 +0000 Subject: [PATCH] adding inheritRefs to , for better consistency with ant. The default is of course false. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@272283 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/taskdefs/CallTarget.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/CallTarget.java b/src/main/org/apache/tools/ant/taskdefs/CallTarget.java index a269b05e9..358627e5a 100644 --- a/src/main/org/apache/tools/ant/taskdefs/CallTarget.java +++ b/src/main/org/apache/tools/ant/taskdefs/CallTarget.java @@ -87,6 +87,7 @@ public class CallTarget extends Task { private String subTarget; private boolean initialized = false; private boolean inheritAll = true; + private boolean inheritRefs = false; /** * If true, inherit all properties from parent Project @@ -97,6 +98,18 @@ public class CallTarget extends Task { inheritAll = inherit; } //-- setInheritAll + /** + * set the inherit refs flag + * @param inheritRefs new value + */ + public void setInheritRefs(boolean inheritRefs) { + this.inheritRefs=inheritRefs; + } + + /** + * init this task by creating new instance of the ant task and + * configuring it's by calling its own init method. + */ public void init() { callee = (Ant) project.createTask("ant"); callee.setOwningTarget(target); @@ -106,7 +119,12 @@ public class CallTarget extends Task { initialized = true; } - public void execute() { + /** + * hand off the work to the ant task of ours, after setting it up + * @throws BuildException on validation failure or if the target didn't + * execute + */ + public void execute() throws BuildException { if (!initialized) { init(); } @@ -120,6 +138,7 @@ public class CallTarget extends Task { callee.setAntfile(project.getProperty("ant.file")); callee.setTarget(subTarget); callee.setInheritAll(inheritAll); + callee.setInheritRefs(inheritRefs); callee.execute(); }